1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Templated base class for reacting cloud
31 - Adds to thermodynamic cloud
32 - Variable composition (single phase)
39 \*---------------------------------------------------------------------------*/
41 #ifndef ReactingCloud_H
42 #define ReactingCloud_H
44 #include "ThermoCloud.H"
45 #include "reactingCloud.H"
46 #include "multiComponentMixture.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of classes
55 template<class CloudType>
56 class CompositionModel;
58 template<class CloudType>
59 class PhaseChangeModel;
61 /*---------------------------------------------------------------------------*\
62 Class ReactingCloud Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class ParcelType>
68 public ThermoCloud<ParcelType>,
73 //- Type of thermodynamics the cloud was instantiated for
74 typedef typename ParcelType::thermoType thermoType;
79 // Private Member Functions
81 //- Disallow default bitwise copy construct
82 ReactingCloud(const ReactingCloud&);
84 //- Disallow default bitwise assignment
85 void operator=(const ReactingCloud&);
92 //- Parcel constant properties
93 typename ParcelType::constantProperties constProps_;
95 //- Multi-component carrier phase thermo
96 multiComponentMixture<thermoType>& mcCarrierThermo_;
99 // References to the cloud sub-models
101 //- Reacting composition model
102 autoPtr<CompositionModel<ReactingCloud<ParcelType> > >
105 //- Reacting phase change model
106 autoPtr<PhaseChangeModel<ReactingCloud<ParcelType> > >
112 //- Mass transfer fields - one per carrier phase specie
113 PtrList<DimensionedField<scalar, volMesh> > rhoTrans_;
118 //- Total mass transferred to continuous phase via phase change
119 scalar dMassPhaseChange_;
122 // Protected Member Functions
124 // New parcel helper functions
126 //- Check that size of a composition field is valid
127 void checkSuppliedComposition
129 const scalarField& YSupplied,
130 const scalarField& Y,
135 // Cloud evolution functions
151 //- Construct given carrier gas fields
154 const word& cloudName,
155 const volScalarField& rho,
156 const volVectorField& U,
157 const dimensionedVector& g,
159 bool readFields = true
164 virtual ~ReactingCloud();
167 //- Type of parcel the cloud was instantiated for
168 typedef ParcelType parcelType;
175 //- Return the constant properties
176 inline const typename ParcelType::constantProperties&
179 //- Return const access to multi-component carrier phase thermo
180 inline const multiComponentMixture<thermoType>&
181 mcCarrierThermo() const;
183 //- Return access to multi-component carrier phase thermo
184 inline multiComponentMixture<thermoType>& mcCarrierThermo();
189 //- Return reference to reacting composition model
190 inline const CompositionModel<ReactingCloud<ParcelType> >&
193 //- Return reference to reacting phase change model
194 inline const PhaseChangeModel<ReactingCloud<ParcelType> >&
202 //- Return reference to mass source for field i
203 inline DimensionedField<scalar, volMesh>&
204 rhoTrans(const label i);
206 //- Return reference to mass source fields
207 inline PtrList<DimensionedField<scalar, volMesh> >&
210 //- Return tmp mass source for field i - fully explicit
211 inline tmp<DimensionedField<scalar, volMesh> >
212 Srho(const label i) const;
214 //- Return tmp total mass source for carrier phase
216 inline tmp<DimensionedField<scalar, volMesh> > Srho() const;
221 //- Print cloud information
224 //- Add to cumulative phase change mass transfer
225 void addToMassPhaseChange(const scalar dMass);
228 // Cloud evolution functions
230 //- Check parcel properties
231 void checkParcelProperties
234 const scalar lagrangianDt,
235 const bool fullyDescribed
238 //- Reset the spray source terms
239 void resetSourceTerms();
241 //- Evolve the spray (inject, move)
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 } // End namespace Foam
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 #include "ReactingCloudI.H"
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 # include "ReactingCloud.C"
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 // ************************************************************************* //