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

DevolatilisationModel.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) 2008-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::DevolatilisationModel
00026 
00027 Description
00028     Templated devolatilisation model class
00029 
00030 SourceFiles
00031     DevolatilisationModel.C
00032     NewDevolatilisationModel.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef DevolatilisationModel_H
00037 #define DevolatilisationModel_H
00038 
00039 #include <OpenFOAM/IOdictionary.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 #include <OpenFOAM/runTimeSelectionTables.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                       Class DevolatilisationModel Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class CloudType>
00053 class DevolatilisationModel
00054 {
00055 protected:
00056 
00057     // Protected data
00058 
00059         //- The cloud dictionary
00060         const dictionary& dict_;
00061 
00062         //- Reference to the owner cloud class
00063         CloudType& owner_;
00064 
00065         //- The coefficient dictionary
00066         const dictionary coeffDict_;
00067 
00068 
00069 public:
00070 
00071     //- Runtime type information
00072     TypeName("DevolatilisationModel");
00073 
00074     //- Declare runtime constructor selection table
00075     declareRunTimeSelectionTable
00076     (
00077         autoPtr,
00078         DevolatilisationModel,
00079         dictionary,
00080         (
00081             const dictionary& dict,
00082             CloudType& owner
00083         ),
00084         (dict, owner)
00085     );
00086 
00087 
00088     // Constructors
00089 
00090         //- Construct null from owner
00091         DevolatilisationModel(CloudType& owner);
00092 
00093         //- Construct from dictionary
00094         DevolatilisationModel
00095         (
00096             const dictionary& dict,
00097             CloudType& owner,
00098             const word& type
00099         );
00100 
00101 
00102     //- Destructor
00103     virtual ~DevolatilisationModel();
00104 
00105 
00106     //- Selector
00107     static autoPtr<DevolatilisationModel<CloudType> > New
00108     (
00109         const dictionary& dict,
00110         CloudType& owner
00111     );
00112 
00113 
00114     // Access
00115 
00116         //- Return the owner cloud object
00117         const CloudType& owner() const;
00118 
00119         //- Return the cloud dictionary
00120         const dictionary& dict() const;
00121 
00122         //- Return the coefficient dictionary
00123         const dictionary& coeffDict() const;
00124 
00125 
00126     // Member Functions
00127 
00128         //- Flag to indicate whether model activates devolatilisation model
00129         virtual bool active() const = 0;
00130 
00131         //- Update model
00132         virtual scalar calculate
00133         (
00134             const scalar dt,
00135             const scalar mass0,
00136             const scalar mass,
00137             const scalar T,
00138             const scalar YVolatile0,
00139             const scalar YVolatile,
00140             bool& canCombust
00141         ) const = 0;
00142 };
00143 
00144 
00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00146 
00147 } // End namespace Foam
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 #define makeDevolatilisationModel(CloudType)                                  \
00152                                                                               \
00153     defineNamedTemplateTypeNameAndDebug(DevolatilisationModel<CloudType>, 0); \
00154                                                                               \
00155     defineTemplateRunTimeSelectionTable                                       \
00156     (                                                                         \
00157         DevolatilisationModel<CloudType>,                                     \
00158         dictionary                                                            \
00159     );
00160 
00161 
00162 #define makeDevolatilisationModelThermoType(SS, CloudType, ParcelType, ThermoType)\
00163                                                                               \
00164     defineNamedTemplateTypeNameAndDebug                                       \
00165     (                                                                         \
00166         SS<CloudType<ParcelType<ThermoType> > >,                              \
00167         0                                                                     \
00168     );                                                                        \
00169                                                                               \
00170     DevolatilisationModel<CloudType<ParcelType<ThermoType> > >::              \
00171         adddictionaryConstructorToTable                                       \
00172             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00173             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00174 
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 #ifdef NoRepository
00179 #   include "DevolatilisationModel.C"
00180 #endif
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 #endif
00185 
00186 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines