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

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