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

ReactingCloud_.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::ReactingCloud
00026 
00027 Description
00028     Templated base class for reacting cloud
00029 
00030     - Adds to thermodynamic cloud
00031       - Variable composition (single phase)
00032       - Phase change
00033 
00034 SourceFiles
00035     ReactingCloudI.H
00036     ReactingCloud.C
00037 
00038 \*---------------------------------------------------------------------------*/
00039 
00040 #ifndef ReactingCloud_H
00041 #define ReactingCloud_H
00042 
00043 #include <lagrangianIntermediate/ThermoCloud_.H>
00044 #include <lagrangianIntermediate/reactingCloud.H>
00045 #include <reactionThermophysicalModels/multiComponentMixture.H>
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 // Forward declaration of classes
00053 
00054 template<class CloudType>
00055 class CompositionModel;
00056 
00057 template<class CloudType>
00058 class PhaseChangeModel;
00059 
00060 /*---------------------------------------------------------------------------*\
00061                       Class ReactingCloud Declaration
00062 \*---------------------------------------------------------------------------*/
00063 
00064 template<class ParcelType>
00065 class ReactingCloud
00066 :
00067     public ThermoCloud<ParcelType>,
00068     public reactingCloud
00069 {
00070 public:
00071 
00072     //- Type of thermodynamics the cloud was instantiated for
00073     typedef typename ParcelType::thermoType thermoType;
00074 
00075 
00076 private:
00077 
00078     // Private Member Functions
00079 
00080         //- Disallow default bitwise copy construct
00081         ReactingCloud(const ReactingCloud&);
00082 
00083         //- Disallow default bitwise assignment
00084         void operator=(const ReactingCloud&);
00085 
00086 
00087 protected:
00088 
00089     // Protected data
00090 
00091         //- Parcel constant properties
00092         typename ParcelType::constantProperties constProps_;
00093 
00094         //- Multi-component carrier phase thermo
00095         multiComponentMixture<thermoType>& mcCarrierThermo_;
00096 
00097 
00098         // References to the cloud sub-models
00099 
00100             //- Reacting composition model
00101             autoPtr<CompositionModel<ReactingCloud<ParcelType> > >
00102                 compositionModel_;
00103 
00104             //- Reacting phase change model
00105             autoPtr<PhaseChangeModel<ReactingCloud<ParcelType> > >
00106                 phaseChangeModel_;
00107 
00108 
00109         // Sources
00110 
00111             //- Mass transfer fields - one per carrier phase specie
00112             PtrList<DimensionedField<scalar, volMesh> > rhoTrans_;
00113 
00114 
00115         // Check
00116 
00117             //- Total mass transferred to continuous phase via phase change
00118             scalar dMassPhaseChange_;
00119 
00120 
00121     // Protected Member Functions
00122 
00123         // New parcel helper functions
00124 
00125             //- Check that size of a composition field is valid
00126             void checkSuppliedComposition
00127             (
00128                 const scalarField& YSupplied,
00129                 const scalarField& Y,
00130                 const word& YName
00131             );
00132 
00133 
00134         // Cloud evolution functions
00135 
00136             //- Pre-evolve
00137             void preEvolve();
00138 
00139             //- Evolve the cloud
00140             void evolveCloud();
00141 
00142             //- Post-evolve
00143             void postEvolve();
00144 
00145 
00146 public:
00147 
00148     // Constructors
00149 
00150         //- Construct given carrier gas fields
00151         ReactingCloud
00152         (
00153             const word& cloudName,
00154             const volScalarField& rho,
00155             const volVectorField& U,
00156             const dimensionedVector& g,
00157             basicThermo& thermo,
00158             bool readFields = true
00159         );
00160 
00161 
00162     //- Destructor
00163     virtual ~ReactingCloud();
00164 
00165 
00166     //- Type of parcel the cloud was instantiated for
00167     typedef ParcelType parcelType;
00168 
00169 
00170     // Member Functions
00171 
00172         // Access
00173 
00174             //- Return the constant properties
00175             inline const typename ParcelType::constantProperties&
00176                 constProps() const;
00177 
00178             //- Return const access to multi-component carrier phase thermo
00179             inline const multiComponentMixture<thermoType>&
00180                 mcCarrierThermo() const;
00181 
00182             //- Return access to multi-component carrier phase thermo
00183             inline multiComponentMixture<thermoType>& mcCarrierThermo();
00184 
00185 
00186             // Sub-models
00187 
00188                 //- Return reference to reacting composition model
00189                 inline const CompositionModel<ReactingCloud<ParcelType> >&
00190                     composition() const;
00191 
00192                 //- Return reference to reacting phase change model
00193                 inline const PhaseChangeModel<ReactingCloud<ParcelType> >&
00194                     phaseChange() const;
00195 
00196 
00197             // Sources
00198 
00199                 //- Mass
00200 
00201                     //- Return reference to mass source for field i
00202                     inline DimensionedField<scalar, volMesh>&
00203                         rhoTrans(const label i);
00204 
00205                     //- Return reference to mass source fields
00206                     inline PtrList<DimensionedField<scalar, volMesh> >&
00207                         rhoTrans();
00208 
00209                     //- Return tmp mass source for field i - fully explicit
00210                     inline tmp<DimensionedField<scalar, volMesh> >
00211                         Srho(const label i) const;
00212 
00213                     //- Return tmp total mass source for carrier phase
00214                     //  - fully explicit
00215                     inline tmp<DimensionedField<scalar, volMesh> > Srho() const;
00216 
00217 
00218         // Check
00219 
00220             //- Print cloud information
00221             void info() const;
00222 
00223             //- Add to cumulative phase change mass transfer
00224             void addToMassPhaseChange(const scalar dMass);
00225 
00226 
00227         // Cloud evolution functions
00228 
00229             //- Check parcel properties
00230             void checkParcelProperties
00231             (
00232                 ParcelType& parcel,
00233                 const scalar lagrangianDt,
00234                 const bool fullyDescribed
00235             );
00236 
00237             //- Reset the spray source terms
00238             void resetSourceTerms();
00239 
00240             //- Evolve the spray (inject, move)
00241             void evolve();
00242 };
00243 
00244 
00245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00246 
00247 } // End namespace Foam
00248 
00249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00250 
00251 #include "ReactingCloudI_.H"
00252 
00253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00254 
00255 #ifdef NoRepository
00256 #   include "ReactingCloud_.C"
00257 #endif
00258 
00259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00260 
00261 #endif
00262 
00263 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines