FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::SurfaceReactionModel
00026 
00027 Description
00028     Templated surface reaction model class
00029 
00030 SourceFiles
00031     SurfaceReactionModel.C
00032     NewSurfaceReactionModel.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef SurfaceReactionModel_H
00037 #define SurfaceReactionModel_H
00038 
00039 #include <OpenFOAM/IOdictionary.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 #include <OpenFOAM/runTimeSelectionTables.H>
00042 
00043 #include <OpenFOAM/scalarField.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 /*---------------------------------------------------------------------------*\
00051                      Class SurfaceReactionModel Declaration
00052 \*---------------------------------------------------------------------------*/
00053 
00054 template<class CloudType>
00055 class SurfaceReactionModel
00056 {
00057     // Private data
00058 
00059         //- The cloud dictionary
00060         const dictionary& dict_;
00061 
00062         //- Reference to the owner cloud class
00063         CloudType& owner_;
00064 
00065         //- The coefficients dictionary
00066         const dictionary coeffDict_;
00067 
00068 
00069 public:
00070 
00071     //-Runtime type information
00072     TypeName("SurfaceReactionModel");
00073 
00074 
00075     //- Declare runtime constructor selection table
00076     declareRunTimeSelectionTable
00077     (
00078         autoPtr,
00079         SurfaceReactionModel,
00080         dictionary,
00081         (
00082             const dictionary& dict,
00083             CloudType& cloud
00084         ),
00085         (dict, cloud)
00086     );
00087 
00088 
00089     // Constructors
00090 
00091         //- Construct null from owner
00092         SurfaceReactionModel(CloudType& owner);
00093 
00094         //- Construct from dictionary
00095         SurfaceReactionModel
00096         (
00097             const dictionary& dict,
00098             CloudType& cloud,
00099             const word& type
00100         );
00101 
00102 
00103     //- Destructor
00104     virtual ~SurfaceReactionModel();
00105 
00106 
00107     //- Selector
00108     static autoPtr<SurfaceReactionModel<CloudType> > New
00109     (
00110         const dictionary& dict,
00111         CloudType& cloud
00112     );
00113 
00114 
00115     // Access
00116 
00117         //- Return the owner cloud object
00118         const CloudType& owner() const;
00119 
00120         //- Return the cloud dictionary
00121         const dictionary& dict() const;
00122 
00123         //- Return the coefficients dictionary
00124         const dictionary& coeffDict() const;
00125 
00126 
00127     // Member Functions
00128 
00129         //- Flag to indicate whether model activates surface reaction model
00130         virtual bool active() const = 0;
00131 
00132         //- Update surface reactions
00133         //  Returns the heat of reaction
00134         virtual scalar calculate
00135         (
00136             const scalar dt,
00137             const label cellI,
00138             const scalar d,
00139             const scalar T,
00140             const scalar Tc,
00141             const scalar pc,
00142             const scalar rhoc,
00143             const scalar mass,
00144             const scalarField& YGas,
00145             const scalarField& YLiquid,
00146             const scalarField& YSolid,
00147             const scalarField& YMixture,
00148             const scalar N,
00149             scalarField& dMassGas,
00150             scalarField& dMassLiquid,
00151             scalarField& dMassSolid,
00152             scalarField& dMassSRCarrier
00153         ) const = 0;
00154 };
00155 
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 } // End namespace Foam
00160 
00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00162 
00163 #define makeSurfaceReactionModel(CloudType)                                   \
00164                                                                               \
00165     defineNamedTemplateTypeNameAndDebug(SurfaceReactionModel<CloudType>, 0);  \
00166                                                                               \
00167     defineTemplateRunTimeSelectionTable                                       \
00168     (                                                                         \
00169         SurfaceReactionModel<CloudType>,                                      \
00170         dictionary                                                            \
00171     );
00172 
00173 
00174 #define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\
00175                                                                               \
00176     defineNamedTemplateTypeNameAndDebug                                       \
00177     (                                                                         \
00178         SS<CloudType<ParcelType<ThermoType> > >,                              \
00179         0                                                                     \
00180     );                                                                        \
00181                                                                               \
00182     SurfaceReactionModel<CloudType<ParcelType<ThermoType> > >::               \
00183         adddictionaryConstructorToTable                                       \
00184             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00185             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00186 
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 #ifdef NoRepository
00191 #   include <lagrangianIntermediate/SurfaceReactionModel.C>
00192 #endif
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 #endif
00197 
00198 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines