ENH: name change for tutorial and adding Schelkin effect
This commit is contained in:
parent
1654393724
commit
daa062e214
@ -50,8 +50,7 @@ Foam::XiEqModels::Gulder::Gulder
|
||||
:
|
||||
XiEqModel(XiEqProperties, thermo, turbulence, Su),
|
||||
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
|
||||
SuMin_(0.01*Su.average()),
|
||||
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef")))
|
||||
SuMin_(0.01*Su.average())
|
||||
{}
|
||||
|
||||
|
||||
@ -67,78 +66,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
|
||||
{
|
||||
volScalarField up(sqrt((2.0/3.0)*turbulence_.k()));
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
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));
|
||||
|
||||
up.internalField() += deltaUp;
|
||||
if (subGridSchelkin())
|
||||
{
|
||||
up.internalField() += calculateSchelkinEffect();
|
||||
}
|
||||
|
||||
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
|
||||
|
||||
@ -162,6 +94,7 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
|
||||
|
||||
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
|
||||
XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
|
||||
XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -61,9 +61,6 @@ class Gulder
|
||||
//- Minimum laminar burning velocity
|
||||
const dimensionedScalar SuMin_;
|
||||
|
||||
//- Model constant
|
||||
scalar uPrimeCoef_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
@ -84,6 +84,11 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
|
||||
const volScalarField& epsilon = turbulence_.epsilon();
|
||||
|
||||
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 Rl(up*l*thermo_.rhou()/thermo_.muu());
|
||||
|
||||
|
@ -58,9 +58,16 @@ class SCOPEXiEq
|
||||
{
|
||||
// Private data
|
||||
|
||||
// Model constant
|
||||
scalar XiEqCoef_;
|
||||
|
||||
// Model constant
|
||||
scalar XiEqExp_;
|
||||
|
||||
// Model constant
|
||||
scalar lCoef_;
|
||||
|
||||
//- Minimum Su
|
||||
dimensionedScalar SuMin_;
|
||||
|
||||
//- The SCOPE laminar flame speed model used to obtain the
|
||||
|
@ -77,6 +77,11 @@ Foam::XiEqModel::XiEqModel
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
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");
|
||||
|
||||
uPrimeCoef_ = XiEqModelCoeffs_.lookupOrDefault<scalar>("uPrimeCoef", 0.0);
|
||||
subGridSchelkin_ =
|
||||
XiEqModelCoeffs_.lookupOrDefault<bool>("subGridSchelkin", false);
|
||||
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
@ -62,14 +62,30 @@ protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Dictionary
|
||||
dictionary XiEqModelCoeffs_;
|
||||
|
||||
//- Thermo
|
||||
const hhuCombustionThermo& thermo_;
|
||||
|
||||
//- Turbulence
|
||||
const compressible::RASModel& turbulence_;
|
||||
|
||||
//- Laminar burning velocity
|
||||
const volScalarField& Su_;
|
||||
|
||||
//- Volumetric obstacles number
|
||||
volScalarField Nv_;
|
||||
|
||||
//
|
||||
volSymmTensorField nsv_;
|
||||
|
||||
//- Schelkin effect Model constant
|
||||
scalar uPrimeCoef_;
|
||||
|
||||
//- Use sub-grid Schelkin effect
|
||||
bool subGridSchelkin_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@ -146,6 +162,15 @@ public:
|
||||
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
|
||||
virtual bool read(const dictionary& XiEqProperties) = 0;
|
||||
|
||||
|
@ -49,25 +49,27 @@ instabilityCoeffs
|
||||
{
|
||||
XiEqModelL
|
||||
{
|
||||
XiEqModel Gulder;
|
||||
XiEqModel Gulder;
|
||||
uPrimeCoef 1.0;
|
||||
subGridSchelkin true;
|
||||
|
||||
GulderCoeffs
|
||||
{
|
||||
XiEqCoef 0.62;
|
||||
uPrimeCoef 1.0;
|
||||
XiEqCoef 0.62;
|
||||
}
|
||||
}
|
||||
|
||||
XiEqModelH
|
||||
{
|
||||
XiEqModel SCOPEXiEq;
|
||||
XiEqModel SCOPEXiEq;
|
||||
uPrimeCoef 1.0;
|
||||
subGridSchelkin true;
|
||||
|
||||
SCOPEXiEqCoeffs
|
||||
{
|
||||
XiEqCoef 1.6;
|
||||
XiEqExp 0.33333;
|
||||
lCoef 0.336;
|
||||
uPrimeCoef 1.0;
|
||||
SCOPEXiEqCoeffs
|
||||
{
|
||||
XiEqCoef 1.6;
|
||||
XiEqExp 0.33333;
|
||||
lCoef 0.336;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user