thermo updates - now create cloud using basicThermo instead of hCombustionThermo

This commit is contained in:
andy
2009-06-15 19:13:36 +01:00
parent 040c1d727c
commit 9b950c5eab
28 changed files with 125 additions and 152 deletions

View File

@ -35,7 +35,7 @@ Foam::CoalCloud<ThermoType>::CoalCloud
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
) )
: :
ReactingMultiphaseCloud<CoalParcel<ThermoType> > ReactingMultiphaseCloud<CoalParcel<ThermoType> >

View File

@ -76,7 +76,7 @@ public:
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
); );

View File

@ -50,10 +50,10 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
CsLocalId_ = owner.composition().localId(idSolid, "C"); CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties // Set local copies of thermo properties
WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc(); HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
if (Sb_ < 0) if (Sb_ < 0)
{ {
@ -120,8 +120,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
} }
// Local mass fraction of O2 in the carrier phase // Local mass fraction of O2 in the carrier phase
const scalar YO2 = const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
// Change in C mass [kg] // Change in C mass [kg]
scalar dmC = scalar dmC =

View File

@ -58,10 +58,10 @@ COxidationKineticDiffusionLimitedRate
CsLocalId_ = owner.composition().localId(idSolid, "C"); CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties // Set local copies of thermo properties
WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.composition().carrierSpecies()[CO2GlobalId_].Hc(); HcCO2_ = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].Hc();
if (Sb_ < 0) if (Sb_ < 0)
{ {
@ -128,8 +128,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
} }
// Local mass fraction of O2 in the carrier phase // Local mass fraction of O2 in the carrier phase
const scalar YO2 = const scalar YO2 = this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI];
// Diffusion rate coefficient // Diffusion rate coefficient
const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75); const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75);

View File

@ -69,8 +69,8 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
CsLocalId_ = owner.composition().localId(idSolid, "C"); CsLocalId_ = owner.composition().localId(idSolid, "C");
// Set local copies of thermo properties // Set local copies of thermo properties
WO2_ = owner.composition().carrierSpecies()[O2GlobalId_].W(); WO2_ = owner.mcCarrierThermo().speciesData()[O2GlobalId_].W();
scalar WCO2 = owner.composition().carrierSpecies()[CO2GlobalId_].W(); scalar WCO2 = owner.mcCarrierThermo().speciesData()[CO2GlobalId_].W();
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
} }
@ -125,7 +125,7 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
// Cell carrier phase O2 species density [kg/m^3] // Cell carrier phase O2 species density [kg/m^3]
const scalar rhoO2 = const scalar rhoO2 =
rhoc*this->owner().carrierThermo().composition().Y(O2GlobalId_)[cellI]; rhoc*this->owner().mcCarrierThermo().Y(O2GlobalId_)[cellI];
if (rhoO2 < SMALL) if (rhoO2 < SMALL)
{ {
@ -211,9 +211,9 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
this->owner().composition().solids().properties()[CsLocalId_].Hf() this->owner().composition().solids().properties()[CsLocalId_].Hf()
+ this->owner().composition().solids().properties()[CsLocalId_].cp()*T; + this->owner().composition().solids().properties()[CsLocalId_].cp()*T;
const scalar HCO2 = const scalar HCO2 =
this->owner().composition().carrierSpecies()[CO2GlobalId_].H(T); this->owner().mcCarrierThermo().speciesData()[CO2GlobalId_].H(T);
const scalar HO2 = const scalar HO2 =
this->owner().composition().carrierSpecies()[O2GlobalId_].H(T); this->owner().mcCarrierThermo().speciesData()[O2GlobalId_].H(T);
// Heat of reaction // Heat of reaction
return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2); return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);

View File

@ -28,7 +28,6 @@ License
#include "CompositionModel.H" #include "CompositionModel.H"
#include "PhaseChangeModel.H" #include "PhaseChangeModel.H"
#include "multiComponentMixture.H"
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
@ -68,14 +67,16 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
) )
: :
ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo), ThermoCloud<ParcelType>(cloudName, rho, U, g, thermo),
reactingCloud(), reactingCloud(),
constProps_(this->particleProperties()), constProps_(this->particleProperties()),
carrierThermo_(thermo), mcCarrierThermo_
carrierSpecies_(thermo.composition().Y().size()), (
dynamic_cast<multiComponentMixture<thermoType>&>(thermo)
),
compositionModel_ compositionModel_
( (
CompositionModel<ReactingCloud<ParcelType> >::New CompositionModel<ReactingCloud<ParcelType> >::New
@ -92,23 +93,9 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
*this *this
) )
), ),
rhoTrans_(thermo.composition().Y().size()), rhoTrans_(mcCarrierThermo_.species().size()),
dMassPhaseChange_(0.0) dMassPhaseChange_(0.0)
{ {
// Create the carrier species
forAll(carrierSpecies_, specieI)
{
carrierSpecies_.set
(
specieI,
new thermoType
(
dynamic_cast<const multiComponentMixture<thermoType>&>
(thermo).speciesData()[specieI]
)
);
}
// Set storage for mass source fields and initialise to zero // Set storage for mass source fields and initialise to zero
forAll(rhoTrans_, i) forAll(rhoTrans_, i)
{ {
@ -119,9 +106,7 @@ Foam::ReactingCloud<ParcelType>::ReactingCloud
( (
IOobject IOobject
( (
this->name() this->name() + "rhoTrans_" + mcCarrierThermo_.species()[i],
+ "rhoTrans_"
+ thermo.composition().Y()[i].name(),
this->db().time().timeName(), this->db().time().timeName(),
this->db(), this->db(),
IOobject::NO_READ, IOobject::NO_READ,
@ -193,9 +178,9 @@ void Foam::ReactingCloud<ParcelType>::resetSourceTerms()
template<class ParcelType> template<class ParcelType>
void Foam::ReactingCloud<ParcelType>::evolve() void Foam::ReactingCloud<ParcelType>::evolve()
{ {
const volScalarField& T = carrierThermo_.T(); const volScalarField& T = this->carrierThermo().T();
const volScalarField cp = carrierThermo_.Cp(); const volScalarField cp = this->carrierThermo().Cp();
const volScalarField& p = carrierThermo_.p(); const volScalarField& p = this->carrierThermo().p();
autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New autoPtr<interpolation<scalar> > rhoInterp = interpolation<scalar>::New
( (

View File

@ -41,11 +41,9 @@ SourceFiles
#ifndef ReactingCloud_H #ifndef ReactingCloud_H
#define ReactingCloud_H #define ReactingCloud_H
#include "autoPtr.H"
#include "hCombustionThermo.H"
#include "ThermoCloud.H" #include "ThermoCloud.H"
#include "reactingCloud.H" #include "reactingCloud.H"
#include "multiComponentMixture.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -94,11 +92,8 @@ protected:
//- Parcel constant properties //- Parcel constant properties
typename ParcelType::constantProperties constProps_; typename ParcelType::constantProperties constProps_;
//- Thermodynamics package (combustion) //- Multi-component carrier phase thermo
hCombustionThermo& carrierThermo_; multiComponentMixture<thermoType>& mcCarrierThermo_;
//- Gas phase properties
PtrList<thermoType> carrierSpecies_;
// References to the cloud sub-models // References to the cloud sub-models
@ -148,7 +143,7 @@ public:
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
); );
@ -168,14 +163,12 @@ public:
inline const typename ParcelType::constantProperties& inline const typename ParcelType::constantProperties&
constProps() const; constProps() const;
//- Return const access to carrier phase thermo package //- Return const access to multi-component carrier phase thermo
inline const hCombustionThermo& carrierThermo() const; inline const multiComponentMixture<thermoType>&
mcCarrierThermo() const;
//- Return access to carrier phase thermo package //- Return access to multi-component carrier phase thermo
inline hCombustionThermo& carrierThermo(); inline multiComponentMixture<thermoType>& mcCarrierThermo();
//- Gas phase properties
inline const PtrList<thermoType>& carrierSpecies() const;
// Sub-models // Sub-models

View File

@ -35,26 +35,18 @@ Foam::ReactingCloud<ParcelType>::constProps() const
template<class ParcelType> template<class ParcelType>
inline const Foam::hCombustionThermo& inline const Foam::multiComponentMixture<typename ParcelType::thermoType>&
Foam::ReactingCloud<ParcelType>::carrierThermo() const Foam::ReactingCloud<ParcelType>::mcCarrierThermo() const
{ {
return carrierThermo_; return mcCarrierThermo_;
} }
template<class ParcelType> template<class ParcelType>
inline Foam::hCombustionThermo& inline Foam::multiComponentMixture<typename ParcelType::thermoType>&
Foam::ReactingCloud<ParcelType>::carrierThermo() Foam::ReactingCloud<ParcelType>::mcCarrierThermo()
{ {
return carrierThermo_; return mcCarrierThermo_;
}
template<class ParcelType>
inline const Foam::PtrList<typename ParcelType::thermoType>&
Foam::ReactingCloud<ParcelType>::carrierSpecies() const
{
return carrierSpecies_;
} }

View File

@ -38,7 +38,7 @@ Foam::ReactingMultiphaseCloud<ParcelType>::ReactingMultiphaseCloud
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
) )
: :
ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo), ReactingCloud<ParcelType>(cloudName, rho, U, g, thermo),

View File

@ -123,7 +123,7 @@ public:
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
); );

View File

@ -40,11 +40,9 @@ SourceFiles
#ifndef ThermoCloud_H #ifndef ThermoCloud_H
#define ThermoCloud_H #define ThermoCloud_H
#include "autoPtr.H"
#include "hCombustionThermo.H"
#include "KinematicCloud.H" #include "KinematicCloud.H"
#include "thermoCloud.H" #include "thermoCloud.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -35,7 +35,7 @@ Foam::BasicReactingCloud<ThermoType>::BasicReactingCloud
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
) )
: :
ReactingCloud<BasicReactingParcel<ThermoType> > ReactingCloud<BasicReactingParcel<ThermoType> >

View File

@ -81,7 +81,7 @@ public:
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
); );

View File

@ -35,8 +35,7 @@ Foam::BasicReactingMultiphaseCloud<ThermoType>::BasicReactingMultiphaseCloud
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo, basicThermo& thermo
PtrList<ThermoType>& carrierSpecies
) )
: :
ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> > ReactingMultiphaseCloud<BasicReactingMultiphaseParcel<ThermoType> >
@ -45,8 +44,7 @@ Foam::BasicReactingMultiphaseCloud<ThermoType>::BasicReactingMultiphaseCloud
rho, rho,
U, U,
g, g,
thermo, thermo
carrierSpecies
) )
{ {
BasicReactingMultiphaseParcel<ThermoType>::readFields(*this); BasicReactingMultiphaseParcel<ThermoType>::readFields(*this);

View File

@ -81,8 +81,7 @@ public:
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo, basicThermo& thermo
PtrList<ThermoType>& carrierSpecies
); );

View File

@ -35,7 +35,7 @@ Foam::BasicTrackedReactingCloud<ThermoType>::BasicTrackedReactingCloud
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
) )
: :
ReactingCloud<BasicTrackedReactingParcel<ThermoType> > ReactingCloud<BasicTrackedReactingParcel<ThermoType> >

View File

@ -81,7 +81,7 @@ public:
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U, const volVectorField& U,
const dimensionedVector& g, const dimensionedVector& g,
hCombustionThermo& thermo basicThermo& thermo
); );

View File

@ -168,7 +168,8 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::cellValueSourceCorrection
forAll(td.cloud().rhoTrans(), i) forAll(td.cloud().rhoTrans(), i)
{ {
scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass;
cpEff += Y*td.cloud().carrierSpecies()[i].Cp(this->Tc_); cpEff +=
Y*td.cloud().mcCarrierThermo().speciesData()[i].Cp(this->Tc_);
} }
} }
const scalar cpc = td.cpInterp().psi()[cellI]; const scalar cpc = td.cpInterp().psi()[cellI];
@ -248,7 +249,12 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
scalarField dMassSRGas(YGas_.size(), 0.0); scalarField dMassSRGas(YGas_.size(), 0.0);
scalarField dMassSRLiquid(YLiquid_.size(), 0.0); scalarField dMassSRLiquid(YLiquid_.size(), 0.0);
scalarField dMassSRSolid(YSolid_.size(), 0.0); scalarField dMassSRSolid(YSolid_.size(), 0.0);
scalarField dMassSRCarrier(td.cloud().carrierSpecies().size(), 0.0); scalarField
dMassSRCarrier
(
td.cloud().mcCarrierThermo().species().size(),
0.0
);
// Clac mass and enthalpy transfer due to surface reactions // Clac mass and enthalpy transfer due to surface reactions
calcSurfaceReactions calcSurfaceReactions
@ -340,7 +346,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
td.cloud().hcTrans()[cellI] += td.cloud().hcTrans()[cellI] +=
np0 np0
*dMassGas[i] *dMassGas[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0); *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0);
} }
forAll(YLiquid_, i) forAll(YLiquid_, i)
{ {
@ -349,7 +355,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
td.cloud().hcTrans()[cellI] += td.cloud().hcTrans()[cellI] +=
np0 np0
*dMassLiquid[i] *dMassLiquid[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0); *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0);
} }
/* /*
// No mapping between solid components and carrier phase // No mapping between solid components and carrier phase
@ -360,7 +366,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
td.cloud().hcTrans()[cellI] += td.cloud().hcTrans()[cellI] +=
np0 np0
*dMassSolid[i] *dMassSolid[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0); *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0);
} }
*/ */
forAll(dMassSRCarrier, i) forAll(dMassSRCarrier, i)
@ -369,7 +375,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
td.cloud().hcTrans()[cellI] += td.cloud().hcTrans()[cellI] +=
np0 np0
*dMassSRCarrier[i] *dMassSRCarrier[i]
*td.cloud().composition().carrierSpecies()[i].H(T0); *td.cloud().mcCarrierThermo().speciesData()[i].H(T0);
} }
// Update momentum transfer // Update momentum transfer

View File

@ -86,7 +86,8 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
forAll(td.cloud().rhoTrans(), i) forAll(td.cloud().rhoTrans(), i)
{ {
scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass;
cpEff += Y*td.cloud().carrierSpecies()[i].Cp(this->Tc_); cpEff +=
Y*td.cloud().mcCarrierThermo().speciesData()[i].Cp(this->Tc_);
} }
} }
const scalar cpc = td.cpInterp().psi()[cellI]; const scalar cpc = td.cpInterp().psi()[cellI];
@ -190,9 +191,6 @@ void Foam::ReactingParcel<ParcelType>::calc
// Motion // Motion
// ~~~~~~ // ~~~~~~
// No additional forces
vector Fx = vector::zero;
// Calculate new particle velocity // Calculate new particle velocity
vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans);
@ -210,7 +208,7 @@ void Foam::ReactingParcel<ParcelType>::calc
td.cloud().hcTrans()[cellI] += td.cloud().hcTrans()[cellI] +=
np0 np0
*dMassPC[i] *dMassPC[i]
*td.cloud().composition().carrierSpecies()[gid].H(T0); *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0);
} }
// Update momentum transfer // Update momentum transfer
@ -317,16 +315,15 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot); td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot);
// Enthalphy transfer to carrier phase // Enthalphy transfer to carrier phase
label id;
forAll(YComponents, i) forAll(YComponents, i)
{ {
label gid; id = td.cloud().composition().localToGlobalCarrierId(idPhase, i);
const scalar hv = td.cloud().mcCarrierThermo().speciesData()[id].H(T);
gid = td.cloud().composition().localToGlobalCarrierId(idPhase, i); id = td.cloud().composition().globalIds(idPhase)[i];
const scalar hv = td.cloud().composition().carrierSpecies()[gid].H(T);
gid = td.cloud().composition().globalIds(idPhase)[i];
const scalar hl = const scalar hl =
td.cloud().composition().liquids().properties()[gid].h(pc_, T); td.cloud().composition().liquids().properties()[id].h(pc_, T);
Sh += dMassPC[i]*(hl - hv)/dt; Sh += dMassPC[i]*(hl - hv)/dt;
} }

View File

@ -39,15 +39,14 @@ Foam::CompositionModel<CloudType>::CompositionModel
dict_(dict), dict_(dict),
owner_(owner), owner_(owner),
coeffDict_(dict.subDict(type + "Coeffs")), coeffDict_(dict.subDict(type + "Coeffs")),
carrierThermo_(owner.carrierThermo()), mcCarrierThermo_(owner.mcCarrierThermo()),
carrierSpecies_(owner.carrierSpecies()),
liquids_ liquids_
( (
liquidMixture::New liquidMixture::New
( (
owner.mesh().objectRegistry::lookupObject<dictionary> owner.mesh().objectRegistry::lookupObject<dictionary>
( (
carrierThermo_.name() owner.carrierThermo().name()
) )
) )
), ),
@ -57,14 +56,14 @@ Foam::CompositionModel<CloudType>::CompositionModel
( (
owner.mesh().objectRegistry::lookupObject<dictionary> owner.mesh().objectRegistry::lookupObject<dictionary>
( (
carrierThermo_.name() owner.carrierThermo().name()
) )
) )
), ),
phaseProps_ phaseProps_
( (
coeffDict_.lookup("phases"), coeffDict_.lookup("phases"),
carrierThermo_.composition().species(), mcCarrierThermo_.species(),
liquids_().components(), liquids_().components(),
solids_().components() solids_().components()
) )
@ -102,18 +101,10 @@ const Foam::dictionary& Foam::CompositionModel<CloudType>::coeffDict() const
template<class CloudType> template<class CloudType>
const Foam::hCombustionThermo& const Foam::multiComponentMixture<typename CloudType::thermoType>&
Foam::CompositionModel<CloudType>::carrierThermo() const Foam::CompositionModel<CloudType>::mcCarrierThermo() const
{ {
return carrierThermo_; return mcCarrierThermo_;
}
template<class CloudType>
const Foam::PtrList<typename CloudType::thermoType>&
Foam::CompositionModel<CloudType>::carrierSpecies() const
{
return carrierSpecies_;
} }
@ -184,11 +175,9 @@ Foam::label Foam::CompositionModel<CloudType>::globalCarrierId
const word& cmptName const word& cmptName
) const ) const
{ {
forAll(carrierThermo_.composition().species(), i) forAll(mcCarrierThermo_.species(), i)
{ {
const word& carrierSpecieName = if (cmptName == mcCarrierThermo_.species()[i])
carrierThermo_.composition().species()[i];
if (cmptName == carrierSpecieName)
{ {
return i; return i;
} }
@ -324,8 +313,8 @@ Foam::scalarField Foam::CompositionModel<CloudType>::X
forAll(Y, i) forAll(Y, i)
{ {
label gid = props.globalIds()[i]; label gid = props.globalIds()[i];
WInv += Y[i]/this->carrierSpecies()[gid].W(); WInv += Y[i]/mcCarrierThermo_.speciesData()[gid].W();
X[i] = Y[i]/this->carrierSpecies()[gid].W(); X[i] = Y[i]/mcCarrierThermo_.speciesData()[gid].W();
} }
break; break;
} }
@ -375,7 +364,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::H
forAll(Y, i) forAll(Y, i)
{ {
label gid = props.globalIds()[i]; label gid = props.globalIds()[i];
HMixture += Y[i]*this->carrierSpecies()[gid].H(T); HMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].H(T);
} }
break; break;
} }
@ -439,7 +428,7 @@ Foam::scalar Foam::CompositionModel<CloudType>::cp
forAll(Y, i) forAll(Y, i)
{ {
label gid = props.globalIds()[i]; label gid = props.globalIds()[i];
cpMixture += Y[i]*this->carrierSpecies()[gid].Cp(T); cpMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Cp(T);
} }
break; break;
} }

View File

@ -44,7 +44,7 @@ SourceFiles
#include "runTimeSelectionTables.H" #include "runTimeSelectionTables.H"
#include "PtrList.H" #include "PtrList.H"
#include "hCombustionThermo.H" #include "multiComponentMixture.H"
#include "liquidMixture.H" #include "liquidMixture.H"
#include "solidMixture.H" #include "solidMixture.H"
@ -74,11 +74,8 @@ class CompositionModel
//- The coefficients dictionary //- The coefficients dictionary
const dictionary& coeffDict_; const dictionary& coeffDict_;
//- Reference to the carrier phase thermo package //- Reference to the multi-component carrier phase thermo
hCombustionThermo& carrierThermo_; multiComponentMixture<typename CloudType::thermoType>& mcCarrierThermo_;
//- Reference to the carrier phase species
const PtrList<typename CloudType::thermoType>& carrierSpecies_;
//- Global (additional) liquid properties data //- Global (additional) liquid properties data
autoPtr<liquidMixture> liquids_; autoPtr<liquidMixture> liquids_;
@ -146,15 +143,12 @@ public:
const dictionary& coeffDict() const; const dictionary& coeffDict() const;
//- Return the carrier phase thermo package //- Return the carrier phase thermo package
const hCombustionThermo& carrierThermo() const; const multiComponentMixture<typename CloudType::thermoType>&
mcCarrierThermo() const;
// Composition lists // Composition lists
//- Return the carrier species
const PtrList<typename CloudType::thermoType>&
carrierSpecies() const;
//- Return the global (additional) liquids //- Return the global (additional) liquids
const liquidMixture& liquids() const; const liquidMixture& liquids() const;

View File

@ -35,14 +35,14 @@ Foam::scalarField Foam::LiquidEvaporation<CloudType>::calcXc
const label cellI const label cellI
) const ) const
{ {
scalarField Xc(this->owner().carrierThermo().composition().Y().size()); scalarField Xc(this->owner().mcCarrierThermo().Y().size());
scalar Winv = 0.0; scalar Winv = 0.0;
forAll(Xc, i) forAll(Xc, i)
{ {
scalar Y = this->owner().carrierThermo().composition().Y()[i][cellI]; scalar Y = this->owner().mcCarrierThermo().Y()[i][cellI];
Winv += Y/this->owner().carrierSpecies()[i].W(); Winv += Y/this->owner().mcCarrierThermo().speciesData()[i].W();
Xc[i] = Y/this->owner().carrierSpecies()[i].W(); Xc[i] = Y/this->owner().mcCarrierThermo().speciesData()[i].W();
} }
return Xc/Winv; return Xc/Winv;
@ -76,7 +76,7 @@ Foam::LiquidEvaporation<CloudType>::LiquidEvaporation
( (
owner.mesh().objectRegistry::lookupObject<dictionary> owner.mesh().objectRegistry::lookupObject<dictionary>
( (
owner.carrierThermo().name() "thermophysicalProperties"
) )
) )
), ),
@ -104,7 +104,7 @@ Foam::LiquidEvaporation<CloudType>::LiquidEvaporation
owner.composition().globalCarrierId(activeLiquids_[i]); owner.composition().globalCarrierId(activeLiquids_[i]);
} }
// Determine mapping between local and global liquids // Determine mapping between model active liquids and global liquids
label idLiquid = owner.composition().idLiquid(); label idLiquid = owner.composition().idLiquid();
forAll(activeLiquids_, i) forAll(activeLiquids_, i)
{ {

View File

@ -103,6 +103,16 @@ Foam::autoPtr<Foam::hCombustionThermo> Foam::hCombustionThermo::NewType
if (hCombustionThermoTypeName.find(thermoType) == string::npos) if (hCombustionThermoTypeName.find(thermoType) == string::npos)
{ {
wordList allModels = fvMeshConstructorTablePtr_->toc();
DynamicList<word> validModels;
forAll(allModels, i)
{
if (allModels[i].find(thermoType) != string::npos)
{
validModels.append(allModels[i]);
}
}
FatalErrorIn FatalErrorIn
( (
"autoPtr<hCombustionThermo> hCombustionThermo::NewType" "autoPtr<hCombustionThermo> hCombustionThermo::NewType"
@ -112,7 +122,8 @@ Foam::autoPtr<Foam::hCombustionThermo> Foam::hCombustionThermo::NewType
")" ")"
) << "Inconsistent thermo package selected:" << nl << nl ) << "Inconsistent thermo package selected:" << nl << nl
<< hCombustionThermoTypeName << nl << nl << "Please select a " << hCombustionThermoTypeName << nl << nl << "Please select a "
<< "thermo package based on " << thermoType << nl << nl << "thermo package based on " << thermoType
<< ". Valid options include:" << nl << validModels << nl
<< exit(FatalError); << exit(FatalError);
} }
} }

View File

@ -103,6 +103,16 @@ Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::NewType
if (hReactionThermoTypeName.find(thermoType) == string::npos) if (hReactionThermoTypeName.find(thermoType) == string::npos)
{ {
wordList allModels = fvMeshConstructorTablePtr_->toc();
DynamicList<word> validModels;
forAll(allModels, i)
{
if (allModels[i].find(thermoType) != string::npos)
{
validModels.append(allModels[i]);
}
}
FatalErrorIn FatalErrorIn
( (
"autoPtr<hReactionThermo> hReactionThermo::NewType" "autoPtr<hReactionThermo> hReactionThermo::NewType"
@ -112,7 +122,8 @@ Foam::autoPtr<Foam::hReactionThermo> Foam::hReactionThermo::NewType
")" ")"
) << "Inconsistent thermo package selected:" << nl << nl ) << "Inconsistent thermo package selected:" << nl << nl
<< hReactionThermoTypeName << nl << nl << "Please select a " << hReactionThermoTypeName << nl << nl << "Please select a "
<< "thermo package based on " << thermoType << nl << nl << "thermo package based on " << thermoType
<< ". Valid options include:" << nl << validModels << nl
<< exit(FatalError); << exit(FatalError);
} }
} }

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org | | \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -15,11 +15,13 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
psiChemistryModel ODEChemistryModel<gasThermoPhysics>;
chemistry off; chemistry off;
turbulentReaction off; turbulentReaction off;
chemistrySolver ODE; chemistrySolver ode;
initialChemicalTimeStep 1e-07; initialChemicalTimeStep 1e-07;
@ -34,7 +36,7 @@ EulerImplicitCoeffs
equilibriumRateLimiter off; equilibriumRateLimiter off;
} }
ODECoeffs odeCoeffs
{ {
ODESolver RK; ODESolver RK;
eps 0.05; eps 0.05;

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType hMixtureThermo<reactingMixture>; thermoType hPsiMixtureThermo<reactingMixture<gasThermoPhysics>>;
chemistryReader foamChemistryReader; chemistryReader foamChemistryReader;