1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
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 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
34 template<class ParcelType>
35 Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
37 const word& cloudName,
38 const volScalarField& rho,
39 const volVectorField& U,
40 const dimensionedVector& g,
44 ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo),
45 reactingMultiphaseCloud(),
46 constProps_(this->particleProperties()),
47 devolatilisationModel_
49 DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New
51 this->particleProperties(),
57 SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New
59 this->particleProperties(),
63 dMassDevolatilisation_(0.0)
67 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
69 template<class ParcelType>
70 Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud()
74 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 template<class ParcelType>
77 void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
80 const scalar lagrangianDt,
81 const bool fullyDescribed
84 ReactingCloud<ParcelType>::checkParcelProperties
91 label idGas = this->composition().idGas();
92 label idLiquid = this->composition().idLiquid();
93 label idSolid = this->composition().idSolid();
97 parcel.YGas() = this->composition().Y0(idGas);
98 parcel.YLiquid() = this->composition().Y0(idLiquid);
99 parcel.YSolid() = this->composition().Y0(idSolid);
103 this->checkSuppliedComposition
106 this->composition().Y0(idGas),
109 this->checkSuppliedComposition
112 this->composition().Y0(idLiquid),
115 this->checkSuppliedComposition
118 this->composition().Y0(idSolid),
125 template<class ParcelType>
126 void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms()
128 ReactingCloud<ParcelType>::resetSourceTerms();
132 template<class ParcelType>
133 void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
135 ReactingCloud<ParcelType>::preEvolve();
139 template<class ParcelType>
140 void Foam::ReactingMultiphaseCloud<ParcelType>::postEvolve()
142 ReactingCloud<ParcelType>::postEvolve();
146 template<class ParcelType>
147 void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
151 const volScalarField& T = this->carrierThermo().T();
152 const volScalarField cp = this->carrierThermo().Cp();
153 const volScalarField& p = this->carrierThermo().p();
155 autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
157 this->interpolationSchemes(),
161 autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
163 this->interpolationSchemes(),
167 autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
169 this->interpolationSchemes(),
173 autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
175 this->interpolationSchemes(),
179 autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
181 this->interpolationSchemes(),
185 autoPtr<interpolation<scalar> > pInterp = interpolation<scalar>::New
187 this->interpolationSchemes(),
191 typename ParcelType::trackData td
204 this->injection().inject(td);
211 Cloud<ParcelType>::move(td);
217 template<class ParcelType>
218 void Foam::ReactingMultiphaseCloud<ParcelType>::info() const
220 ReactingCloud<ParcelType>::info();
221 Info<< " Mass transfer devolatilisation = "
222 << returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl;
223 Info<< " Mass transfer surface reaction = "
224 << returnReduce(dMassSurfaceReaction_, sumOp<scalar>()) << nl;
228 template<class ParcelType>
229 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassDevolatilisation
234 dMassDevolatilisation_ += dMass;
238 template<class ParcelType>
239 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassSurfaceReaction
244 dMassSurfaceReaction_ += dMass;
248 // ************************************************************************* //