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
25 \*---------------------------------------------------------------------------*/
27 #include "ReactingMultiphaseCloud.H"
29 #include "DevolatilisationModel.H"
30 #include "SurfaceReactionModel.H"
32 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
34 template<class ParcelType>
35 void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
37 ReactingCloud<ParcelType>::preEvolve();
41 template<class ParcelType>
42 void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
44 const volScalarField& T = this->carrierThermo().T();
45 const volScalarField cp = this->carrierThermo().Cp();
46 const volScalarField& p = this->carrierThermo().p();
48 autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
50 this->interpolationSchemes(),
54 autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
56 this->interpolationSchemes(),
60 autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
62 this->interpolationSchemes(),
66 autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
68 this->interpolationSchemes(),
72 autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
74 this->interpolationSchemes(),
78 autoPtr<interpolation<scalar> > pInterp = interpolation<scalar>::New
80 this->interpolationSchemes(),
84 typename ParcelType::trackData td
97 this->injection().inject(td);
104 Cloud<ParcelType>::move(td);
108 template<class ParcelType>
109 void Foam::ReactingMultiphaseCloud<ParcelType>::postEvolve()
111 ReactingCloud<ParcelType>::postEvolve();
115 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
117 template<class ParcelType>
118 Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
120 const word& cloudName,
121 const volScalarField& rho,
122 const volVectorField& U,
123 const dimensionedVector& g,
128 ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo, false),
129 reactingMultiphaseCloud(),
130 constProps_(this->particleProperties()),
131 devolatilisationModel_
133 DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New
135 this->particleProperties(),
139 surfaceReactionModel_
141 SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New
143 this->particleProperties(),
147 dMassDevolatilisation_(0.0)
151 ParcelType::readFields(*this);
156 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
158 template<class ParcelType>
159 Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud()
163 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
165 template<class ParcelType>
166 void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
169 const scalar lagrangianDt,
170 const bool fullyDescribed
173 ReactingCloud<ParcelType>::checkParcelProperties
180 label idGas = this->composition().idGas();
181 label idLiquid = this->composition().idLiquid();
182 label idSolid = this->composition().idSolid();
186 parcel.YGas() = this->composition().Y0(idGas);
187 parcel.YLiquid() = this->composition().Y0(idLiquid);
188 parcel.YSolid() = this->composition().Y0(idSolid);
192 this->checkSuppliedComposition
195 this->composition().Y0(idGas),
198 this->checkSuppliedComposition
201 this->composition().Y0(idLiquid),
204 this->checkSuppliedComposition
207 this->composition().Y0(idSolid),
214 template<class ParcelType>
215 void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms()
217 ReactingCloud<ParcelType>::resetSourceTerms();
221 template<class ParcelType>
222 void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
238 template<class ParcelType>
239 void Foam::ReactingMultiphaseCloud<ParcelType>::info() const
241 ReactingCloud<ParcelType>::info();
242 Info<< " Mass transfer devolatilisation = "
243 << returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl;
244 Info<< " Mass transfer surface reaction = "
245 << returnReduce(dMassSurfaceReaction_, sumOp<scalar>()) << nl;
249 template<class ParcelType>
250 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassDevolatilisation
255 dMassDevolatilisation_ += dMass;
259 template<class ParcelType>
260 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassSurfaceReaction
265 dMassSurfaceReaction_ += dMass;
269 // ************************************************************************* //