Skip to content
Snippets Groups Projects
Commit afcd290d authored by Henry's avatar Henry
Browse files

Solvers based on p_rgh: Added support for optional hRef

Allows the specification of a reference height, for example the height
of the free-surface in a VoF simulation, which reduces the range of p_rgh.

hRef is a uniformDimensionedScalarField specified via the constant/hRef
file, equivalent to the way in which g is specified, so that it can be
looked-up from the database.  For example see the constant/hRef file in
the DTCHull LTSInterFoam and interDyMFoam cases.
parent 930d3d43
Branches
Tags
No related merge requests found
Showing
with 79 additions and 35 deletions
......@@ -101,10 +101,14 @@
volScalarField K("K", 0.5*magSqr(U));
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
surfaceScalarField ghf("ghf", g & mesh.Cf());
volScalarField p_rgh
(
......
......@@ -54,7 +54,6 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "createClouds.H"
......
......@@ -63,9 +63,14 @@ autoPtr<compressible::turbulenceModel> turbulence
reaction->setTurbulence(turbulence());
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
......
......@@ -48,7 +48,6 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
......
......@@ -63,7 +63,6 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createIncompressibleRadiationModel.H"
#include "createFvOptions.H"
......
......@@ -79,9 +79,15 @@
mesh
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
volScalarField p
(
......
......@@ -62,7 +62,6 @@ int main(int argc, char *argv[])
simpleControl simple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
......
......@@ -79,9 +79,15 @@
mesh
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
volScalarField p
(
......
......@@ -80,10 +80,15 @@
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
surfaceScalarField ghf("ghf", g & mesh.Cf());
volScalarField p_rgh
(
......
......@@ -52,7 +52,6 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "createClouds.H"
......
......@@ -56,7 +56,6 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "readGravitationalAcceleration.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
......@@ -98,8 +97,8 @@ int main(int argc, char *argv[])
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = g & mesh.C();
ghf = g & mesh.Cf();
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
}
if (mesh.changing() && correctPhi)
......
......@@ -53,7 +53,6 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
pimpleControl pimple(mesh);
......
......@@ -57,11 +57,22 @@
);
dimensionedScalar pMin(mixture.lookup("pMin"));
dimensionedScalar pMin
(
"pMin",
dimPressure,
mixture.lookup("pMin")
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
// Mass flux
// Initialisation does not matter because rhoPhi is reset after the
......
......@@ -48,7 +48,6 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
pimpleControl pimple(mesh);
......
......@@ -49,9 +49,14 @@
dimensionedScalar pMin(mixture.lookup("pMin"));
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
// Construct compressible turbulence model
autoPtr<compressible::turbulenceModel> turbulence
......
......@@ -90,9 +90,15 @@
::New(rho, U, rhoPhi, mixture)
);
Info<< "Calculating field (g.h)f\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
volScalarField p
(
......
......@@ -57,7 +57,6 @@ int main(int argc, char *argv[])
pimpleControl pimple(mesh);
#include "readGravitationalAcceleration.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
......
......@@ -77,10 +77,12 @@
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
volScalarField p
(
......
......@@ -110,8 +110,8 @@ int main(int argc, char *argv[])
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = g & mesh.C();
ghf = g & mesh.Cf();
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
}
if (mesh.changing() && correctPhi)
......
......@@ -79,10 +79,13 @@
incompressible::turbulenceModel::New(U, phi, mixture)
);
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
dimensionedScalar ghRef(g & (cmptMag(g.value())/mag(g.value()))*hRef);
volScalarField gh("gh", (g & mesh.C()) - ghRef);
surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);
volScalarField p
(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment