Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2011-03-08 12:02:08 +00:00
65 changed files with 343 additions and 325 deletions

View File

@ -135,8 +135,8 @@ void PDRkEpsilon::correct()
volScalarField GR(drag.Gk()); volScalarField GR(drag.Gk());
volScalarField LI = volScalarField LI
C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL)); (C4_*(Lobs + dimensionedScalar("minLength", dimLength, VSMALL)));
// Dissipation equation // Dissipation equation
tmp<fvScalarMatrix> epsEqn tmp<fvScalarMatrix> epsEqn

View File

@ -50,8 +50,7 @@ Foam::XiEqModels::Gulder::Gulder
: :
XiEqModel(XiEqProperties, thermo, turbulence, Su), XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))), XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
SuMin_(0.01*Su.average()), SuMin_(0.01*Su.average())
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef")))
{} {}
@ -67,86 +66,18 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
{ {
volScalarField up(sqrt((2.0/3.0)*turbulence_.k())); volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
const volScalarField& epsilon = turbulence_.epsilon(); const volScalarField& epsilon = turbulence_.epsilon();
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U"); if (subGridSchelkin())
{
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT"); up.internalField() += calculateSchelkinEffect();
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv"); }
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
tmp<volScalarField> tN
(
new volScalarField
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
volScalarField& N = tN();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
tmp<volSymmTensorField> tns
(
new volSymmTensorField
(
IOobject
(
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor
(
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
)
)
);
volSymmTensorField& ns = tns();
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
);
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1e-4))));
const scalarField cellWidth(pow(mesh.V(), 1.0/3.0));
const scalarField upLocal(uPrimeCoef_*sqrt((U & CT & U)*cellWidth));
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
up.internalField() += deltaUp;
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon)))); volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
volScalarField Reta = volScalarField Reta
( (
up up
/ / (
(
sqrt(epsilon*tauEta) sqrt(epsilon*tauEta)
+ dimensionedScalar("1e-8", up.dimensions(), 1e-8) + dimensionedScalar("1e-8", up.dimensions(), 1e-8)
) )
@ -162,6 +93,7 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_; XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_; XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
return true; return true;
} }

View File

@ -61,9 +61,6 @@ class Gulder
//- Minimum laminar burning velocity //- Minimum laminar burning velocity
const dimensionedScalar SuMin_; const dimensionedScalar SuMin_;
//- Model constant
scalar uPrimeCoef_;
// Private Member Functions // Private Member Functions

View File

@ -84,6 +84,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
const volScalarField& epsilon = turbulence_.epsilon(); const volScalarField& epsilon = turbulence_.epsilon();
volScalarField up(sqrt((2.0/3.0)*k)); volScalarField up(sqrt((2.0/3.0)*k));
if (subGridSchelkin())
{
up.internalField() += calculateSchelkinEffect();
}
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon); volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu()); volScalarField Rl(up*l*thermo_.rhou()/thermo_.muu());

View File

@ -58,9 +58,16 @@ class SCOPEXiEq
{ {
// Private data // Private data
// Model constant
scalar XiEqCoef_; scalar XiEqCoef_;
// Model constant
scalar XiEqExp_; scalar XiEqExp_;
// Model constant
scalar lCoef_; scalar lCoef_;
//- Minimum Su
dimensionedScalar SuMin_; dimensionedScalar SuMin_;
//- The SCOPE laminar flame speed model used to obtain the //- The SCOPE laminar flame speed model used to obtain the

View File

@ -77,6 +77,11 @@ Foam::XiEqModel::XiEqModel
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
Su.mesh() Su.mesh()
),
uPrimeCoef_(XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0)),
subGridSchelkin_
(
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false)
) )
{} {}
@ -93,6 +98,10 @@ bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
{ {
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs"); XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
uPrimeCoef_ = XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0);
subGridSchelkin_ =
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false);
return true; return true;
} }
@ -109,4 +118,85 @@ void Foam::XiEqModel::writeFields() const
} }
} }
Foam::tmp<Foam::volScalarField>
Foam::XiEqModel::calculateSchelkinEffect() const
{
const fvMesh& mesh = Su_.mesh();
const volVectorField& U = mesh.lookupObject<volVectorField>("U");
const volSymmTensorField& CT = mesh.lookupObject<volSymmTensorField>("CT");
const volScalarField& Nv = mesh.lookupObject<volScalarField>("Nv");
const volSymmTensorField& nsv =
mesh.lookupObject<volSymmTensorField>("nsv");
tmp<volScalarField> tN
(
new volScalarField
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar("zero", Nv.dimensions(), 0.0),
zeroGradientFvPatchVectorField::typeName
)
);
volScalarField& N = tN();
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
tmp<volSymmTensorField> tns
(
new volSymmTensorField
(
IOobject
(
"tns",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedSymmTensor
(
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
)
)
);
volSymmTensorField& ns = tns();
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
const volVectorField Uhat
(
U/(mag(U) + dimensionedScalar("Usmall", U.dimensions(), 1e-4))
);
const volScalarField nr(sqrt(max(N - (Uhat & ns & Uhat), scalar(1e-4))));
const scalarField cellWidth(pow(mesh.V(), 1.0/3.0));
const scalarField upLocal(uPrimeCoef_*sqrt((U & CT & U)*cellWidth));
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
//Re use tN
N.internalField() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
return tN;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -62,14 +62,30 @@ protected:
// Protected data // Protected data
//- Dictionary
dictionary XiEqModelCoeffs_; dictionary XiEqModelCoeffs_;
//- Thermo
const hhuCombustionThermo& thermo_; const hhuCombustionThermo& thermo_;
//- Turbulence
const compressible::RASModel& turbulence_; const compressible::RASModel& turbulence_;
//- Laminar burning velocity
const volScalarField& Su_; const volScalarField& Su_;
//- Volumetric obstacles number
volScalarField Nv_; volScalarField Nv_;
//
volSymmTensorField nsv_; volSymmTensorField nsv_;
//- Schelkin effect Model constant
scalar uPrimeCoef_;
//- Use sub-grid Schelkin effect
bool subGridSchelkin_;
private: private:
@ -146,6 +162,15 @@ public:
return turbulence_.muEff(); return turbulence_.muEff();
} }
//- Return state of the sub-grid Schelkin effect
bool subGridSchelkin() const
{
return subGridSchelkin_;
}
//- Return the sub-grid Schelkin effect
tmp<volScalarField> calculateSchelkinEffect() const;
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& XiEqProperties) = 0; virtual bool read(const dictionary& XiEqProperties) = 0;

View File

@ -64,7 +64,7 @@ Foam::XiEqModels::instability::~instability()
Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const Foam::tmp<Foam::volScalarField> Foam::XiEqModels::instability::XiEq() const
{ {
volScalarField turbXiEq = XiEqModel_->XiEq(); volScalarField turbXiEq(XiEqModel_->XiEq());
return XiEqIn/turbXiEq + turbXiEq; return XiEqIn/turbXiEq + turbXiEq;
} }

View File

@ -73,9 +73,11 @@ class externalWallHeatFluxTemperatureFvPatchScalarField
public mixedFvPatchScalarField, public mixedFvPatchScalarField,
public temperatureCoupledBase public temperatureCoupledBase
{ {
// Private data public:
//- how to operate the BC // Public data
//- Operation mode enumeration
enum operationMode enum operationMode
{ {
fixedHeatFlux, fixedHeatFlux,
@ -84,6 +86,11 @@ class externalWallHeatFluxTemperatureFvPatchScalarField
}; };
static const NamedEnum<operationMode, 3> operationModeNames; static const NamedEnum<operationMode, 3> operationModeNames;
private:
// Private data
//- Operation mode //- Operation mode
operationMode oldMode_; operationMode oldMode_;

View File

@ -159,7 +159,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
const fvPatch& nbrPatch = const fvPatch& nbrPatch =
refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI]; refCast<const fvMesh>(nbrMesh).boundary()[samplePatchI];
scalarField Tc = patchInternalField(); scalarField Tc(patchInternalField());
scalarField& Tp = *this; scalarField& Tp = *this;
const turbulentTemperatureRadCoupledMixedFvPatchScalarField& const turbulentTemperatureRadCoupledMixedFvPatchScalarField&
@ -170,16 +170,16 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs()
); );
// Swap to obtain full local values of neighbour internal field // Swap to obtain full local values of neighbour internal field
scalarField TcNbr = nbrField.patchInternalField(); scalarField TcNbr(nbrField.patchInternalField());
mpp.map().distribute(TcNbr); mpp.map().distribute(TcNbr);
// Swap to obtain full local values of neighbour K*delta // Swap to obtain full local values of neighbour K*delta
scalarField KDeltaNbr = nbrField.K(TcNbr)*nbrPatch.deltaCoeffs(); scalarField KDeltaNbr(nbrField.K(TcNbr)*nbrPatch.deltaCoeffs());
mpp.map().distribute(KDeltaNbr); mpp.map().distribute(KDeltaNbr);
scalarField KDelta = K(*this)*patch().deltaCoeffs(); scalarField KDelta(K(*this)*patch().deltaCoeffs());
scalarField Qr(Tp.size(), 0.0); scalarField Qr(Tp.size(), 0.0);
if (QrName_ != "none") if (QrName_ != "none")

View File

@ -319,7 +319,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
Info<< "Pressure difference = " << valueDiff << endl; Info<< "Pressure difference = " << valueDiff << endl;
vectorField::subField Sfw = patch().patch().faceAreas(); vectorField::subField Sfw = patch().patch().faceAreas();
vectorField newSfw = (1 - openFraction_)*initWallSf_; vectorField newSfw((1 - openFraction_)*initWallSf_);
forAll(Sfw, facei) forAll(Sfw, facei)
{ {
Sfw[facei] = newSfw[facei]; Sfw[facei] = newSfw[facei];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -47,7 +47,7 @@ class fvMesh;
class polyBoundaryMesh; class polyBoundaryMesh;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class fvBoundaryMesh Declaration Class fvBoundaryMesh Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class fvBoundaryMesh class fvBoundaryMesh
@ -86,17 +86,10 @@ public:
// Constructors // Constructors
//- Construct with zero size //- Construct with zero size
fvBoundaryMesh fvBoundaryMesh(const fvMesh&);
(
const fvMesh&
);
//- Construct from polyBoundaryMesh //- Construct from polyBoundaryMesh
fvBoundaryMesh fvBoundaryMesh(const fvMesh&, const polyBoundaryMesh&);
(
const fvMesh&,
const polyBoundaryMesh&
);
// Member Functions // Member Functions
@ -120,6 +113,7 @@ public:
//- Correct patches after moving points //- Correct patches after moving points
void movePoints(); void movePoints();
// Member Operators // Member Operators
//- Return const and non-const reference to fvPatch by index. //- Return const and non-const reference to fvPatch by index.
@ -130,7 +124,6 @@ public:
//- Return reference to fvPatch by name. //- Return reference to fvPatch by name.
fvPatch& operator[](const word&); fvPatch& operator[](const word&);
}; };

View File

@ -44,8 +44,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
O2GlobalId_(owner.composition().globalCarrierId("O2")), O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0), WC_(0.0),
WO2_(0.0), WO2_(0.0)
HcCO2_(0.0)
{ {
// Determine Cs ids // Determine Cs ids
label idSolid = owner.composition().idSolid(); label idSolid = owner.composition().idSolid();
@ -55,7 +54,6 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
WO2_ = owner.thermo().carrier().W(O2GlobalId_); WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
if (Sb_ < 0) if (Sb_ < 0)
{ {
@ -89,8 +87,7 @@ Foam::COxidationDiffusionLimitedRate<CloudType>::COxidationDiffusionLimitedRate
O2GlobalId_(srm.O2GlobalId_), O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_), CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_), WC_(srm.WC_),
WO2_(srm.WO2_), WO2_(srm.WO2_)
HcCO2_(srm.HcCO2_)
{} {}
@ -160,12 +157,12 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate<CloudType>::calculate
dMassSRCarrier[O2GlobalId_] -= dmO2; dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[CO2GlobalId_] += dmCO2; dMassSRCarrier[CO2GlobalId_] += dmCO2;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
// Heat of reaction [J] // Heat of reaction [J]
// Sensible enthalpy contributions due to O2 depletion and CO2 generation return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
// handled by particle transfer terms
return dmC*HsC - dmCO2*HcCO2_;
} }

View File

@ -86,9 +86,6 @@ class COxidationDiffusionLimitedRate
//- Molecular weight of O2 [kg/kmol] //- Molecular weight of O2 [kg/kmol]
scalar WO2_; scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public: public:

View File

@ -45,8 +45,7 @@ COxidationKineticDiffusionLimitedRate
O2GlobalId_(owner.composition().globalCarrierId("O2")), O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0), WC_(0.0),
WO2_(0.0), WO2_(0.0)
HcCO2_(0.0)
{ {
// Determine Cs ids // Determine Cs ids
label idSolid = owner.composition().idSolid(); label idSolid = owner.composition().idSolid();
@ -56,7 +55,6 @@ COxidationKineticDiffusionLimitedRate
WO2_ = owner.thermo().carrier().W(O2GlobalId_); WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -80,8 +78,7 @@ COxidationKineticDiffusionLimitedRate
O2GlobalId_(srm.O2GlobalId_), O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_), CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_), WC_(srm.WC_),
WO2_(srm.WO2_), WO2_(srm.WO2_)
HcCO2_(srm.HcCO2_)
{} {}
@ -163,12 +160,12 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate<CloudType>::calculate
dMassSRCarrier[O2GlobalId_] -= dmO2; dMassSRCarrier[O2GlobalId_] -= dmO2;
dMassSRCarrier[CO2GlobalId_] += dmCO2; dMassSRCarrier[CO2GlobalId_] += dmCO2;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
// Heat of reaction [J] // Heat of reaction [J]
// Sensible enthalpy contributions due to O2 depletion and CO2 generation return dmC*HC + dmO2*HO2 - dmCO2*HCO2;
// handled by particle transfer terms
return dmC*HsC - dmCO2*HcCO2_;
} }

View File

@ -94,9 +94,6 @@ class COxidationKineticDiffusionLimitedRate
//- Molecular weight of O2 [kg/kmol] //- Molecular weight of O2 [kg/kmol]
scalar WO2_; scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public: public:

View File

@ -57,8 +57,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
O2GlobalId_(owner.composition().globalCarrierId("O2")), O2GlobalId_(owner.composition().globalCarrierId("O2")),
CO2GlobalId_(owner.composition().globalCarrierId("CO2")), CO2GlobalId_(owner.composition().globalCarrierId("CO2")),
WC_(0.0), WC_(0.0),
WO2_(0.0), WO2_(0.0)
HcCO2_(0.0)
{ {
// Determine Cs ids // Determine Cs ids
label idSolid = owner.composition().idSolid(); label idSolid = owner.composition().idSolid();
@ -68,7 +67,6 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
WO2_ = owner.thermo().carrier().W(O2GlobalId_); WO2_ = owner.thermo().carrier().W(O2GlobalId_);
const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_); const scalar WCO2 = owner.thermo().carrier().W(CO2GlobalId_);
WC_ = WCO2 - WO2_; WC_ = WCO2 - WO2_;
HcCO2_ = owner.thermo().carrier().Hc(CO2GlobalId_);
const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_];
const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid];
@ -95,8 +93,7 @@ Foam::COxidationMurphyShaddix<CloudType>::COxidationMurphyShaddix
O2GlobalId_(srm.O2GlobalId_), O2GlobalId_(srm.O2GlobalId_),
CO2GlobalId_(srm.CO2GlobalId_), CO2GlobalId_(srm.CO2GlobalId_),
WC_(srm.WC_), WC_(srm.WC_),
WO2_(srm.WO2_), WO2_(srm.WO2_)
HcCO2_(srm.HcCO2_)
{} {}
@ -223,12 +220,12 @@ Foam::scalar Foam::COxidationMurphyShaddix<CloudType>::calculate
// Add to particle mass transfer // Add to particle mass transfer
dMassSolid[CsLocalId_] += dOmega*WC_; dMassSolid[CsLocalId_] += dOmega*WC_;
const scalar HsC = thermo.solids().properties()[CsLocalId_].Hs(T); const scalar HC = thermo.solids().properties()[CsLocalId_].H(T);
const scalar HCO2 = thermo.carrier().H(CO2GlobalId_, T);
const scalar HO2 = thermo.carrier().H(O2GlobalId_, T);
// Heat of reaction [J] // Heat of reaction
// Sensible enthalpy contributions due to O2 depletion and CO2 generation return dOmega*(WC_*HC + WO2_*HO2 - (WC_ + WO2_)*HCO2);
// handled by particle transfer terms
return dOmega*(WC_*HsC - (WC_ + WO2_)*HcCO2_);
} }

View File

@ -115,9 +115,6 @@ class COxidationMurphyShaddix
//- Molecular weight of O2 [kg/kmol] //- Molecular weight of O2 [kg/kmol]
scalar WO2_; scalar WO2_;
//- Chemical enthalpy of CO2 [J/kg]
scalar HcCO2_;
public: public:

View File

@ -382,16 +382,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i); label gid = td.cloud().composition().localToGlobalCarrierId(GAS, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i]; td.cloud().rhoTrans(gid)[cellI] += np0*dMassGas[i];
td.cloud().hsTrans()[cellI] +=
np0*dMassGas[i]*td.cloud().composition().carrier().Hs(gid, T0);
} }
forAll(YLiquid_, i) forAll(YLiquid_, i)
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i); label gid = td.cloud().composition().localToGlobalCarrierId(LIQ, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i]; td.cloud().rhoTrans(gid)[cellI] += np0*dMassLiquid[i];
td.cloud().hsTrans()[cellI] +=
np0*dMassLiquid[i]
*td.cloud().composition().carrier().Hs(gid, T0);
} }
/* /*
// No mapping between solid components and carrier phase // No mapping between solid components and carrier phase
@ -399,17 +394,11 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i); label gid = td.cloud().composition().localToGlobalCarrierId(SLD, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i]; td.cloud().rhoTrans(gid)[cellI] += np0*dMassSolid[i];
td.cloud().hsTrans()[cellI] +=
np0*dMassSolid[i]
*td.cloud().composition().carrier().Hs(gid, T0);
} }
*/ */
forAll(dMassSRCarrier, i) forAll(dMassSRCarrier, i)
{ {
td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i]; td.cloud().rhoTrans(i)[cellI] += np0*dMassSRCarrier[i];
td.cloud().hsTrans()[cellI] +=
np0*dMassSRCarrier[i]
*td.cloud().composition().carrier().Hs(i, T0);
} }
// Update momentum transfer // Update momentum transfer

View File

@ -391,8 +391,6 @@ void Foam::ReactingParcel<ParcelType>::calc
{ {
label gid = td.cloud().composition().localToGlobalCarrierId(0, i); label gid = td.cloud().composition().localToGlobalCarrierId(0, i);
td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i]; td.cloud().rhoTrans(gid)[cellI] += np0*dMassPC[i];
td.cloud().hsTrans()[cellI] +=
np0*dMassPC[i]*td.cloud().composition().carrier().Hs(gid, T0);
} }
// Update momentum transfer // Update momentum transfer

View File

@ -170,7 +170,7 @@ void Foam::MarshakRadiationFvPatchScalarField::updateCoeffs()
const scalarField& gamma = const scalarField& gamma =
patch().lookupPatchField<volScalarField, scalar>("gammaRad"); patch().lookupPatchField<volScalarField, scalar>("gammaRad");
const scalarField Ep = emissivity()/(2.0*(2.0 - emissivity())); const scalarField Ep(emissivity()/(2.0*(2.0 - emissivity())));
// Set value fraction // Set value fraction
valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep); valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep);

View File

@ -171,7 +171,7 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::updateCoeffs()
const scalarField& gamma = const scalarField& gamma =
patch().lookupPatchField<volScalarField, scalar>("gammaRad"); patch().lookupPatchField<volScalarField, scalar>("gammaRad");
const scalarField Ep = emissivity()/(2.0*(scalar(2.0) - emissivity())); const scalarField Ep(emissivity()/(2.0*(scalar(2.0) - emissivity())));
// Set value fraction // Set value fraction
valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep); valueFraction() = 1.0/(1.0 + gamma*patch().deltaCoeffs()/Ep);

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 -1 0 0 0 0 0 ]; dimensions [ 0 -1 0 0 0 0 0 ];
internalField nonuniform List<scalar> internalField nonuniform List<scalar>
8025 8025
( (
18.372496 18.372496

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 0 0 0 0 0 0 ]; dimensions [ 0 0 0 0 0 0 0 ];
internalField nonuniform List<symmTensor> internalField nonuniform List<symmTensor>
8025 8025
( (
(1.785697 0 0 1.785697 0 1.875) (1.785697 0 0 1.785697 0 1.875)

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 -1 0 0 0 0 0 ]; dimensions [ 0 -1 0 0 0 0 0 ];
internalField nonuniform List<symmTensor> internalField nonuniform List<symmTensor>
8025 8025
( (
(98.997697 0 0 77.711245 0 30.754852) (98.997697 0 0 77.711245 0 30.754852)

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 -1 0 0 0 0 0 ]; dimensions [ 0 -1 0 0 0 0 0 ];
internalField nonuniform List<symmTensor> internalField nonuniform List<symmTensor>
8025 8025
( (
(4.501854 0 0 3.437531 0 1.537743) (4.501854 0 0 3.437531 0 1.537743)

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 1 0 0 0 0 0 ]; dimensions [ 0 1 0 0 0 0 0 ];
internalField nonuniform List<scalar> internalField nonuniform List<scalar>
8025 8025
( (
0.2 0.2

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 0 0 0 0 0 0 ]; dimensions [ 0 0 0 0 0 0 0 ];
internalField nonuniform List<scalar> internalField nonuniform List<scalar>
8025 8025
( (
2.019581 2.019581

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 0 0 0 0 0 0 ]; dimensions [ 0 0 0 0 0 0 0 ];
internalField nonuniform List<scalar> internalField nonuniform List<scalar>
8025 8025
( (
0 0

View File

@ -17,7 +17,7 @@ FoamFile
dimensions [ 0 0 0 0 0 0 0 ]; dimensions [ 0 0 0 0 0 0 0 ];
internalField nonuniform List<symmTensor> internalField nonuniform List<symmTensor>
8025 8025
( (
(0.634791 0 0 0.634791 0 0.03) (0.634791 0 0 0.634791 0 0.03)

View File

@ -14,5 +14,4 @@ runApplication PDRMesh
# Run # Run
runApplication PDRFoam runApplication PDRFoam
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -8,5 +8,4 @@ Step to introduce the PDR fields:
1) Create zero-size patches for wall or/and coupled baffles in 1) Create zero-size patches for wall or/and coupled baffles in
the boundary file. the boundary file.
2) Specify the boundary contitions for these patches in the fields. 2) Specify the boundary contitions for these patches in the fields.
3) Create the new PDR mesh using the PDRMesh utility 3) Create the new PDR mesh using the PDRMesh utility.

View File

@ -49,25 +49,27 @@ instabilityCoeffs
{ {
XiEqModelL XiEqModelL
{ {
XiEqModel Gulder; XiEqModel Gulder;
uPrimeCoef 1.0;
subGridSchelkin true;
GulderCoeffs GulderCoeffs
{ {
XiEqCoef 0.62; XiEqCoef 0.62;
uPrimeCoef 1.0;
} }
} }
XiEqModelH XiEqModelH
{ {
XiEqModel SCOPEXiEq; XiEqModel SCOPEXiEq;
uPrimeCoef 1.0;
subGridSchelkin true;
SCOPEXiEqCoeffs SCOPEXiEqCoeffs
{ {
XiEqCoef 1.6; XiEqCoef 1.6;
XiEqExp 0.33333; XiEqExp 0.33333;
lCoef 0.336; lCoef 0.336;
uPrimeCoef 1.0;
} }
} }
} }

View File

@ -59,6 +59,4 @@ burntProducts
Ts 170.672; Ts 170.672;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -51,5 +51,4 @@ maxCo 0.3;
maxDeltaT 1; maxDeltaT 1;
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,87 +1,85 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class dictionary;
location "system"; location "system";
object fvSchemes; object fvSchemes;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes ddtSchemes
{ {
default Euler; default Euler;
} }
gradSchemes gradSchemes
{ {
default Gauss linear; default Gauss linear;
grad(p) Gauss linear; grad(p) Gauss linear;
} }
divSchemes divSchemes
{ {
default none; default none;
div(phi,U) Gauss limitedLinearV 1; div(phi,U) Gauss limitedLinearV 1;
div(phiU,p) Gauss limitedLinear 1; div(phiU,p) Gauss limitedLinear 1;
div(phid,p) Gauss limitedLinear 1; div(phid,p) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1; div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1;
div(phiXi,Xi) Gauss limitedLinear 1; div(phiXi,Xi) Gauss limitedLinear 1;
div(phiSt,b) Gauss limitedLinear01 1; div(phiSt,b) Gauss limitedLinear01 1;
div(phi,ft_b_h_hu) Gauss multivariateSelection div(phi,ft_b_h_hu) Gauss multivariateSelection
{ {
ft limitedLinear01 1; ft limitedLinear01 1;
b limitedLinear01 1; b limitedLinear01 1;
Xi limitedLinear 1; Xi limitedLinear 1;
h limitedLinear 1; h limitedLinear 1;
hu limitedLinear 1; hu limitedLinear 1;
}; };
div((Su*grad(b))) Gauss linear; div((Su*grad(b))) Gauss linear;
div((U+((Su*Xi)*grad(b)))) Gauss linear; div((U+((Su*Xi)*grad(b)))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear; div((muEff*dev2(T(grad(U))))) Gauss linear;
div(U) Gauss linear; div(U) Gauss linear;
} }
laplacianSchemes laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear limited 0.333; laplacian(muEff,U) Gauss linear limited 0.333;
laplacian(DkEff,k) Gauss linear limited 0.333; laplacian(DkEff,k) Gauss linear limited 0.333;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333;
laplacian((rho*inv((((1)*A(U))+((((0.5*rho)*CR)*mag(U))+((((Csu*(1))*betav)*muEff)*sqr(Aw)))))),p) Gauss linear limited 0.333; laplacian((rho*inv((((1)*A(U))+((((0.5*rho)*CR)*mag(U))+((((Csu*(1))*betav)*muEff)*sqr(Aw)))))),p) Gauss linear limited 0.333;
laplacian(Db,b) Gauss linear limited 0.333; laplacian(Db,b) Gauss linear limited 0.333;
laplacian(Db,ft) Gauss linear limited 0.333; laplacian(Db,ft) Gauss linear limited 0.333;
laplacian(Db,h) Gauss linear limited 0.333; laplacian(Db,h) Gauss linear limited 0.333;
laplacian(Db,hu) Gauss linear limited 0.333; laplacian(Db,hu) Gauss linear limited 0.333;
} }
interpolationSchemes interpolationSchemes
{ {
default linear; default linear;
} }
snGradSchemes snGradSchemes
{ {
default limited 0.333; default limited 0.333;
} }
fluxRequired fluxRequired
{ {
default no; default no;
p; p;
} }
// ************************************************************************* //
// ************************************************************************* //

View File

@ -1,54 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev | | \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com | | \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class dictionary;
location "system"; location "system";
object fvSolution; object fvSolution;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
solvers {
{ rho
rho {
{ solver PCG;
solver PCG; preconditioner DIC;
preconditioner DIC; tolerance 1e-05;
tolerance 1e-05; relTol 0;
relTol 0; };
};
p
p {
{ solver PCG;
solver PCG; preconditioner DIC;
preconditioner DIC; tolerance 1e-6;
tolerance 1e-6; relTol 0;
relTol 0; };
};
"(U|ft|fu|b|Xi|Su|h|hu|R|k|epsilon)"
"(U|ft|fu|b|Xi|Su|h|hu|R|k|epsilon)" {
{ solver PBiCG;
solver PBiCG; preconditioner DILU;
preconditioner DILU; tolerance 1e-05;
tolerance 1e-05; relTol 0;
relTol 0; }
} }
}
PISO
PISO {
{ nCorrectors 2;
nCorrectors 2; nNonOrthogonalCorrectors 0;
nNonOrthogonalCorrectors 0; momentumPredictor true;
momentumPredictor true; }
}
// ************************************************************************* //
// ************************************************************************* //

View File

@ -15,7 +15,7 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application steadyReactingParcelFoam; application LTSReactingParcelFoam;
startFoam latestTime; startFoam latestTime;
@ -23,7 +23,7 @@ startTime 0;
stopAt endTime; stopAt endTime;
endTime 5000; endTime 300;
deltaT 1; deltaT 1;