entrainmentPressureFvPatchScalarField: Added support for mass-flux -> velocity conversion
so that the entrainmentPressure BC can be applied to compressible and multiphase cases.
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -82,17 +82,17 @@ Foam::dynamicPressureFvPatchScalarField::dynamicPressureFvPatchScalarField
|
|||||||
|
|
||||||
Foam::dynamicPressureFvPatchScalarField::dynamicPressureFvPatchScalarField
|
Foam::dynamicPressureFvPatchScalarField::dynamicPressureFvPatchScalarField
|
||||||
(
|
(
|
||||||
const dynamicPressureFvPatchScalarField& ptf,
|
const dynamicPressureFvPatchScalarField& psf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
fixedValueFvPatchScalarField(psf, p, iF, mapper),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(psf.rhoName_),
|
||||||
psiName_(ptf.psiName_),
|
psiName_(psf.psiName_),
|
||||||
gamma_(ptf.gamma_),
|
gamma_(psf.gamma_),
|
||||||
p0_(mapper(ptf.p0_))
|
p0_(mapper(psf.p0_))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -124,16 +124,16 @@ void Foam::dynamicPressureFvPatchScalarField::autoMap
|
|||||||
|
|
||||||
void Foam::dynamicPressureFvPatchScalarField::rmap
|
void Foam::dynamicPressureFvPatchScalarField::rmap
|
||||||
(
|
(
|
||||||
const fvPatchScalarField& ptf,
|
const fvPatchScalarField& psf,
|
||||||
const labelList& addr
|
const labelList& addr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
fixedValueFvPatchScalarField::rmap(ptf, addr);
|
fixedValueFvPatchScalarField::rmap(psf, addr);
|
||||||
|
|
||||||
const dynamicPressureFvPatchScalarField& tiptf =
|
const dynamicPressureFvPatchScalarField& dpsf =
|
||||||
refCast<const dynamicPressureFvPatchScalarField>(ptf);
|
refCast<const dynamicPressureFvPatchScalarField>(psf);
|
||||||
|
|
||||||
p0_.rmap(tiptf.p0_, addr);
|
p0_.rmap(dpsf.p0_, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ void Foam::dynamicPressureFvPatchScalarField::updateCoeffs
|
|||||||
|
|
||||||
if (gamma_ > 1)
|
if (gamma_ > 1)
|
||||||
{
|
{
|
||||||
scalar gM1ByG = (gamma_ - 1)/gamma_;
|
const scalar gM1ByG = (gamma_ - 1)/gamma_;
|
||||||
|
|
||||||
operator==(p0p/pow(scalar(1) + psip*gM1ByG*Kp, 1/gM1ByG));
|
operator==(p0p/pow(scalar(1) + psip*gM1ByG*Kp, 1/gM1ByG));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,12 +85,23 @@ entrainmentPressureFvPatchScalarField
|
|||||||
|
|
||||||
void Foam::entrainmentPressureFvPatchScalarField::updateCoeffs()
|
void Foam::entrainmentPressureFvPatchScalarField::updateCoeffs()
|
||||||
{
|
{
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
const fvsPatchField<scalar>& phip =
|
const fvsPatchField<scalar>& phip =
|
||||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|
||||||
const scalarField Unp(phip/patch().magSf());
|
scalarField Unp(phip/patch().magSf());
|
||||||
|
|
||||||
dynamicPressureFvPatchScalarField::updateCoeffs(p0_, - 0.5*Unp*mag(Unp));
|
if (phi.dimensions() == dimMassFlux)
|
||||||
|
{
|
||||||
|
const fvPatchField<scalar>& rhop =
|
||||||
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
|
|
||||||
|
Unp /= rhop;
|
||||||
|
}
|
||||||
|
|
||||||
|
dynamicPressureFvPatchScalarField::updateCoeffs(p0_, -0.5*Unp*mag(Unp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user