OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

ReactingMultiphaseCloud.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "ReactingMultiphaseCloud.H"
00028 
00029 #include "DevolatilisationModel.H"
00030 #include "SurfaceReactionModel.H"
00031 
00032 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00033 
00034 template<class ParcelType>
00035 Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
00036 (
00037     const word& cloudName,
00038     const volScalarField& rho,
00039     const volVectorField& U,
00040     const dimensionedVector& g,
00041     basicThermo& thermo
00042 )
00043 :
00044     ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo),
00045     reactingMultiphaseCloud(),
00046     constProps_(this->particleProperties()),
00047     devolatilisationModel_
00048     (
00049         DevolatilisationModel<ReactingMultiphaseCloud<ParcelType> >::New
00050         (
00051             this->particleProperties(),
00052             *this
00053         )
00054     ),
00055     surfaceReactionModel_
00056     (
00057         SurfaceReactionModel<ReactingMultiphaseCloud<ParcelType> >::New
00058         (
00059             this->particleProperties(),
00060             *this
00061         )
00062     ),
00063     dMassDevolatilisation_(0.0)
00064 {}
00065 
00066 
00067 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00068 
00069 template<class ParcelType>
00070 Foam::ReactingMultiphaseCloud<ParcelType>::~ReactingMultiphaseCloud()
00071 {}
00072 
00073 
00074 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00075 
00076 template<class ParcelType>
00077 void Foam::ReactingMultiphaseCloud<ParcelType>::checkParcelProperties
00078 (
00079     ParcelType& parcel,
00080     const scalar lagrangianDt,
00081     const bool fullyDescribed
00082 )
00083 {
00084     ReactingCloud<ParcelType>::checkParcelProperties
00085     (
00086         parcel,
00087         lagrangianDt,
00088         fullyDescribed
00089     );
00090 
00091     label idGas = this->composition().idGas();
00092     label idLiquid = this->composition().idLiquid();
00093     label idSolid = this->composition().idSolid();
00094 
00095     if (!fullyDescribed)
00096     {
00097         parcel.YGas() = this->composition().Y0(idGas);
00098         parcel.YLiquid() = this->composition().Y0(idLiquid);
00099         parcel.YSolid() = this->composition().Y0(idSolid);
00100     }
00101     else
00102     {
00103         this->checkSuppliedComposition
00104         (
00105             parcel.YGas(),
00106             this->composition().Y0(idGas),
00107             "YGas"
00108         );
00109         this->checkSuppliedComposition
00110         (
00111             parcel.YLiquid(),
00112             this->composition().Y0(idLiquid),
00113             "YLiquid"
00114         );
00115         this->checkSuppliedComposition
00116         (
00117             parcel.YSolid(),
00118             this->composition().Y0(idSolid),
00119             "YSolid"
00120         );
00121     }
00122 }
00123 
00124 
00125 template<class ParcelType>
00126 void Foam::ReactingMultiphaseCloud<ParcelType>::resetSourceTerms()
00127 {
00128     ReactingCloud<ParcelType>::resetSourceTerms();
00129 }
00130 
00131 
00132 template<class ParcelType>
00133 void Foam::ReactingMultiphaseCloud<ParcelType>::preEvolve()
00134 {
00135     ReactingCloud<ParcelType>::preEvolve();
00136 }
00137 
00138 
00139 template<class ParcelType>
00140 void Foam::ReactingMultiphaseCloud<ParcelType>::postEvolve()
00141 {
00142     ReactingCloud<ParcelType>::postEvolve();
00143 }
00144 
00145 
00146 template<class ParcelType>
00147 void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
00148 {
00149     preEvolve();
00150 
00151     const volScalarField& T = this->carrierThermo().T();
00152     const volScalarField cp = this->carrierThermo().Cp();
00153     const volScalarField& p = this->carrierThermo().p();
00154 
00155     autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
00156     (
00157         this->interpolationSchemes(),
00158         this->rho()
00159     );
00160 
00161     autoPtr<interpolation<vector> > UInterp = interpolation<vector>::New
00162     (
00163         this->interpolationSchemes(),
00164         this->U()
00165     );
00166 
00167     autoPtr<interpolation<scalar> > muInterp = interpolation<scalar>::New
00168     (
00169         this->interpolationSchemes(),
00170         this->mu()
00171     );
00172 
00173     autoPtr<interpolation<scalar> > TInterp = interpolation<scalar>::New
00174     (
00175         this->interpolationSchemes(),
00176         T
00177     );
00178 
00179     autoPtr<interpolation<scalar> > cpInterp = interpolation<scalar>::New
00180     (
00181         this->interpolationSchemes(),
00182         cp
00183     );
00184 
00185     autoPtr<interpolation<scalar> > pInterp = interpolation<scalar>::New
00186     (
00187         this->interpolationSchemes(),
00188         p
00189     );
00190 
00191     typename ParcelType::trackData td
00192     (
00193         *this,
00194         constProps_,
00195         rhoInterp(),
00196         UInterp(),
00197         muInterp(),
00198         TInterp(),
00199         cpInterp(),
00200         pInterp(),
00201         this->g().value()
00202     );
00203 
00204     this->injection().inject(td);
00205 
00206     if (this->coupled())
00207     {
00208         resetSourceTerms();
00209     }
00210 
00211     Cloud<ParcelType>::move(td);
00212 
00213     postEvolve();
00214 }
00215 
00216 
00217 template<class ParcelType>
00218 void Foam::ReactingMultiphaseCloud<ParcelType>::info() const
00219 {
00220     ReactingCloud<ParcelType>::info();
00221     Info<< "    Mass transfer devolatilisation  = "
00222         << returnReduce(dMassDevolatilisation_, sumOp<scalar>()) << nl;
00223     Info<< "    Mass transfer surface reaction  = "
00224         << returnReduce(dMassSurfaceReaction_, sumOp<scalar>()) << nl;
00225 }
00226 
00227 
00228 template<class ParcelType>
00229 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassDevolatilisation
00230 (
00231     const scalar dMass
00232 )
00233 {
00234     dMassDevolatilisation_ += dMass;
00235 }
00236 
00237 
00238 template<class ParcelType>
00239 void Foam::ReactingMultiphaseCloud<ParcelType>::addToMassSurfaceReaction
00240 (
00241     const scalar dMass
00242 )
00243 {
00244     dMassSurfaceReaction_ += dMass;
00245 }
00246 
00247 
00248 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd