Rationalized heat release rate functions

Combined 'dQ()' and 'Sh()' into 'Qdot()' which returns the heat-release rate in
the normal units [kg/m/s3] and used as the heat release rate source term in
the energy equations, to set the field 'Qdot' in several combustion solvers
and for the evaluation of the local time-step when running LTS.
This commit is contained in:
Henry Weller
2016-12-15 17:10:21 +00:00
parent 0fdaafce7c
commit 1a2c77abfa
54 changed files with 142 additions and 366 deletions

View File

@ -116,29 +116,14 @@ Foam::combustionModels::PaSR<Type>::R(volScalarField& Y) const
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::PaSR<Type>::dQ() const
Foam::combustionModels::PaSR<Type>::Qdot() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject::groupName("PaSR:dQ", this->phaseName_),
kappa_*laminar<Type>::dQ()
)
);
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::PaSR<Type>::Sh() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject::groupName("PaSR:Sh", this->phaseName_),
kappa_*laminar<Type>::Sh()
kappa_*laminar<Type>::Qdot()
)
);
}

View File

@ -107,11 +107,8 @@ public:
//- Fuel consumption rate matrix.
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
//- Update properties from given dictionary
virtual bool read();

View File

@ -81,7 +81,6 @@ Foam::combustionModel::~combustionModel()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::combustionModel::read()
{
if (regIOobject::read())
@ -97,25 +96,4 @@ bool Foam::combustionModel::read()
}
Foam::tmp<Foam::volScalarField> Foam::combustionModel::Sh() const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("Sh", phaseName_),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0)
)
);
}
// ************************************************************************* //

View File

@ -137,11 +137,8 @@ public:
//- Fuel consumption rate matrix, i.e. source term for fuel equation
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const = 0;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const = 0;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const = 0;
//- Update properties from given dictionary
virtual bool read();

View File

@ -136,15 +136,15 @@ Foam::combustionModels::laminar<Type>::R(volScalarField& Y) const
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::dQ() const
Foam::combustionModels::laminar<Type>::Qdot() const
{
tmp<volScalarField> tdQ
tmp<volScalarField> tQdot
(
new volScalarField
(
IOobject
(
IOobject::groupName(typeName + ":dQ", this->phaseName_),
IOobject::groupName(typeName + ":Qdot", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
@ -152,47 +152,16 @@ Foam::combustionModels::laminar<Type>::dQ() const
false
),
this->mesh(),
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
)
);
if (this->active())
{
tdQ.ref() = this->chemistryPtr_->dQ();
tQdot.ref() = this->chemistryPtr_->Qdot();
}
return tdQ;
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::laminar<Type>::Sh() const
{
tmp<volScalarField> tSh
(
new volScalarField
(
IOobject
(
IOobject::groupName(typeName + ":Sh", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
)
);
if (this->active())
{
tSh.ref() = this->chemistryPtr_->Sh();
}
return tSh;
return tQdot;
}

View File

@ -105,11 +105,8 @@ public:
//- Fuel consumption rate matrix.
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
//- Update properties from given dictionary
virtual bool read();

View File

@ -75,15 +75,15 @@ Foam::combustionModels::noCombustion<CombThermoType>::R
template<class CombThermoType>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::noCombustion<CombThermoType>::dQ() const
Foam::combustionModels::noCombustion<CombThermoType>::Qdot() const
{
tmp<volScalarField> tdQ
tmp<volScalarField> tQdot
(
new volScalarField
(
IOobject
(
IOobject::groupName("dQ", this->phaseName_),
IOobject::groupName("Qdot", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
@ -91,37 +91,11 @@ Foam::combustionModels::noCombustion<CombThermoType>::dQ() const
false
),
this->mesh(),
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
)
);
return tdQ;
}
template<class CombThermoType>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::noCombustion<CombThermoType>::Sh() const
{
tmp<volScalarField> tSh
(
new volScalarField
(
IOobject
(
IOobject::groupName("Sh", this->phaseName_),
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
)
);
return tSh;
return tQdot;
}

View File

@ -89,11 +89,8 @@ public:
//- Fuel consumption rate matrix
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
//- Update properties from given dictionary
virtual bool read();

View File

@ -127,7 +127,7 @@ tmp<fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R
template<class CombThermoType, class ThermoType>
tmp<volScalarField>
singleStepCombustion<CombThermoType, ThermoType>::Sh() const
singleStepCombustion<CombThermoType, ThermoType>::Qdot() const
{
const label fuelI = singleMixturePtr_->fuelIndex();
volScalarField& YFuel =
@ -137,37 +137,6 @@ singleStepCombustion<CombThermoType, ThermoType>::Sh() const
}
template<class CombThermoType, class ThermoType>
tmp<volScalarField>
singleStepCombustion<CombThermoType, ThermoType>::dQ() const
{
tmp<volScalarField> tdQ
(
new volScalarField
(
IOobject
(
IOobject::groupName("dQ", this->phaseName_),
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
)
);
if (this->active())
{
volScalarField& dQ = tdQ.ref();
dQ.ref() = this->mesh().V()*Sh()();
}
return tdQ;
}
template<class CombThermoType, class ThermoType>
bool singleStepCombustion<CombThermoType, ThermoType>::read()
{

View File

@ -99,11 +99,8 @@ public:
//- Fuel consumption rate matrix
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Sensible enthalpy source term
virtual tmp<volScalarField> Sh() const;
//- Heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
//- Update properties from given dictionary
virtual bool read();

View File

@ -165,17 +165,9 @@ Foam::combustionModels::zoneCombustion<Type>::R(volScalarField& Y) const
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::zoneCombustion<Type>::dQ() const
Foam::combustionModels::zoneCombustion<Type>::Qdot() const
{
return filter(combustionModelPtr_->dQ());
}
template<class Type>
Foam::tmp<Foam::volScalarField>
Foam::combustionModels::zoneCombustion<Type>::Sh() const
{
return filter(combustionModelPtr_->Sh());
return filter(combustionModelPtr_->Qdot());
}

View File

@ -114,11 +114,8 @@ public:
//- Fuel consumption rate matrix.
virtual tmp<fvScalarMatrix> R(volScalarField& Y) const;
//- Heat release rate calculated from fuel consumption rate matrix
virtual tmp<volScalarField> dQ() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
//- Update properties from given dictionary
virtual bool read();

View File

@ -329,7 +329,7 @@ void reactingOneDim::solveEnergy()
+ fvc::laplacian(alpha, h_)
- fvc::laplacian(kappa(), T())
==
chemistrySh_
chemistryQdot_
- fvm::Sp(solidChemistry_->RRg(), h_)
);
@ -371,7 +371,7 @@ void reactingOneDim::calculateMassTransfer()
if (infoOutput_)
{
totalHeatRR_ = fvc::domainIntegrate(chemistrySh_);
totalHeatRR_ = fvc::domainIntegrate(chemistryQdot_);
addedGasMass_ +=
fvc::domainIntegrate(solidChemistry_->RRg())*time_.deltaT();
@ -440,11 +440,11 @@ reactingOneDim::reactingOneDim
dimensionedScalar("zero", dimEnergy/dimTime, 0.0)
),
chemistrySh_
chemistryQdot_
(
IOobject
(
"chemistrySh",
"chemistryQdot",
time().timeName(),
regionMesh(),
IOobject::NO_READ,
@ -540,11 +540,11 @@ reactingOneDim::reactingOneDim
dimensionedScalar("zero", dimEnergy/dimTime, 0.0)
),
chemistrySh_
chemistryQdot_
(
IOobject
(
"chemistrySh",
"chemistryQdot",
time().timeName(),
regionMesh(),
IOobject::NO_READ,
@ -705,7 +705,7 @@ void reactingOneDim::evolveRegion()
solveContinuity();
chemistrySh_ = solidChemistry_->Sh()();
chemistryQdot_ = solidChemistry_->Qdot()();
updateFields();

View File

@ -117,8 +117,8 @@ protected:
//- Sensible enthalpy gas flux [J/m2/s]
volScalarField phiHsGas_;
//- Heat release [J/s/m3]
volScalarField chemistrySh_;
//- Heat release rate [J/s/m3]
volScalarField chemistryQdot_;
// Source term fields

View File

@ -174,11 +174,8 @@ public:
//- Return the chemical time scale
virtual tmp<volScalarField> tc() const = 0;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const = 0;
//- Return the heat release, i.e. enthalpy/sec [m2/s3]
virtual tmp<volScalarField> dQ() const = 0;
//- Return the heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const = 0;
};

View File

@ -545,15 +545,15 @@ Foam::chemistryModel<CompType, ThermoType>::tc() const
template<class CompType, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::chemistryModel<CompType, ThermoType>::Sh() const
Foam::chemistryModel<CompType, ThermoType>::Qdot() const
{
tmp<volScalarField> tSh
tmp<volScalarField> tQdot
(
new volScalarField
(
IOobject
(
"Sh",
"Qdot",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
@ -561,57 +561,25 @@ Foam::chemistryModel<CompType, ThermoType>::Sh() const
false
),
this->mesh_,
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0)
)
);
if (this->chemistry_)
{
scalarField& Sh = tSh.ref();
scalarField& Qdot = tQdot.ref();
forAll(Y_, i)
{
forAll(Sh, celli)
forAll(Qdot, celli)
{
const scalar hi = specieThermo_[i].Hc();
Sh[celli] -= hi*RR_[i][celli];
Qdot[celli] -= hi*RR_[i][celli];
}
}
}
return tSh;
}
template<class CompType, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::chemistryModel<CompType, ThermoType>::dQ() const
{
tmp<volScalarField> tdQ
(
new volScalarField
(
IOobject
(
"dQ",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
)
);
if (this->chemistry_)
{
volScalarField& dQ = tdQ.ref();
dQ.ref() = this->mesh_.V()*Sh()();
}
return tdQ;
return tQdot;
}

View File

@ -231,11 +231,8 @@ public:
//- Return the chemical time scale
virtual tmp<volScalarField> tc() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Return the heat release, i.e. enthalpy/sec [kg/m2/s3]
virtual tmp<volScalarField> dQ() const;
//- Return the heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
// ODE functions (overriding abstract functions in ODE.H)

View File

@ -293,32 +293,32 @@ Foam::radiation::greyMeanAbsorptionEmission::ECont(const label bandI) const
)
);
if (mesh_.foundObject<volScalarField>("dQ"))
if (mesh_.foundObject<volScalarField>("Qdot"))
{
const volScalarField& dQ =
mesh_.lookupObject<volScalarField>("dQ");
const volScalarField& Qdot =
mesh_.lookupObject<volScalarField>("Qdot");
if (dQ.dimensions() == dimEnergy/dimTime)
if (Qdot.dimensions() == dimEnergy/dimTime)
{
E.ref().primitiveFieldRef() = EhrrCoeff_*dQ/mesh_.V();
E.ref().primitiveFieldRef() = EhrrCoeff_*Qdot/mesh_.V();
}
else if (dQ.dimensions() == dimEnergy/dimTime/dimVolume)
else if (Qdot.dimensions() == dimEnergy/dimTime/dimVolume)
{
E.ref().primitiveFieldRef() = EhrrCoeff_*dQ;
E.ref().primitiveFieldRef() = EhrrCoeff_*Qdot;
}
else
{
if (debug)
{
WarningInFunction
<< "Incompatible dimensions for dQ field" << endl;
<< "Incompatible dimensions for Qdot field" << endl;
}
}
}
else
{
WarningInFunction
<< "dQ field not found in mesh" << endl;
<< "Qdot field not found in mesh" << endl;
}
return E;

View File

@ -249,31 +249,32 @@ Foam::radiation::wideBandAbsorptionEmission::ECont(const label bandI) const
)
);
if (mesh().foundObject<volScalarField>("dQ"))
if (mesh().foundObject<volScalarField>("Qdot"))
{
const volScalarField& dQ = mesh().lookupObject<volScalarField>("dQ");
const volScalarField& Qdot =
mesh().lookupObject<volScalarField>("Qdot");
if (dQ.dimensions() == dimEnergy/dimTime)
if (Qdot.dimensions() == dimEnergy/dimTime)
{
E.ref().primitiveFieldRef() =
iEhrrCoeffs_[bandI]
*dQ.primitiveField()
*Qdot.primitiveField()
*(iBands_[bandI][1] - iBands_[bandI][0])
/totalWaveLength_
/mesh_.V();
}
else if (dQ.dimensions() == dimEnergy/dimTime/dimVolume)
else if (Qdot.dimensions() == dimEnergy/dimTime/dimVolume)
{
E.ref().primitiveFieldRef() =
iEhrrCoeffs_[bandI]
*dQ.primitiveField()
*Qdot.primitiveField()
*(iBands_[bandI][1] - iBands_[bandI][0])
/totalWaveLength_;
}
else
{
WarningInFunction
<< "Incompatible dimensions for dQ field" << endl;
<< "Incompatible dimensions for Qdot field" << endl;
}
}

View File

@ -114,15 +114,15 @@ Foam::solidChemistryModel<CompType, SolidThermo>::tc() const
template<class CompType, class SolidThermo>
Foam::tmp<Foam::volScalarField>
Foam::solidChemistryModel<CompType, SolidThermo>::Sh() const
Foam::solidChemistryModel<CompType, SolidThermo>::Qdot() const
{
tmp<volScalarField> tSh
tmp<volScalarField> tQdot
(
new volScalarField
(
IOobject
(
"Sh",
"Qdot",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
@ -130,57 +130,25 @@ Foam::solidChemistryModel<CompType, SolidThermo>::Sh() const
false
),
this->mesh_,
dimensionedScalar("zero", dimEnergy/dimTime/dimVolume, 0.0)
dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0)
)
);
if (this->chemistry_)
{
scalarField& Sh = tSh.ref();
scalarField& Qdot = tQdot.ref();
forAll(Ys_, i)
{
forAll(Sh, celli)
forAll(Qdot, celli)
{
scalar hf = solidThermo_[i].Hc();
Sh[celli] -= hf*RRs_[i][celli];
Qdot[celli] -= hf*RRs_[i][celli];
}
}
}
return tSh;
}
template<class CompType, class SolidThermo>
Foam::tmp<Foam::volScalarField>
Foam::solidChemistryModel<CompType, SolidThermo>::dQ() const
{
tmp<volScalarField> tdQ
(
new volScalarField
(
IOobject
(
"dQ",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
)
);
if (this->chemistry_)
{
volScalarField& dQ = tdQ.ref();
dQ.ref() = this->mesh_.V()*Sh()();
}
return tdQ;
return tQdot;
}

View File

@ -197,11 +197,8 @@ public:
//- Return the chemical time scale
virtual tmp<volScalarField> tc() const;
//- Return source for enthalpy equation [kg/m/s3]
virtual tmp<volScalarField> Sh() const;
//- Return the heat release, i.e. enthalpy/sec [m2/s3]
virtual tmp<volScalarField> dQ() const;
//- Return the heat release rate [kg/m/s3]
virtual tmp<volScalarField> Qdot() const;
// ODE functions (overriding abstract functions in ODE.H)