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
|
dimensionedScalar ghRef(- mag(gFluid[i])*hRefFluid[i]);
|
||||||
(
|
|
||||||
mag(gFluid[i].value()) > small
|
|
||||||
? gFluid[i]
|
|
||||||
& (cmptMag(gFluid[i].value())/mag(gFluid[i].value()))*hRefFluid[i]
|
|
||||||
: dimensionedScalar("ghRef", gFluid[i].dimensions()*dimLength, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Adding to ghFluid\n" << endl;
|
Info<< " Adding to ghFluid\n" << endl;
|
||||||
ghFluid.set
|
ghFluid.set
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
Info<< "Calculating field g.h\n" << endl;
|
Info<< "Calculating field g.h\n" << endl;
|
||||||
dimensionedScalar ghRef
|
dimensionedScalar ghRef(- mag(g)*hRef);
|
||||||
(
|
|
||||||
mag(g.value()) > small
|
|
||||||
? g & (cmptMag(g.value())/mag(g.value()))*hRef
|
|
||||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
|
||||||
);
|
|
||||||
volScalarField gh("gh", (g & mesh.C()) - ghRef);
|
volScalarField gh("gh", (g & mesh.C()) - ghRef);
|
||||||
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
|
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
|
||||||
|
|||||||
@ -118,12 +118,7 @@ updateCoeffs()
|
|||||||
const uniformDimensionedScalarField& hRef =
|
const uniformDimensionedScalarField& hRef =
|
||||||
this->db().template lookupObject<uniformDimensionedScalarField>("hRef");
|
this->db().template lookupObject<uniformDimensionedScalarField>("hRef");
|
||||||
|
|
||||||
dimensionedScalar ghRef
|
const dimensionedScalar ghRef(- mag(g)*hRef);
|
||||||
(
|
|
||||||
mag(g.value()) > small
|
|
||||||
? g & (cmptMag(g.value())/mag(g.value()))*hRef
|
|
||||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
this->operator==
|
this->operator==
|
||||||
(
|
(
|
||||||
|
|||||||
@ -140,12 +140,7 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs()
|
|||||||
const uniformDimensionedScalarField& hRef =
|
const uniformDimensionedScalarField& hRef =
|
||||||
db().lookupObject<uniformDimensionedScalarField>("hRef");
|
db().lookupObject<uniformDimensionedScalarField>("hRef");
|
||||||
|
|
||||||
ghRef =
|
ghRef = - mag(g.value())*hRef.value();
|
||||||
(
|
|
||||||
mag(g.value()) > small
|
|
||||||
? (g & (cmptMag(g.value())/mag(g.value()))*hRef).value()
|
|
||||||
: 0
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
operator==
|
operator==
|
||||||
|
|||||||
@ -51,12 +51,7 @@ void Foam::fv::tabulatedAccelerationSource::addSup
|
|||||||
|
|
||||||
g = g0_ - dimensionedVector("a", dimAcceleration, acceleration.x());
|
g = g0_ - dimensionedVector("a", dimAcceleration, acceleration.x());
|
||||||
|
|
||||||
dimensionedScalar ghRef
|
dimensionedScalar ghRef(- mag(g)*hRef);
|
||||||
(
|
|
||||||
mag(g.value()) > small
|
|
||||||
? g & (cmptMag(g.value())/mag(g.value()))*hRef
|
|
||||||
: dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
|
|
||||||
);
|
|
||||||
|
|
||||||
mesh_.lookupObjectRef<volScalarField>("gh") = (g & mesh_.C()) - ghRef;
|
mesh_.lookupObjectRef<volScalarField>("gh") = (g & mesh_.C()) - ghRef;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user