1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
26 #include "ReactingMultiphaseCloudTemplate.H"
28 #include "DevolatilisationModel.H"
29 #include "SurfaceReactionModel.H"
31 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
33 template<class ParcelType>
34 void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
36 ReactingCloud<ParcelType>::preEvolve();
40 template<class ParcelType>
41 void Foam::ReactingMultiphaseCloud<ParcelType>::evolveCloud()
43 const volScalarField& T = this->carrierThermo().T();
44 const volScalarField cp = this->carrierThermo().Cp();
45 const volScalarField& p = this->carrierThermo().p();
47 autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
49 this->interpolationSchemes(),
53 autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
55 this->interpolationSchemes(),
59 autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
61 this->interpolationSchemes(),
65 autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
67 this->interpolationSchemes(),
71 autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
73 this->interpolationSchemes(),
77 autoPtr<interpolation<scalar> > pInterp = interpolation<scalar>::New
79 this->interpolationSchemes(),
83 typename ParcelType::trackData td
96 this->injection().inject(td);
103 Cloud<ParcelType>::move(td);
107 template<class ParcelType>
108 void Foam::ReactingMultiphaseCloud<ParcelType>::postEvolve()
110 ReactingCloud<ParcelType>::postEvolve();
114 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
116 template<class ParcelType>
117 Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
119 const word& cloudName,
120 const volScalarField& rho,
121 const volVectorField& U,
122 const dimensionedVector& g,
127 ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo, false),
128 reactingMultiphaseCloud(),
129 constProps_(this->particleProperties()),
130 devolatilisationModel_
132 DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New
134 this->particleProperties(),
138 surfaceReactionModel_
140 SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New
142 this->particleProperties(),
146 dMassDevolatilisation_(0.0)
150 ParcelType::readFields(*this);
155 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
157 template<class ParcelType>
158 Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud()
162 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
164 template<class ParcelType>
165 void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
168 const scalar lagrangianDt,
169 const bool fullyDescribed
172 ReactingCloud<ParcelType>::checkParcelProperties
179 label idGas = this->composition().idGas();
180 label idLiquid = this->composition().idLiquid();
181 label idSolid = this->composition().idSolid();
185 parcel.YGas() = this->composition().Y0(idGas);
186 parcel.YLiquid() = this->composition().Y0(idLiquid);
187 parcel.YSolid() = this->composition().Y0(idSolid);
191 this->checkSuppliedComposition
194 this->composition().Y0(idGas),
197 this->checkSuppliedComposition
200 this->composition().Y0(idLiquid),
203 this->checkSuppliedComposition
206 this->composition().Y0(idSolid),
213 template<class ParcelType>
214 void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms()
216 ReactingCloud<ParcelType>::resetSourceTerms();
220 template<class ParcelType>
221 void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
237 template<class ParcelType>
238 void Foam::ReactingMultiphaseCloud<ParcelType>::info() const
240 ReactingCloud<ParcelType>::info();
241 Info<< " Mass transfer devolatilisation = "
242 << returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl;
243 Info<< " Mass transfer surface reaction = "
244 << returnReduce(dMassSurfaceReaction_, sumOp<scalar>()) << nl;
248 template<class ParcelType>
249 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassDevolatilisation
254 dMassDevolatilisation_ += dMass;
258 template<class ParcelType>
259 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassSurfaceReaction
264 dMassSurfaceReaction_ += dMass;
268 // ************************************************************************* //