shallowWaterFoam: Read hU rather than U to support complex e.g. time-varying BCs

Disadvantage is that the BC values have to be specified in terms of hU
rather than U.  The alternative would be to add complex code to map h
and U BCs into the equivalent for hU.
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1566
This commit is contained in:
Henry
2015-03-13 22:14:08 +00:00
parent 3739559e75
commit e20e69992d
4 changed files with 461 additions and 55 deletions

View File

@ -26,12 +26,12 @@ volScalarField h0
dimensionedScalar("h0", dimLength, 0.0)
);
Info<< "Reading field U\n" << endl;
volVectorField U
Info<< "Creating field hU\n" << endl;
volVectorField hU
(
IOobject
(
"U",
"hU",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@ -40,17 +40,18 @@ volVectorField U
mesh
);
Info<< "Creating field hU\n" << endl;
volVectorField hU
Info<< "Reading field U\n" << endl;
volVectorField U
(
IOobject
(
"hU",
"U",
runTime.timeName(),
mesh
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
h*U,
U.boundaryField().types()
hU/h
);
Info<< "Creating field hTotal for post processing\n" << endl;
@ -68,7 +69,7 @@ volScalarField hTotal
);
hTotal.write();
#include "createPhi.H"
#include "createPhi.H"
Info<< "Creating Coriolis Force" << endl;
const dimensionedVector F("F", ((2.0*Omega) & gHat)*gHat);