Merge /u/wyldckat/foam-extend32/ branch master into master
[foam-extend-3.2.git] / src / lagrangian / intermediate / clouds / Templates / ReactingCloud / ReactingCloudTemplate.H
blobcf7e867053c58d48a03c8e23ab10fa078eb4d56f
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::ReactingCloud
27 Description
28     Templated base class for reacting cloud
30     - Adds to thermodynamic cloud
31       - Variable composition (single phase)
32       - Phase change
34 SourceFiles
35     ReactingCloudTemplateI.H
36     ReactingCloudTemplate.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef ReactingCloudTemplate_H
41 #define ReactingCloudTemplate_H
43 #include "ThermoCloudTemplate.H"
44 #include "reactingCloud.H"
45 #include "multiComponentMixture.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
52 // Forward declaration of classes
54 template<class CloudType>
55 class CompositionModel;
57 template<class CloudType>
58 class PhaseChangeModel;
60 /*---------------------------------------------------------------------------*\
61                       Class ReactingCloud Declaration
62 \*---------------------------------------------------------------------------*/
64 template<class ParcelType>
65 class ReactingCloud
67     public ThermoCloud<ParcelType>,
68     public reactingCloud
70 public:
72     //- Type of thermodynamics the cloud was instantiated for
73     typedef typename ParcelType::thermoType thermoType;
76 private:
78     // Private Member Functions
80         //- Disallow default bitwise copy construct
81         ReactingCloud(const ReactingCloud&);
83         //- Disallow default bitwise assignment
84         void operator=(const ReactingCloud&);
87 protected:
89     // Protected data
91         //- Parcel constant properties
92         typename ParcelType::constantProperties constProps_;
94         //- Multi-component carrier phase thermo
95         multiComponentMixture<thermoType>& mcCarrierThermo_;
98         // References to the cloud sub-models
100             //- Reacting composition model
101             autoPtr<CompositionModel<ReactingCloud<ParcelType> > >
102                 compositionModel_;
104             //- Reacting phase change model
105             autoPtr<PhaseChangeModel<ReactingCloud<ParcelType> > >
106                 phaseChangeModel_;
109         // Sources
111             //- Mass transfer fields - one per carrier phase specie
112             PtrList<DimensionedField<scalar, volMesh> > rhoTrans_;
115         // Check
117             //- Total mass transferred to continuous phase via phase change
118             scalar dMassPhaseChange_;
121     // Protected Member Functions
123         // New parcel helper functions
125             //- Check that size of a composition field is valid
126             void checkSuppliedComposition
127             (
128                 const scalarField& YSupplied,
129                 const scalarField& Y,
130                 const word& YName
131             );
134         // Cloud evolution functions
136             //- Pre-evolve
137             void preEvolve();
139             //- Evolve the cloud
140             void evolveCloud();
142             //- Post-evolve
143             void postEvolve();
146 public:
148     // Constructors
150         //- Construct given carrier gas fields
151         ReactingCloud
152         (
153             const word& cloudName,
154             const volScalarField& rho,
155             const volVectorField& U,
156             const dimensionedVector& g,
157             basicThermo& thermo,
158             bool readFields = true
159         );
162     //- Destructor
163     virtual ~ReactingCloud();
166     //- Type of parcel the cloud was instantiated for
167     typedef ParcelType parcelType;
170     // Member Functions
172         // Access
174             //- Return the constant properties
175             inline const typename ParcelType::constantProperties&
176                 constProps() const;
178             //- Return const access to multi-component carrier phase thermo
179             inline const multiComponentMixture<thermoType>&
180                 mcCarrierThermo() const;
182             //- Return access to multi-component carrier phase thermo
183             inline multiComponentMixture<thermoType>& mcCarrierThermo();
186             // Sub-models
188                 //- Return reference to reacting composition model
189                 inline const CompositionModel<ReactingCloud<ParcelType> >&
190                     composition() const;
192                 //- Return reference to reacting phase change model
193                 inline const PhaseChangeModel<ReactingCloud<ParcelType> >&
194                     phaseChange() const;
197             // Sources
199                 //- Mass
201                     //- Return reference to mass source for field i
202                     inline DimensionedField<scalar, volMesh>&
203                         rhoTrans(const label i);
205                     //- Return reference to mass source fields
206                     inline PtrList<DimensionedField<scalar, volMesh> >&
207                         rhoTrans();
209                     //- Return tmp mass source for field i - fully explicit
210                     inline tmp<DimensionedField<scalar, volMesh> >
211                         Srho(const label i) const;
213                     //- Return tmp total mass source for carrier phase
214                     //  - fully explicit
215                     inline tmp<DimensionedField<scalar, volMesh> > Srho() const;
218         // Check
220             //- Print cloud information
221             void info() const;
223             //- Add to cumulative phase change mass transfer
224             void addToMassPhaseChange(const scalar dMass);
227         // Cloud evolution functions
229             //- Check parcel properties
230             void checkParcelProperties
231             (
232                 ParcelType& parcel,
233                 const scalar lagrangianDt,
234                 const bool fullyDescribed
235             );
237             //- Reset the spray source terms
238             void resetSourceTerms();
240             //- Evolve the spray (inject, move)
241             void evolve();
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 } // End namespace Foam
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 #include "ReactingCloudTemplateI.H"
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 #ifdef NoRepository
256 #   include "ReactingCloudTemplate.C"
257 #endif
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 #endif
263 // ************************************************************************* //