mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
hRef: Define height in opposite direction to gravity
The reference height is now defined in the direction of -g, whether as previously it was defined in the direction cmptMag(g). This change makes the behaviour consistent when the case is transformed. For a "typical" case with g along one of the negative axes, this should make no difference. None of the tutorials are affected. Resolves bug report https://bugs.openfoam.org/view.php?id=2980
This commit is contained in:
@ -121,13 +121,7 @@ forAll(fluidRegions, i)
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar ghRef
|
||||
(
|
||||
mag(gFluid[i].value()) > small
|
||||
? gFluid[i]
|
||||
& (cmptMag(gFluid[i].value())/mag(gFluid[i].value()))*hRefFluid[i]
|
||||
: dimensionedScalar("ghRef", gFluid[i].dimensions()*dimLength, 0)
|
||||
);
|
||||
dimensionedScalar ghRef(- mag(gFluid[i])*hRefFluid[i]);
|
||||
|
||||
Info<< " Adding to ghFluid\n" << endl;
|
||||
ghFluid.set
|
||||
|
||||
@ -1,9 +1,4 @@
|
||||
Info<< "Calculating field g.h\n" << endl;
|
||||
dimensionedScalar ghRef
|
||||
(
|
||||
mag(g.value()) > small
|
||||
? g & (cmptMag(g.value())/mag(g.value()))*hRef
|
||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
||||
);
|
||||
dimensionedScalar ghRef(- mag(g)*hRef);
|
||||
volScalarField gh("gh", (g & mesh.C()) - ghRef);
|
||||
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
|
||||
|
||||
@ -118,12 +118,7 @@ updateCoeffs()
|
||||
const uniformDimensionedScalarField& hRef =
|
||||
this->db().template lookupObject<uniformDimensionedScalarField>("hRef");
|
||||
|
||||
dimensionedScalar ghRef
|
||||
(
|
||||
mag(g.value()) > small
|
||||
? g & (cmptMag(g.value())/mag(g.value()))*hRef
|
||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
||||
);
|
||||
const dimensionedScalar ghRef(- mag(g)*hRef);
|
||||
|
||||
this->operator==
|
||||
(
|
||||
|
||||
@ -140,12 +140,7 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs()
|
||||
const uniformDimensionedScalarField& hRef =
|
||||
db().lookupObject<uniformDimensionedScalarField>("hRef");
|
||||
|
||||
ghRef =
|
||||
(
|
||||
mag(g.value()) > small
|
||||
? (g & (cmptMag(g.value())/mag(g.value()))*hRef).value()
|
||||
: 0
|
||||
);
|
||||
ghRef = - mag(g.value())*hRef.value();
|
||||
}
|
||||
|
||||
operator==
|
||||
|
||||
@ -51,12 +51,7 @@ void Foam::fv::tabulatedAccelerationSource::addSup
|
||||
|
||||
g = g0_ - dimensionedVector("a", dimAcceleration, acceleration.x());
|
||||
|
||||
dimensionedScalar ghRef
|
||||
(
|
||||
mag(g.value()) > small
|
||||
? g & (cmptMag(g.value())/mag(g.value()))*hRef
|
||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
||||
);
|
||||
dimensionedScalar ghRef(- mag(g)*hRef);
|
||||
|
||||
mesh_.lookupObjectRef<volScalarField>("gh") = (g & mesh_.C()) - ghRef;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user