OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

SurfaceReactionModel.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::SurfaceReactionModel
00027 
00028 Description
00029     Templated surface reaction model class
00030 
00031 SourceFiles
00032     SurfaceReactionModel.C
00033     NewSurfaceReactionModel.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef SurfaceReactionModel_H
00038 #define SurfaceReactionModel_H
00039 
00040 #include "IOdictionary.H"
00041 #include "autoPtr.H"
00042 #include "runTimeSelectionTables.H"
00043 
00044 #include "scalarField.H"
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 /*---------------------------------------------------------------------------*\
00052                      Class SurfaceReactionModel Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 template<class CloudType>
00056 class SurfaceReactionModel
00057 {
00058     // Private data
00059 
00060         //- The cloud dictionary
00061         const dictionary& dict_;
00062 
00063         //- Reference to the owner cloud class
00064         CloudType& owner_;
00065 
00066         //- The coefficients dictionary
00067         const dictionary coeffDict_;
00068 
00069 
00070 public:
00071 
00072     //-Runtime type information
00073     TypeName("SurfaceReactionModel");
00074 
00075 
00076     //- Declare runtime constructor selection table
00077     declareRunTimeSelectionTable
00078     (
00079         autoPtr,
00080         SurfaceReactionModel,
00081         dictionary,
00082         (
00083             const dictionary& dict,
00084             CloudType& cloud
00085         ),
00086         (dict, cloud)
00087     );
00088 
00089 
00090     // Constructors
00091 
00092         //- Construct null from owner
00093         SurfaceReactionModel(CloudType& owner);
00094 
00095         //- Construct from dictionary
00096         SurfaceReactionModel
00097         (
00098             const dictionary& dict,
00099             CloudType& cloud,
00100             const word& type
00101         );
00102 
00103 
00104     //- Destructor
00105     virtual ~SurfaceReactionModel();
00106 
00107 
00108     //- Selector
00109     static autoPtr<SurfaceReactionModel<CloudType> > New
00110     (
00111         const dictionary& dict,
00112         CloudType& cloud
00113     );
00114 
00115 
00116     // Access
00117 
00118         //- Return the owner cloud object
00119         const CloudType& owner() const;
00120 
00121         //- Return the cloud dictionary
00122         const dictionary& dict() const;
00123 
00124         //- Return the coefficients dictionary
00125         const dictionary& coeffDict() const;
00126 
00127 
00128     // Member Functions
00129 
00130         //- Flag to indicate whether model activates surface reaction model
00131         virtual bool active() const = 0;
00132 
00133         //- Update surface reactions
00134         //  Returns the heat of reaction
00135         virtual scalar calculate
00136         (
00137             const scalar dt,
00138             const label cellI,
00139             const scalar d,
00140             const scalar T,
00141             const scalar Tc,
00142             const scalar pc,
00143             const scalar rhoc,
00144             const scalar mass,
00145             const scalarField& YGas,
00146             const scalarField& YLiquid,
00147             const scalarField& YSolid,
00148             const scalarField& YMixture,
00149             const scalarField& dMassVolatile,
00150             scalarField& dMassGas,
00151             scalarField& dMassLiquid,
00152             scalarField& dMassSolid,
00153             scalarField& dMassSRCarrier
00154         ) const = 0;
00155 };
00156 
00157 
00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00159 
00160 } // End namespace Foam
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 #define makeSurfaceReactionModel(CloudType)                                   \
00165                                                                               \
00166     defineNamedTemplateTypeNameAndDebug(SurfaceReactionModel<CloudType>, 0);  \
00167                                                                               \
00168     defineTemplateRunTimeSelectionTable                                       \
00169     (                                                                         \
00170         SurfaceReactionModel<CloudType>,                                      \
00171         dictionary                                                            \
00172     );
00173 
00174 
00175 #define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\
00176                                                                               \
00177     defineNamedTemplateTypeNameAndDebug                                       \
00178     (                                                                         \
00179         SS<CloudType<ParcelType<ThermoType> > >,                              \
00180         0                                                                     \
00181     );                                                                        \
00182                                                                               \
00183     SurfaceReactionModel<CloudType<ParcelType<ThermoType> > >::               \
00184         adddictionaryConstructorToTable                                       \
00185             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00186             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00187 
00188 
00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00190 
00191 #ifdef NoRepository
00192 #   include "SurfaceReactionModel.C"
00193 #endif
00194 
00195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00196 
00197 #endif
00198 
00199 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd