This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H
2010-09-21 15:32:04 +01:00

21 lines
637 B
C++

Info<< "\nReading gravitationalProperties" << endl;
IOdictionary gravitationalProperties
(
IOobject
(
"gravitationalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
const dimensionedVector g(gravitationalProperties.lookup("g"));
const Switch rotating(gravitationalProperties.lookup("rotating"));
const dimensionedVector Omega =
rotating ? dimensionedVector(gravitationalProperties.lookup("Omega"))
: dimensionedVector("Omega", -dimTime, vector(0,0,0));
const dimensionedScalar magg = mag(g);
const dimensionedVector gHat = g/magg;