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

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