mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
resolve merge conflict
This commit is contained in:
@ -30,27 +30,7 @@ License
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::totalPressureFvPatchScalarField::calcBuoyancy() const
|
||||
{
|
||||
if (buoyancy_)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (db().foundObject<volScalarField>("pd"))
|
||||
{
|
||||
const volScalarField& pd = db().lookupObject<volScalarField>("pd");
|
||||
if (pd.dimensions() == dimPressure)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -66,7 +46,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
|
||||
rhoName_("none"),
|
||||
psiName_("none"),
|
||||
gamma_(0.0),
|
||||
buoyancy_(false),
|
||||
p0_(p.size(), 0.0)
|
||||
{}
|
||||
|
||||
@ -84,7 +63,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
|
||||
rhoName_(dict.lookupOrDefault<word>("rho", "none")),
|
||||
psiName_(dict.lookupOrDefault<word>("psi", "none")),
|
||||
gamma_(readScalar(dict.lookup("gamma"))),
|
||||
buoyancy_(dict.lookupOrDefault<Switch>("buoyancy", false)),
|
||||
p0_("p0", dict, p.size())
|
||||
{
|
||||
if (dict.found("value"))
|
||||
@ -115,7 +93,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
|
||||
rhoName_(ptf.rhoName_),
|
||||
psiName_(ptf.psiName_),
|
||||
gamma_(ptf.gamma_),
|
||||
buoyancy_(ptf.buoyancy_),
|
||||
p0_(ptf.p0_, mapper)
|
||||
{}
|
||||
|
||||
@ -131,7 +108,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
|
||||
rhoName_(tppsf.rhoName_),
|
||||
psiName_(tppsf.psiName_),
|
||||
gamma_(tppsf.gamma_),
|
||||
buoyancy_(tppsf.buoyancy_),
|
||||
p0_(tppsf.p0_)
|
||||
{}
|
||||
|
||||
@ -148,7 +124,6 @@ Foam::totalPressureFvPatchScalarField::totalPressureFvPatchScalarField
|
||||
rhoName_(tppsf.rhoName_),
|
||||
psiName_(tppsf.psiName_),
|
||||
gamma_(tppsf.gamma_),
|
||||
buoyancy_(tppsf.buoyancy_),
|
||||
p0_(tppsf.p0_)
|
||||
{}
|
||||
|
||||
@ -190,18 +165,9 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
|
||||
scalarField gh(patch().size(), 0.0);
|
||||
if (calcBuoyancy())
|
||||
{
|
||||
const dictionary& environmentalProperties =
|
||||
db().lookupObject<IOdictionary>("environmentalProperties");
|
||||
const dimensionedVector g = environmentalProperties.lookup("g");
|
||||
gh = g.value() & patch().Cf();
|
||||
}
|
||||
|
||||
if (psiName_ == "none" && rhoName_ == "none")
|
||||
{
|
||||
operator==(p0_ - 0.5*(1.0 - pos(phip))*magSqr(Up) - gh);
|
||||
operator==(p0_ - 0.5*(1.0 - pos(phip))*magSqr(Up));
|
||||
}
|
||||
else if (rhoName_ == "none")
|
||||
{
|
||||
@ -217,7 +183,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
|
||||
p0_
|
||||
/pow
|
||||
(
|
||||
(1.0 + psip*gM1ByG*0.5*(1.0 - pos(phip))*magSqr(Up)),
|
||||
(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up)),
|
||||
1.0/gM1ByG
|
||||
)
|
||||
);
|
||||
@ -232,7 +198,7 @@ void Foam::totalPressureFvPatchScalarField::updateCoeffs(const vectorField& Up)
|
||||
const fvPatchField<scalar>& rho =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
|
||||
operator==(p0_ - rho*(0.5*(1.0 - pos(phip))*magSqr(Up) + gh));
|
||||
operator==(p0_ - 0.5*rho*(1.0 - pos(phip))*magSqr(Up));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -268,7 +234,6 @@ void Foam::totalPressureFvPatchScalarField::write(Ostream& os) const
|
||||
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("buoyancy") << buoyancy_ << token::END_STATEMENT << nl;
|
||||
p0_.writeEntry("p0", os);
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
@ -37,7 +37,6 @@ SourceFiles
|
||||
#define totalPressureFvPatchScalarField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "Switch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -70,19 +69,10 @@ class totalPressureFvPatchScalarField
|
||||
//- Heat capacity ratio
|
||||
scalar gamma_;
|
||||
|
||||
//- Flag to include buoyancy effects (applying BC to pd)
|
||||
Switch buoyancy_;
|
||||
|
||||
//- Total pressure
|
||||
scalarField p0_;
|
||||
|
||||
|
||||
//- Private member functions
|
||||
|
||||
//- Helper function to determine whether to include buoyancy effects
|
||||
bool calcBuoyancy() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
|
||||
Reference in New Issue
Block a user