diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 129319f042..13cd69a2a3 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -1,7 +1,7 @@ /* Parcels */ parcels/derived/basicKinematicParcel/basicKinematicParcel.C parcels/derived/basicThermoParcel/basicThermoParcel.C -parcels/derived/basicReactingParcel/basicReactingParcel.C +parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C /* Cloud base classes */ clouds/baseClasses/kinematicCloud/kinematicCloud.C @@ -30,15 +30,15 @@ parcels/derived/basicThermoParcel/makeBasicThermoParcelHeatTransferModels.C parcels/derived/basicThermoParcel/makeBasicThermoParcelWallInteractionModels.C /* reacting parcel sub-models */ -parcels/derived/basicReactingParcel/defineBasicReactingParcel.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelCompositionModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelDragModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelDispersionModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelInjectionModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelHeatTransferModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelDevolatilisationModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelSurfaceReactionModels.C -parcels/derived/basicReactingParcel/makeBasicReactingParcelWallInteractionModels.C +parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelCompositionModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDragModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDispersionModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelInjectionModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelHeatTransferModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDevolatilisationModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C +parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelWallInteractionModels.C /* bolt-on models */ submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C new file mode 100644 index 0000000000..a532276dee --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.C @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseCloud.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(basicReactingMultiphaseCloud, 0); +}; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::basicReactingMultiphaseCloud::basicReactingMultiphaseCloud +( + const word& cloudType, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + hCombustionThermo& thermo, + PtrList& gases +) +: + ReactingCloud + ( + cloudType, + rho, + U, + g, + thermo, + gases + ) +{ + basicReactingMultiphaseParcel::readFields(*this); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::basicReactingMultiphaseCloud::~basicReactingMultiphaseCloud() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::basicReactingMultiphaseCloud::writeFields() const +{ + basicReactingMultiphaseParcel::writeFields(*this); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H new file mode 100644 index 0000000000..244c98d095 --- /dev/null +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::basicReactingMultiphaseCloud + +Description + Reacting cloud templated on the reacting multiphase parcel + +SourceFiles + basicReactingMultiphaseCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicReactingMultiphaseCloud_H +#define basicReactingMultiphaseCloud_H + +#include "ReactingCloud.H" +#include "basicReactingMultiphaseParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicReactingMultiphaseCloud Declaration +\*---------------------------------------------------------------------------*/ + +class basicReactingMultiphaseCloud +: + public ReactingCloud +{ + + // Private Member Functions + + //- Disallow default bitwise copy construct + basicReactingMultiphaseCloud(const basicReactingMultiphaseCloud&); + + //- Disallow default bitwise assignment + void operator=(const basicReactingMultiphaseCloud&); + + +public: + + //- Runtime type information + TypeName("basicReactingMultiphaseCloud"); + + + // Constructors + + //- Construct given carrier gas fields + basicReactingMultiphaseCloud + ( + const word& cloudType, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + hCombustionThermo& thermo, + PtrList& gases + ); + + + //- Destructor + ~basicReactingMultiphaseCloud(); + + + // Member Functions + + //- Write fields + void writeFields() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C new file mode 100644 index 0000000000..328367601f --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -0,0 +1,433 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "ReactingMultiphaseParcel.H" + +// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // + +template +template +void Foam::ReactingMultiphaseParcel::updateCellQuantities +( + TrackData& td, + const scalar dt, + const label celli +) +{ + ReactingParcel::updateCellQuantities(td, dt, celli); +} + + +template +template +void Foam::ReactingMultiphaseParcel::calcCoupled +( + TrackData& td, + const scalar dt, + const label celli +) +{ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Define local properties at beginning of timestep + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + const vector U0 = this->U_; + const scalar mass0 = this->mass(); + const scalar cp0 = this->cp_; + const scalar np0 = this->nParticle_; + const scalar T0 = this->T_; + scalarList& YMix = this->YMixture_; + + // ~~~~~~~~~~~~~~~~~~~~~~~~~ + // Initialise transfer terms + // ~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Momentum transfer from the particle to the carrier phase + vector dUTrans = vector::zero; + + // Enthalpy transfer from the particle to the carrier phase + scalar dhTrans = 0.0; + + // Mass transfer from particle to carrier phase + // - components exist in particle already + scalarList dMassMT(td.cloud().gases().size(), 0.0); + + // Mass transfer due to surface reactions from particle to carrier phase + // - components do not necessarily exist in particle already + scalarList dMassSR(td.cloud().gases().size(), 0.0); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate velocity - update U + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + scalar Cud = 0.0; + const vector U1 = calcVelocity(td, dt, Cud, dUTrans); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate heat transfer - update T + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + scalar htc = 0.0; + scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate Devolatilisation + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ + calcDevolatilisation(td, dt, T0, T1, dMassMT); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate surface reactions + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Initialise enthalpy retention to zero + scalar dhRet = 0.0; + + calcSurfaceReactions(td, dt, celli, T0, T1, dMassMT, dMassSR, dhRet); + + // New total mass + const scalar mass1 = mass0 - sum(dMassMT) - sum(dMassSR); + + // Correct particle temperature to account for latent heat of + // devolatilisation + T1 -= + td.constProps().Ldevol() + *sum(dMassMT) + /(0.5*(mass0 + mass1)*cp0); + + // Add retained enthalpy from surface reaction to particle and remove + // from gas + T1 += dhRet/(0.5*(mass0 + mass1)*cp0); + dhTrans -= dhRet; + + // Correct dhTrans to account for enthalpy of evolved volatiles + dhTrans += + sum(dMassMT) + *td.cloud().composition().HGas(YGas_, 0.5*(T0 + T1)); + + // Correct dhTrans to account for enthalpy of consumed solids + dhTrans += + sum(dMassSR) + *td.cloud().composition().HSolid(YSolid_, 0.5*(T0 + T1)); + + + // ~~~~~~~~~~~~~~~~~~~~~~~ + // Accumulate source terms + // ~~~~~~~~~~~~~~~~~~~~~~~ + + // Transfer mass lost from particle to carrier mass source + forAll(dMassMT, i) + { + td.cloud().rhoTrans(i)[celli] += np0*(dMassMT[i] + dMassSR[i]); + } + + // Update momentum transfer + td.cloud().UTrans()[celli] += np0*dUTrans; + + // Accumulate coefficient to be applied in carrier phase momentum coupling + td.cloud().UCoeff()[celli] += np0*mass0*Cud; + + // Update enthalpy transfer + // - enthalpy of lost solids already accounted for + td.cloud().hTrans()[celli] += np0*dhTrans; + + // Accumulate coefficient to be applied in carrier phase enthalpy coupling + td.cloud().hCoeff()[celli] += np0*htc*this->areaS(); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Remove the particle when mass falls below minimum threshold + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (mass1 < td.constProps().minParticleMass()) + { + td.keepParticle = false; + + // Absorb particle(s) into carrier phase + forAll(dMassMT, i) + { + td.cloud().rhoTrans(i)[celli] += np0*dMassMT[i]; + } + td.cloud().hTrans()[celli] += + np0*mass1 + *( + YMix[0]*td.cloud().composition().HGas(YGas_, T1) + + YMix[2]*td.cloud().composition().HSolid(YSolid_, T1) + ); + td.cloud().UTrans()[celli] += np0*mass1*U1; + } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Set new particle properties + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + else + { + this->U_ = U1; + this->T_ = T1; + this->cp_ = + YMix[0]*td.cloud().composition().cpGas(YGas_, T1) + + YMix[1]*td.cloud().composition().cpLiquid(YLiquid_, this->pc_, T1) + + YMix[2]*td.cloud().composition().cpSolid(YSolid_); + + // Update particle density or diameter + if (td.constProps().constantVolume()) + { + this->rho_ = mass1/this->volume(); + } + else + { + this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi); + } + } +} + + +template +template +void Foam::ReactingMultiphaseParcel::calcUncoupled +( + TrackData& td, + const scalar dt, + const label celli +) +{ + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Define local properties at beginning of timestep + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + const scalar T0 = this->T_; + const scalar mass0 = this->mass(); + const scalar cp0 = this->cp_; + scalarList& YMix = this->YMixture_; + + // ~~~~~~~~~~~~~~~~~~~~~~~~~ + // Initialise transfer terms + // ~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Momentum transfer from the particle to the carrier phase + vector dUTrans = vector::zero; + + // Enthalpy transfer from the particle to the carrier phase + scalar dhTrans = 0.0; + + // Mass transfer from particle to carrier phase + // - components exist in particle already + scalarList dMassMT(td.cloud().gases().size(), 0.0); + + // Mass transfer due to surface reactions from particle to carrier phase + // - components do not necessarily exist in particle already + scalarList dMassSR(td.cloud().gases().size(), 0.0); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate velocity - update U + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + scalar Cud = 0.0; + const vector U1 = calcVelocity(td, dt, Cud, dUTrans); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate heat transfer - update T + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + scalar htc = 0.0; + scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate Devolatilisation + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ + calcDevolatilisation(td, dt, T0, T1, dMassMT); + + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Calculate surface reactions + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Initialise enthalpy retention to zero + scalar dhRet = 0.0; + + calcSurfaceReactions(td, dt, celli, T0, T1, dMassMT, dMassSR, dhRet); + + // New total mass + const scalar mass1 = mass0 - sum(dMassMT) - sum(dMassSR); + + // New specific heat capacity + const scalar cp1 = + YMix[0]*td.cloud().composition().cpGas(YGas_, T1) + + YMix[1]*td.cloud().composition().cpLiquid(YLiquid_, this->pc_, T1) + + YMix[2]*td.cloud().composition().cpSolid(YSolid_); + + // Add retained enthalpy to particle + T1 += dhRet/(mass0*0.5*(cp0 + cp1)); + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Remove the particle when mass falls below minimum threshold + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if (mass1 < td.constProps().minParticleMass()) + { + td.keepParticle = false; + } + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Set new particle properties + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + else + { + this->U_ = U1; + this->T_ = T1; + this->cp_ = cp1; + + // Update particle density or diameter + if (td.constProps().constantVolume()) + { + this->rho_ = mass1/this->volume(); + } + else + { + this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi); + } + } +} + + +template +template +void Foam::ReactingMultiphaseParcel::calcDevolatilisation +( + TrackData& td, + const scalar dt, + const scalar T0, + const scalar T1, + scalarList& dMassMT +) +{ + if (td.cloud().composition().YMixture0()[1]>SMALL) + { + notImplemented + ( + "void Foam::ReactingMultiphaseParcel::" + "calcDevolatilisation \n" + "(" + " TrackData&,\n" + " const scalar,\n" + " const scalar,\n" + " const scalar,\n" + " scalarList&\n" + ")\n" + "no treatment currently available for particles containing " + "liquid species" + ) + } + + // Check that model is active, and that the parcel temperature is + // within necessary limits for devolatilisation to occur + if + ( + !td.cloud().devolatilisation().active() + || this->T_T_mass(); + scalarList& YMix = this->YMixture_; + const scalar dMassTot = td.cloud().devolatilisation().calculate + ( + dt, + this->mass0_, + mass, + td.cloud().composition().YMixture0(), + YMix, + T0, + canCombust_ + ); + + // Update (total) mass fractions + YMix[0] = (YMix[0]*mass - dMassTot)/(mass - dMassTot); + YMix[1] = YMix[1]*mass/(mass - dMassTot); + YMix[2] = 1.0 - YMix[0] - YMix[1]; + + // Add to cummulative mass transfer + forAll (YGas_, i) + { + label id = td.cloud().composition().gasGlobalIds()[i]; + + // Volatiles mass transfer + scalar volatileMass = YGas_[i]*dMassTot; + dMassMT[id] += volatileMass; + } +} + + +template +template +void Foam::ReactingMultiphaseParcel::calcSurfaceReactions +( + TrackData& td, + const scalar dt, + const label celli, + const scalar T0, + const scalar T1, + const scalarList& dMassMT, + scalarList& dMassSR, + scalar& dhRet +) +{ + // Check that model is active + if (!td.cloud().surfaceReaction().active() || !canCombust_) + { + return; + } + + // Update mass transfer(s) + // - Also updates Y()'s + td.cloud().surfaceReaction().calculate + ( + dt, + celli, + this->d_, + T0, + T1, + this->Tc_, + this->pc_, + this->rhoc_, + this->mass(), + dMassMT, + YGas_, + YLiquid_, + YSolid_, + this->YMixture_, + dMassSR, + dhRet + ); +} + + +// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * // + +#include "ReactingMultiphaseParcelIO.C" + +// ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H new file mode 100644 index 0000000000..634175290a --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -0,0 +1,330 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::ReactingMultiphaseParcel + +Description + Multiphase variant of the reacting parcel class with one/two-way coupling + with the continuous phase. + +SourceFiles + ReactingMultiphaseParcelI.H + ReactingMultiphaseParcel.C + ReactingMultiphaseParcelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ReactingMultiphaseParcel_H +#define ReactingMultiphaseParcel_H + +#include "ReactingParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template +class ReactingMultiphaseParcel; + +template +Ostream& operator<< +( + Ostream&, + const ReactingMultiphaseParcel& +); + +/*---------------------------------------------------------------------------*\ + Class ReactingMultiphaseParcel Declaration +\*---------------------------------------------------------------------------*/ + +template +class ReactingMultiphaseParcel +: + public ReactingParcel +{ + +public: + + //- Class to hold reacting particle constant properties + class constantProperties + : + public ReactingParcel::constantProperties + { + // Private data + + //- Vapourisation temperature [K] + const scalar Tvap_; + + //- Boiling point [K] + const scalar Tbp_; + + //- Latent heat of devolatilisation [J/kg] + const scalar Ldevol_; + + + public: + + //- Constructor + constantProperties(const dictionary& dict); + + // Access + + //- Return const access to the vapourisation temperature + inline scalar Tvap() const; + + //- Return const access to the boiling point + inline scalar Tbp() const; + + //- Return const access to the latent heat of devolatilisation + inline scalar Ldevol() const; + }; + + + //- Class used to pass reacting tracking data to the trackToFace function + class trackData + : + public ReactingParcel::trackData + { + // Private data + + //- Particle constant properties + const constantProperties& constProps_; + + + public: + + // Constructors + + //- Construct from components + inline trackData + ( + ReactingCloud& cloud, + const constantProperties& constProps, + const interpolation& rhoInterp, + const interpolation& UInterp, + const interpolation& muInterp, + const interpolation& TInterp, + const interpolation& CpInterp, + const interpolation& pInterp, + const vector& g + ); + + + // Member functions + + //- Return const access to the constant properties + inline const constantProperties& constProps() const; + }; + + +protected: + + // Protected data + + // Parcel properties + + //- Mass fractions of gases [] + scalarField YGas_; + + //- Mass fractions of liquids [] + scalarField YLiquid_; + + //- Mass fractions of solids [] + scalarField YSolid_; + + //- Flag to say that the particle is allowed to combust + // Only true after volatile content falls below threshold value + bool canCombust_; + + + // Protected member functions + + //- Calculate Devolatilisation + template + void calcDevolatilisation + ( + TrackData& td, + const scalar dt, + const scalar T0, + const scalar T1, + scalarList& dMassMT + ); + + //- Calculate surface reactions + template + void calcSurfaceReactions + ( + TrackData& td, + const scalar dt, + const label celli, + const scalar T0, + const scalar T1, + const scalarList& dMassMT, + scalarList& dMassSR, + scalar& dhRet + ); + + +public: + + //- Runtime type information + TypeName("ReactingMultiphaseParcel"); + + friend class Cloud; + + + // Constructors + + //- Construct from components + inline ReactingMultiphaseParcel + ( + ReactingCloud& owner, + const label typeId, + const vector& position, + const label celli, + const scalar d0, + const vector& U0, + const scalar nParticle0, + const scalarField& YGas0, + const scalarField& YLiquid0, + const scalarField& YSolid0, + const scalarField& YMixture0, + const constantProperties& constProps + ); + + //- Construct from Istream + ReactingMultiphaseParcel + ( + const Cloud& c, + Istream& is, + bool readFields = true + ); + + //- Construct and return a clone + autoPtr clone() const + { + return autoPtr + ( + new ReactingMultiphaseParcel(*this) + ); + } + + + // Member Functions + + // Access + + //- Return const access to mass fractions of gases + inline const scalarField& YGas() const; + + //- Return const access to mass fractions of liquids + inline const scalarField& YLiquid() const; + + //- Return const access to mass fractions of solids + inline const scalarField& YSolid() const; + + + // Edit + + //- Return access to mass fractions of gases + inline scalarField& YGas(); + + //- Return access to mass fractions of liquids + inline scalarField& YLiquid(); + + //- Return access to mass fractions of solids + inline scalarField& YSolid(); + + + // Main calculation loop + + //- Update cell based quantities + template + void updateCellQuantities + ( + TrackData& td, + const scalar dt, + const label celli + ); + + //- Coupled calculation with the continuous phase + template + void calcCoupled + ( + TrackData& td, + const scalar dt, + const label celli + ); + + //- Uncoupled calculation with the continuous phase + template + void calcUncoupled + ( + TrackData& td, + const scalar dt, + const label + ); + + + // I-O + + //- Read + static void readFields(ReactingCloud& c); + + //- Write + static void writeFields(const ReactingCloud& c); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const ReactingMultiphaseParcel& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "ReactingMultiphaseParcelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "ReactingMultiphaseParcel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H new file mode 100644 index 0000000000..87a7cb2d8c --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelI.H @@ -0,0 +1,191 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::ReactingMultiphaseParcel::constantProperties:: +constantProperties +( + const dictionary& dict +) +: + ReactingParcel::constantProperties(dict), + Tvap_(dimensionedScalar(dict.lookup("Tvap")).value()), + Tbp_(dimensionedScalar(dict.lookup("Tbp")).value()), + Ldevol_(dimensionedScalar(dict.lookup("Ldevol")).value()) +{} + + +template +inline Foam::ReactingMultiphaseParcel::trackData::trackData +( + ReactingCloud& cloud, + const constantProperties& constProps, + const interpolation& rhoInterp, + const interpolation& UInterp, + const interpolation& muInterp, + const interpolation& TInterp, + const interpolation& CpInterp, + const interpolation& pInterp, + const vector& g +) +: + ReactingParcel::trackData + ( + cloud, + constProps, + rhoInterp, + UInterp, + muInterp, + TInterp, + CpInterp, + pInterp, + g + ) +{} + + +template +inline Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel +( + ReactingCloud& owner, + const label typeId, + const vector& position, + const label celli, + const scalar d0, + const vector& U0, + const scalar nParticle0, + const scalarField& YGas0, + const scalarField& YLiquid0, + const scalarField& YSolid0, + const scalarField& YMixture0, + const constantProperties& constProps +) +: + ReactingParcel + ( + owner, + typeId, + position, + celli, + d0, + U0, + nParticle0, + YMixture0, + constProps + ), + YGas_(YGas0), + YLiquid_(YLiquid0), + YSolid_(YSolid0) +{} + + +// * * * * * * * * * constantProperties Member Functions * * * * * * * * * * // + +template +inline Foam::scalar +Foam::ReactingMultiphaseParcel::constantProperties::Tvap() const +{ + return Tvap_; +} + + +template +inline Foam::scalar +Foam::ReactingMultiphaseParcel::constantProperties::Tbp() const +{ + return Tbp_; +} + + +template +inline Foam::scalar +Foam::ReactingMultiphaseParcel::constantProperties::Ldevol() const +{ + return Ldevol_; +} + + +// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // + +template +inline const typename Foam::ReactingMultiphaseParcel:: +constantProperties& +Foam::ReactingMultiphaseParcel::trackData::constProps() const +{ + return constProps_; +} + + +// * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * // + +template +inline const Foam::scalarField& Foam::ReactingMultiphaseParcel:: +YGas() const +{ + return YGas_; +} + + +template +inline Foam::scalarField& Foam::ReactingMultiphaseParcel::YGas() +{ + return YGas_; +} + + +template +inline const Foam::scalarField& Foam::ReactingMultiphaseParcel:: +YLiquid() const +{ + return YLiquid_; +} + + +template +inline Foam::scalarField& Foam::ReactingMultiphaseParcel::YLiquid() +{ + return YLiquid_; +} + + +template +inline const Foam::scalarField& Foam::ReactingMultiphaseParcel:: +YSolid() const +{ + return YSolid_; +} + + +template +inline Foam::scalarField& Foam::ReactingMultiphaseParcel::YSolid() +{ + return YSolid_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C new file mode 100644 index 0000000000..bc1e46336e --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcelIO.C @@ -0,0 +1,276 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "ReactingMultiphaseParcel.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ReactingMultiphaseParcel::ReactingMultiphaseParcel +( + const Cloud& cloud, + Istream& is, + bool readFields +) +: + ReactingParcel(cloud, is, readFields), + YGas_(0), + YLiquid_(0), + YSolid_(0) +{ + if (readFields) + { + const ReactingCloud& cR = + dynamic_cast& >(cloud); + + const label nGas = cR.composition().gasNames().size(); + const label nLiquid = cR.composition().liquidNames().size(); + const label nSolid = cR.composition().solidNames().size(); + + YGas_.setSize(nGas); + YLiquid_.setSize(nLiquid); + YSolid_.setSize(nSolid); + + const scalarField& YMix = this->YMixture_; + if (is.format() == IOstream::ASCII) + { + is >> YGas_ >> YLiquid_ >> YSolid_; + YGas_ /= YMix[0] + VSMALL; + YLiquid_ /= YMix[1] + VSMALL; + YSolid_ /= YMix[2] + VSMALL; + } + else + { + is >> YGas_ >> YLiquid_ >> YSolid_; + YGas_ /= YMix[0] + VSMALL; + YLiquid_ /= YMix[1] + VSMALL; + YSolid_ /= YMix[2] + VSMALL; + } + } + + // Check state of Istream + is.check + ( + "ReactingMultiphaseParcel::ReactingMultiphaseParcel\n" + "(\n" + " const Cloud&,\n" + " Istream&,\n" + " bool\n" + ")" + ); +} + + +template +void Foam::ReactingMultiphaseParcel::readFields +( + ReactingCloud& c +) +{ + if (!c.size()) + { + return; + } + + ReactingParcel::readFields(c); + + // Get names and sizes for each Y... + const wordList gasNames = c.composition().gasNames(); + const wordList liquidNames = c.composition().liquidNames(); + const wordList solidNames = c.composition().solidNames(); + const label nGas = gasNames.size(); + const label nLiquid = liquidNames.size(); + const label nSolid = solidNames.size(); + + // Set storage for each Y... for each parcel + forAllIter(typename Cloud, c, iter) + { + ReactingMultiphaseParcel& p = iter(); + p.YGas_.setSize(nGas, 0.0); + p.YLiquid_.setSize(nLiquid, 0.0); + p.YSolid_.setSize(nSolid, 0.0); + } + + // Populate YGas for each parcel + forAll(gasNames, j) + { + IOField YGas + ( + c.fieldIOobject("Y" + gasNames[j], IOobject::MUST_READ) + ); + + label i = 0; + forAllIter(typename Cloud, c, iter) + { + ReactingMultiphaseParcel& p = iter(); + p.YGas_[j] = YGas[i++]/p.YMixture()[0]; + } + } + // Populate YLiquid for each parcel + forAll(liquidNames, j) + { + IOField YLiquid + ( + c.fieldIOobject("Y" + liquidNames[j], IOobject::MUST_READ) + ); + + label i = 0; + forAllIter(typename Cloud, c, iter) + { + ReactingMultiphaseParcel& p = iter(); + p.YLiquid_[j] = YLiquid[i++]/p.YMixture()[1]; + } + } + // Populate YSolid for each parcel + forAll(solidNames, j) + { + IOField YSolid + ( + c.fieldIOobject("Y" + solidNames[j], IOobject::MUST_READ) + ); + + label i = 0; + forAllIter(typename Cloud, c, iter) + { + ReactingMultiphaseParcel& p = iter(); + p.YSolid_[j] = YSolid[i++]/p.YMixture()[2]; + } + } +} + + +template +void Foam::ReactingMultiphaseParcel::writeFields +( + const ReactingCloud& c +) +{ + ReactingParcel::writeFields(c); + + label np = c.size(); + + // Write the composition fractions + if (np > 0) + { + const wordList& gasNames = c.composition().gasNames(); + forAll(gasNames, j) + { + IOField YGas + ( + c.fieldIOobject("Y" + gasNames[j], IOobject::NO_READ), + np + ); + + label i = 0; + forAllConstIter(typename Cloud, c, iter) + { + const ReactingMultiphaseParcel& p0 = iter(); + YGas[i++] = p0.YGas()[j]*p0.YMixture()[0]; + } + + YGas.write(); + } + const wordList& liquidNames = c.composition().liquidNames(); + forAll(liquidNames, j) + { + IOField YLiquid + ( + c.fieldIOobject("Y" + liquidNames[j], IOobject::NO_READ), + np + ); + + label i = 0; + forAllConstIter(typename Cloud, c, iter) + { + const ReactingMultiphaseParcel& p0 = iter(); + YLiquid[i++] = p0.YLiquid()[j]*p0.YMixture()[1]; + } + + YLiquid.write(); + } + const wordList& solidNames = c.composition().solidNames(); + forAll(solidNames, j) + { + IOField YSolid + ( + c.fieldIOobject("Y" + solidNames[j], IOobject::NO_READ), + np + ); + + label i = 0; + forAllConstIter(typename Cloud, c, iter) + { + const ReactingMultiphaseParcel& p0 = iter(); + YSolid[i++] = p0.YSolid()[j]*p0.YMixture()[2]; + } + + YSolid.write(); + } + } +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const ReactingMultiphaseParcel& p +) +{ + scalarField YGasLoc = p.YGas()*p.YMixture()[0]; + scalarField YLiquidLoc = p.YLiquid()*p.YMixture()[1]; + scalarField YSolidLoc = p.YSolid()*p.YMixture()[2]; + if (os.format() == IOstream::ASCII) + { + os << static_cast& >(p) + << token::SPACE << YGasLoc + << token::SPACE << YLiquidLoc + << token::SPACE << YSolidLoc; + } + else + { + os << static_cast& >(p); + os << YGasLoc << YLiquidLoc << YSolidLoc; + } + + // Check state of Ostream + os.check + ( + "Ostream& operator<<\n" + "(\n" + " Ostream&,\n" + " const ReactingMultiphaseParcel&\n" + ")" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 4aec91355a..ee91bda829 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -94,8 +94,14 @@ void Foam::ReactingParcel::calcCoupled scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans); + // ~~~~~~~~~~~~~~~~~~~~~~ + // Calculate phase change + // ~~~~~~~~~~~~~~~~~~~~~~ + calcPhaseChange(td, dt, T0, T1, dMassMT); + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ - // Calculate Devolatilisation + // Calculate devolatilisation // ~~~~~~~~~~~~~~~~~~~~~~~~~~ calcDevolatilisation(td, dt, T0, T1, dMassMT); @@ -112,29 +118,11 @@ void Foam::ReactingParcel::calcCoupled // New total mass const scalar mass1 = mass0 - sum(dMassMT) - sum(dMassSR); - // Correct particle temperature to account for latent heat of - // devolatilisation - T1 -= - td.constProps().Ldevol() - *sum(dMassMT) - /(0.5*(mass0 + mass1)*cp0); - // Add retained enthalpy from surface reaction to particle and remove // from gas T1 += dhRet/(0.5*(mass0 + mass1)*cp0); dhTrans -= dhRet; - // Correct dhTrans to account for enthalpy of evolved volatiles - dhTrans += - sum(dMassMT) - *td.cloud().composition().HGas(YGas_, 0.5*(T0 + T1)); - - // Correct dhTrans to account for enthalpy of consumed solids - dhTrans += - sum(dMassSR) - *td.cloud().composition().HSolid(YSolid_, 0.5*(T0 + T1)); - - // ~~~~~~~~~~~~~~~~~~~~~~~ // Accumulate source terms // ~~~~~~~~~~~~~~~~~~~~~~~ @@ -171,12 +159,6 @@ void Foam::ReactingParcel::calcCoupled { td.cloud().rhoTrans(i)[celli] += np0*dMassMT[i]; } - td.cloud().hTrans()[celli] += - np0*mass1 - *( - YMixture_[0]*td.cloud().composition().HGas(YGas_, T1) - + YMixture_[2]*td.cloud().composition().HSolid(YSolid_, T1) - ); td.cloud().UTrans()[celli] += np0*mass1*U1; } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -186,10 +168,7 @@ void Foam::ReactingParcel::calcCoupled { this->U_ = U1; this->T_ = T1; - this->cp_ = - YMixture_[0]*td.cloud().composition().cpGas(YGas_, T1) - + YMixture_[1]*td.cloud().composition().cpLiquid(YLiquid_, pc_, T1) - + YMixture_[2]*td.cloud().composition().cpSolid(YSolid_); + // this->cp_ = ??? // TODO: // Update particle density or diameter if (td.constProps().constantVolume()) @@ -253,8 +232,14 @@ void Foam::ReactingParcel::calcUncoupled scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans); + // ~~~~~~~~~~~~~~~~~~~~~~ + // Calculate phase change + // ~~~~~~~~~~~~~~~~~~~~~~ + calcPhaseChange(td, dt, T0, T1, dMassMT); + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~ - // Calculate Devolatilisation + // Calculate devolatilisation // ~~~~~~~~~~~~~~~~~~~~~~~~~~ calcDevolatilisation(td, dt, T0, T1, dMassMT); @@ -272,10 +257,7 @@ void Foam::ReactingParcel::calcUncoupled const scalar mass1 = mass0 - sum(dMassMT) - sum(dMassSR); // New specific heat capacity - const scalar cp1 = - YMixture_[0]*td.cloud().composition().cpGas(YGas_, T1) - + YMixture_[1]*td.cloud().composition().cpLiquid(YLiquid_, pc_, T1) - + YMixture_[2]*td.cloud().composition().cpSolid(YSolid_); + const scalar cp1 = cp0; // TODO: new cp1 // Add retained enthalpy to particle T1 += dhRet/(mass0*0.5*(cp0 + cp1)); @@ -311,7 +293,7 @@ void Foam::ReactingParcel::calcUncoupled template template -void Foam::ReactingParcel::calcDevolatilisation +void Foam::ReactingParcel::calcPhaseChange ( TrackData& td, const scalar dt, @@ -320,28 +302,12 @@ void Foam::ReactingParcel::calcDevolatilisation scalarList& dMassMT ) { - if (td.cloud().composition().YMixture0()[1]>SMALL) - { - notImplemented - ( - "void Foam::ReactingParcel::" - "calcDevolatilisation(...): no treatment currently " - "available for particles containing liquid species" - ) - } - - // Check that model is active, and that the parcel temperature is - // within necessary limits for devolatilisation to occur - if - ( - !td.cloud().devolatilisation().active() - || this->T_T_mass(); const scalar dMassTot = td.cloud().devolatilisation().calculate @@ -369,50 +335,7 @@ void Foam::ReactingParcel::calcDevolatilisation scalar volatileMass = YGas_[i]*dMassTot; dMassMT[id] += volatileMass; } -} - - -template -template -void Foam::ReactingParcel::calcSurfaceReactions -( - TrackData& td, - const scalar dt, - const label celli, - const scalar T0, - const scalar T1, - const scalarList& dMassMT, - scalarList& dMassSR, - scalar& dhRet -) -{ - // Check that model is active - if (!td.cloud().surfaceReaction().active() || !canCombust_) - { - return; - } - - // Update mass transfer(s) - // - Also updates Y()'s - td.cloud().surfaceReaction().calculate - ( - dt, - celli, - this->d_, - T0, - T1, - this->Tc_, - pc_, - this->rhoc_, - this->mass(), - dMassMT, - YGas_, - YLiquid_, - YSolid_, - YMixture_, - dMassSR, - dhRet - ); + */ } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index 666e1cf1ff..9f0cd7b6c1 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -26,9 +26,8 @@ Class Foam::ReactingParcel Description - Reactinf parcel class with one/two-way coupling with the continuous - phase. Includes thermo parcel sub-models, plus: - - combustion + Reacting parcel class with one/two-way coupling with the continuous + phase. SourceFiles ReactingParcelI.H @@ -80,18 +79,8 @@ public: : public ThermoParcel::constantProperties { - // Private data - //- Vapourisation temperature [K] - const scalar Tvap_; - - //- Boiling point [K] - const scalar Tbp_; - - //- Latent heat of devolatilisation [J/kg] - const scalar Ldevol_; - //- Constant volume flag - e.g. during mass transfer Switch constantVolume_; @@ -103,15 +92,6 @@ public: // Access - //- Return const access to the vapourisation temperature - inline scalar Tvap() const; - - //- Return const access to the boiling point - inline scalar Tbp() const; - - //- Return const access to the latent heat of devolatilisation - inline scalar Ldevol() const; - //- Return const access to the constant volume flag inline Switch constantVolume() const; }; @@ -180,19 +160,6 @@ protected: //- Mass fractions of mixture [] scalarField YMixture_; - //- Mass fractions of gases [] - scalarField YGas_; - - //- Mass fractions of liquids [] - scalarField YLiquid_; - - //- Mass fractions of solids [] - scalarField YSolid_; - - //- Flag to say that the particle is allowed to combust - // Only true after volatile content falls below threshold value - bool canCombust_; - // Cell-based quantities @@ -202,9 +169,9 @@ protected: // Protected member functions - //- Calculate Devolatilisation + //- Calculate Phase change template - void calcDevolatilisation + void calcPhaseChange ( TrackData& td, const scalar dt, @@ -213,20 +180,6 @@ protected: scalarList& dMassMT ); - //- Calculate surface reactions - template - void calcSurfaceReactions - ( - TrackData& td, - const scalar dt, - const label celli, - const scalar T0, - const scalar T1, - const scalarList& dMassMT, - scalarList& dMassSR, - scalar& dhRet - ); - public: @@ -248,9 +201,6 @@ public: const scalar d0, const vector& U0, const scalar nParticle0, - const scalarField& YGas0, - const scalarField& YLiquid0, - const scalarField& YSolid0, const scalarField& YMixture0, const constantProperties& constProps ); @@ -274,39 +224,24 @@ public: // Access - //- Return const access to mass fractions of gases - inline const scalarField& YGas() const; - - //- Return const access to mass fractions of liquids - inline const scalarField& YLiquid() const; - - //- Return const access to mass fractions of solids - inline const scalarField& YSolid() const; + //- Return const access to initial mass + inline scalar mass0() const; //- Return const access to mass fractions of mixture inline const scalarField& YMixture() const; - //- Return const access to initial mass - inline scalar mass0() const; + //- Return the owner cell pressure + inline scalar pc() const; // Edit - //- Return access to mass fractions of gases - inline scalarField& YGas(); - - //- Return access to mass fractions of liquids - inline scalarField& YLiquid(); - - //- Return access to mass fractions of solids - inline scalarField& YSolid(); + //- Return access to initial mass + inline scalar& mass0(); //- Return access to mass fractions of mixture inline scalarField& YMixture(); - //- Return access to initial mass - inline scalar& mass0(); - // Main calculation loop @@ -340,8 +275,10 @@ public: // I-O + //- Read static void readFields(ReactingCloud& c); + //- Write static void writeFields(const ReactingCloud& c); diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H index d4db4722d6..1a5950b332 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelI.H @@ -33,9 +33,6 @@ inline Foam::ReactingParcel::constantProperties::constantProperties ) : ThermoParcel::constantProperties(dict), - Tvap_(dimensionedScalar(dict.lookup("Tvap")).value()), - Tbp_(dimensionedScalar(dict.lookup("Tbp")).value()), - Ldevol_(dimensionedScalar(dict.lookup("Ldevol")).value()), constantVolume_(dict.lookup("constantVolume")) {} @@ -81,9 +78,6 @@ inline Foam::ReactingParcel::ReactingParcel const scalar d0, const vector& U0, const scalar nParticle0, - const scalarField& YGas0, - const scalarField& YLiquid0, - const scalarField& YSolid0, const scalarField& YMixture0, const constantProperties& constProps ) @@ -101,9 +95,6 @@ inline Foam::ReactingParcel::ReactingParcel ), mass0_(0.0), YMixture_(YMixture0), - YGas_(YGas0), - YLiquid_(YLiquid0), - YSolid_(YSolid0), pc_(0.0) { // Set initial parcel mass @@ -113,30 +104,6 @@ inline Foam::ReactingParcel::ReactingParcel // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * // -template -inline Foam::scalar -Foam::ReactingParcel::constantProperties::Tvap() const -{ - return Tvap_; -} - - -template -inline Foam::scalar -Foam::ReactingParcel::constantProperties::Tbp() const -{ - return Tbp_; -} - - -template -inline Foam::scalar -Foam::ReactingParcel::constantProperties::Ldevol() const -{ - return Ldevol_; -} - - template inline Foam::Switch Foam::ReactingParcel::constantProperties::constantVolume() const @@ -173,62 +140,6 @@ Foam::ReactingParcel::trackData::pInterp() const // * * * * * * * * * * ThermoParcel Member Functions * * * * * * * * * * * * // -template -inline const Foam::scalarField& Foam::ReactingParcel::YGas() const -{ - return YGas_; -} - - -template -inline Foam::scalarField& Foam::ReactingParcel::YGas() -{ - return YGas_; -} - - -template -inline const Foam::scalarField& Foam::ReactingParcel::YLiquid() const -{ - return YLiquid_; -} - - -template -inline Foam::scalarField& Foam::ReactingParcel::YLiquid() -{ - return YLiquid_; -} - - -template -inline const Foam::scalarField& Foam::ReactingParcel::YSolid() const -{ - return YSolid_; -} - - -template -inline Foam::scalarField& Foam::ReactingParcel::YSolid() -{ - return YSolid_; -} - - -template -inline const Foam::scalarField& Foam::ReactingParcel::YMixture() const -{ - return YMixture_; -} - - -template -inline Foam::scalarField& Foam::ReactingParcel::YMixture() -{ - return YMixture_; -} - - template inline Foam::scalar Foam::ReactingParcel::mass0() const { @@ -236,6 +147,21 @@ inline Foam::scalar Foam::ReactingParcel::mass0() const } +template +inline const Foam::scalarField& Foam::ReactingParcel:: +YMixture() const +{ + return YMixture_; +} + + +template +inline Foam::scalar Foam::ReactingParcel::pc() const +{ + return pc_; +} + + template inline Foam::scalar& Foam::ReactingParcel::mass0() { @@ -243,4 +169,11 @@ inline Foam::scalar& Foam::ReactingParcel::mass0() } +template +inline Foam::scalarField& Foam::ReactingParcel::YMixture() +{ + return YMixture_; +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C index fb9a914273..0a81cdfd3f 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcelIO.C @@ -40,9 +40,6 @@ Foam::ReactingParcel::ReactingParcel ThermoParcel(cloud, is, readFields), mass0_(0.0), YMixture_(0), - YGas_(0), - YLiquid_(0), - YSolid_(0), pc_(0.0) { if (readFields) @@ -51,21 +48,11 @@ Foam::ReactingParcel::ReactingParcel dynamic_cast& >(cloud); const label nMixture = cR.composition().compositionNames().size(); - const label nGas = cR.composition().gasNames().size(); - const label nLiquid = cR.composition().liquidNames().size(); - const label nSolid = cR.composition().solidNames().size(); - YMixture_.setSize(nMixture); - YGas_.setSize(nGas); - YLiquid_.setSize(nLiquid); - YSolid_.setSize(nSolid); if (is.format() == IOstream::ASCII) { - is >> mass0_ >> YMixture_ >> YGas_ >> YLiquid_ >> YSolid_; - YGas_ /= YMixture_[0] + VSMALL; - YLiquid_ /= YMixture_[1] + VSMALL; - YSolid_ /= YMixture_[2] + VSMALL; + is >> mass0_ >> YMixture_; } else { @@ -74,18 +61,19 @@ Foam::ReactingParcel::ReactingParcel reinterpret_cast(&mass0_), + sizeof(mass0_) ); - is >> YMixture_ >> YGas_ >> YLiquid_ >> YSolid_; - YGas_ /= YMixture_[0] + VSMALL; - YLiquid_ /= YMixture_[1] + VSMALL; - YSolid_ /= YMixture_[2] + VSMALL; + is >> YMixture_; } } // Check state of Istream is.check ( - "ReactingParcel::ReactingParcel" - "(const Cloud&, Istream&, bool)" + "ReactingParcel::ReactingParcel\n" + "(\n" + " const Cloud&,\n" + " Istream&,\n" + " bool\n" + ")\n" ); } @@ -115,22 +103,13 @@ void Foam::ReactingParcel::readFields // Get names and sizes for each Y... const wordList compositionNames = c.composition().compositionNames(); - const wordList gasNames = c.composition().gasNames(); - const wordList liquidNames = c.composition().liquidNames(); - const wordList solidNames = c.composition().solidNames(); const label nComposition = compositionNames.size(); - const label nGas = gasNames.size(); - const label nLiquid = liquidNames.size(); - const label nSolid = solidNames.size(); // Set storage for each Y... for each parcel forAllIter(typename Cloud, c, iter) { ReactingParcel& p = iter(); p.YMixture_.setSize(nComposition, 0.0); - p.YGas_.setSize(nGas, 0.0); - p.YLiquid_.setSize(nLiquid, 0.0); - p.YSolid_.setSize(nSolid, 0.0); } // Populate YMixture for each parcel @@ -148,51 +127,6 @@ void Foam::ReactingParcel::readFields p.YMixture_[j] = YMixture[i++]; } } - // Populate YGas for each parcel - forAll(gasNames, j) - { - IOField YGas - ( - c.fieldIOobject("Y" + gasNames[j], IOobject::MUST_READ) - ); - - label i = 0; - forAllIter(typename Cloud, c, iter) - { - ReactingParcel& p = iter(); - p.YGas_[j] = YGas[i++]/p.YMixture_[0]; - } - } - // Populate YLiquid for each parcel - forAll(liquidNames, j) - { - IOField YLiquid - ( - c.fieldIOobject("Y" + liquidNames[j], IOobject::MUST_READ) - ); - - label i = 0; - forAllIter(typename Cloud, c, iter) - { - ReactingParcel& p = iter(); - p.YLiquid_[j] = YLiquid[i++]/p.YMixture_[1]; - } - } - // Populate YSolid for each parcel - forAll(solidNames, j) - { - IOField YSolid - ( - c.fieldIOobject("Y" + solidNames[j], IOobject::MUST_READ) - ); - - label i = 0; - forAllIter(typename Cloud, c, iter) - { - ReactingParcel& p = iter(); - p.YSolid_[j] = YSolid[i++]/p.YMixture_[2]; - } - } } @@ -238,60 +172,6 @@ void Foam::ReactingParcel::writeFields YMixture.write(); } - const wordList& gasNames = c.composition().gasNames(); - forAll(gasNames, j) - { - IOField YGas - ( - c.fieldIOobject("Y" + gasNames[j], IOobject::NO_READ), - np - ); - - label i = 0; - forAllConstIter(typename Cloud, c, iter) - { - const ReactingParcel& p0 = iter(); - YGas[i++] = p0.YGas()[j]*p0.YMixture()[0]; - } - - YGas.write(); - } - const wordList& liquidNames = c.composition().liquidNames(); - forAll(liquidNames, j) - { - IOField YLiquid - ( - c.fieldIOobject("Y" + liquidNames[j], IOobject::NO_READ), - np - ); - - label i = 0; - forAllConstIter(typename Cloud, c, iter) - { - const ReactingParcel& p0 = iter(); - YLiquid[i++] = p0.YLiquid()[j]*p0.YMixture()[1]; - } - - YLiquid.write(); - } - const wordList& solidNames = c.composition().solidNames(); - forAll(solidNames, j) - { - IOField YSolid - ( - c.fieldIOobject("Y" + solidNames[j], IOobject::NO_READ), - np - ); - - label i = 0; - forAllConstIter(typename Cloud, c, iter) - { - const ReactingParcel& p0 = iter(); - YSolid[i++] = p0.YSolid()[j]*p0.YMixture()[2]; - } - - YSolid.write(); - } } } @@ -305,17 +185,11 @@ Foam::Ostream& Foam::operator<< const ReactingParcel& p ) { - scalarField YGasLoc = p.YGas()*p.YMixture()[0]; - scalarField YLiquidLoc = p.YLiquid()*p.YMixture()[1]; - scalarField YSolidLoc = p.YSolid()*p.YMixture()[2]; if (os.format() == IOstream::ASCII) { os << static_cast& >(p) << token::SPACE << p.mass0() - << token::SPACE << p.YMixture() - << token::SPACE << YGasLoc - << token::SPACE << YLiquidLoc - << token::SPACE << YSolidLoc; + << token::SPACE << p.YMixture(); } else { @@ -325,7 +199,7 @@ Foam::Ostream& Foam::operator<< reinterpret_cast(&p.mass0_), sizeof(p.mass0()) ); - os << p.YMixture() << YGasLoc << YLiquidLoc << YSolidLoc; + os << p.YMixture(); } // Check state of Ostream diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C new file mode 100644 index 0000000000..8d9c68b8f6 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(basicReactingMultiphaseParcel, 0); + defineParticleTypeNameAndDebug(basicReactingMultiphaseParcel, 0); + defineParcelTypeNameAndDebug(basicReactingMultiphaseParcel, 0); +}; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel +( + ReactingCloud& owner, + const label typeId, + const vector& position, + const label celli, + const scalar d0, + const vector& U0, + const scalar nParticle0, + const scalarField& YGas0, + const scalarField& YLiquid0, + const scalarField& YSolid0, + const scalarField& YMixture0, + const constantProperties& constProps +) +: + ReactingMultiphaseParcel + ( + owner, + typeId, + position, + celli, + d0, + U0, + nParticle0, + YGas0, + YLiquid0, + YSolid0, + YMixture0, + constProps + ) +{} + + +Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel +( + const Cloud& cloud, + Istream& is, + bool readFields +) +: + ReactingMultiphaseParcel + ( + cloud, + is, + readFields + ) +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // + +Foam::basicReactingMultiphaseParcel::~basicReactingMultiphaseParcel() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H new file mode 100644 index 0000000000..7009ca98e0 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::basicReactingMultiphaseParcel + +Description + + +SourceFiles + basicReactingMultiphaseParcel.C + basicReactingMultiphaseParcelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicReactingMultiphaseParcel_H +#define basicReactingMultiphaseParcel_H + +#include "ReactingMultiphaseParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class basicReactingMultiphaseParcel Declaration +\*---------------------------------------------------------------------------*/ + +class basicReactingMultiphaseParcel +: + public ReactingMultiphaseParcel +{ + +public: + + //- Run-time type information + TypeName("basicReactingMultiphaseParcel"); + + // Constructors + + //- Construct from components + basicReactingMultiphaseParcel + ( + ReactingCloud& owner, + const label typeId, + const vector& position, + const label celli, + const scalar d0, + const vector& U0, + const scalar nParticle0, + const scalarField& YGas0, + const scalarField& YLiquid0, + const scalarField& YSolid0, + const scalarField& YMixture0, + const constantProperties& constProps + ); + + //- Construct from Istream + basicReactingMultiphaseParcel + ( + const Cloud& c, + Istream& is, + bool readFields = true + ); + + //- Construct and return a clone + autoPtr clone() const + { + return autoPtr + (new basicReactingMultiphaseParcel(*this)); + } + + + // Destructor + virtual ~basicReactingMultiphaseParcel(); +}; + + +template<> +inline bool contiguous() +{ + return false; // Now have scalar lists/fields (mass fractions) +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C new file mode 100644 index 0000000000..4097dfa878 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "ReactingCloud.H" + +namespace Foam +{ + defineTemplateTypeNameAndDebug(Cloud, 0); + + defineParcelTypeNameAndDebug + ( + KinematicParcel, + 0 + ); +// defineTemplateTypeNameAndDebug +// ( +// KinematicParcel, +// 0 +// ); + defineParcelTypeNameAndDebug + ( + ThermoParcel, + 0 + ); + defineTemplateTypeNameAndDebug + ( + ThermoParcel, + 0 + ); + defineParcelTypeNameAndDebug + ( + ReactingParcel, + 0 + ); + defineTemplateTypeNameAndDebug + ( + ReactingParcel, + 0 + ); + + defineParcelTypeNameAndDebug + ( + KinematicCloud, + 0 + ); +// defineTemplateTypeNameAndDebug +// ( +// KinematicCloud, +// 0 +// ); + + defineParcelTypeNameAndDebug + ( + ThermoCloud, + 0 + ); +// defineTemplateTypeNameAndDebug +// ( +// ThermoCloud, +// 0 +// ); + + defineParcelTypeNameAndDebug + ( + ReactingCloud, + 0 + ); +// defineTemplateTypeNameAndDebug +// ( +// ReactingCloud, +// 0 +// ); + +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelCompositionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelCompositionModels.C new file mode 100644 index 0000000000..9ad0773a17 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelCompositionModels.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "ReactingCloud.H" +#include "SingleMixtureFraction.H" + +namespace Foam +{ + makeCompositionModel(ReactingCloud); + + // Add instances of composition model to the table + makeCompositionModelType + ( + SingleMixtureFraction, + ReactingCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDevolatilisationModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDevolatilisationModels.C new file mode 100644 index 0000000000..dc742aa7b1 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDevolatilisationModels.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "ReactingCloud.H" +#include "NoDevolatilisation.H" +#include "ConstantRateDevolatilisation.H" +#include "SingleKineticRateDevolatilisation.H" + +namespace Foam +{ + makeDevolatilisationModel(ReactingCloud); + + // Add instances of mass transfer model to the table + makeDevolatilisationModelType + ( + NoDevolatilisation, + ReactingCloud, + basicReactingMultiphaseParcel + ); + makeDevolatilisationModelType + ( + ConstantRateDevolatilisation, + ReactingCloud, + basicReactingMultiphaseParcel + ); + makeDevolatilisationModelType + ( + SingleKineticRateDevolatilisation, + ReactingCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDispersionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDispersionModels.C new file mode 100644 index 0000000000..1782cd5387 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDispersionModels.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "KinematicCloud.H" +#include "NoDispersion.H" +#include "GradientDispersionRAS.H" +#include "StochasticDispersionRAS.H" + +namespace Foam +{ + makeDispersionModel(KinematicCloud); + + defineNamedTemplateTypeNameAndDebug + ( + DispersionRASModel >, + 0 + ); + + // Add instances of dispersion model to the table + makeDispersionModelType + ( + NoDispersion, + KinematicCloud, + basicReactingMultiphaseParcel + ); + makeDispersionModelType + ( + GradientDispersionRAS, + KinematicCloud, + basicReactingMultiphaseParcel + ); + makeDispersionModelType + ( + StochasticDispersionRAS, + KinematicCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDragModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDragModels.C new file mode 100644 index 0000000000..1cca5977ad --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelDragModels.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "KinematicCloud.H" +#include "NoDrag.H" +#include "SphereDrag.H" + +namespace Foam +{ + makeDragModel(KinematicCloud); + + // Add instances of drag model to the table + makeDragModelType(NoDrag, KinematicCloud, basicReactingMultiphaseParcel); + makeDragModelType(SphereDrag, KinematicCloud, basicReactingMultiphaseParcel); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelHeatTransferModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelHeatTransferModels.C new file mode 100644 index 0000000000..5cd6b4e0d0 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelHeatTransferModels.C @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "ThermoCloud.H" +#include "NoHeatTransfer.H" +#include "RanzMarshall.H" + +namespace Foam +{ + makeHeatTransferModel(ThermoCloud); + + // Add instances of heat transfer model to the table + makeHeatTransferModelType + ( + NoHeatTransfer, + ThermoCloud, + basicReactingMultiphaseParcel + ); + makeHeatTransferModelType + ( + RanzMarshall, + ThermoCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelInjectionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelInjectionModels.C new file mode 100644 index 0000000000..d563de8c93 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelInjectionModels.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "ReactingCloud.H" +#include "NoInjection.H" +#include "ManualInjection.H" +#include "ConeInjection.H" + +namespace Foam +{ + makeInjectionModel(KinematicCloud); + + // Add instances of injection model to the table + makeInjectionModelType + ( + NoInjection, + KinematicCloud, + basicReactingMultiphaseParcel + ); + makeInjectionModelType + ( + ManualInjection, + KinematicCloud, + basicReactingMultiphaseParcel + ); + makeInjectionModelType + ( + ConeInjection, + KinematicCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C new file mode 100644 index 0000000000..4f0ffec9e8 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSurfaceReactionModels.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "ReactingCloud.H" +#include "NoSurfaceReaction.H" + +namespace Foam +{ + makeSurfaceReactionModel(ReactingCloud); + + // Add instances of surface reaction model to the table + makeSurfaceReactionModelType + ( + NoSurfaceReaction, + ReactingCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelWallInteractionModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelWallInteractionModels.C new file mode 100644 index 0000000000..62443b3f0b --- /dev/null +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelWallInteractionModels.C @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "basicReactingMultiphaseParcel.H" +#include "KinematicCloud.H" +#include "Rebound.H" +#include "StandardWallInteraction.H" + +namespace Foam +{ + makeWallInteractionModel(KinematicCloud); +// makeWallInteractionModel(ReactingCloud); + + // Add instances of wall interaction model to the table + makeWallInteractionModelType + ( + Rebound, + KinematicCloud, + basicReactingMultiphaseParcel + ); + makeWallInteractionModelType + ( + StandardWallInteraction, + KinematicCloud, + basicReactingMultiphaseParcel + ); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelDevolatilisationModels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelDevolatilisationModels.C index 013c4f5cdb..c13d136a81 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelDevolatilisationModels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelDevolatilisationModels.C @@ -25,7 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "basicReactingParcel.H" -#include "ThermoCloud.H" +#include "ReactingCloud.H" #include "NoDevolatilisation.H" #include "ConstantRateDevolatilisation.H" #include "SingleKineticRateDevolatilisation.H"