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

22 lines
649 B
C++
Raw Permalink Normal View History

2010-08-26 14:22:03 +00:00
Info<< "\nReading gravitationalProperties" << endl;
IOdictionary gravitationalProperties
(
IOobject
(
"gravitationalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
2010-08-26 14:22:03 +00:00
IOobject::NO_WRITE
)
);
const dimensionedVector g(gravitationalProperties.lookup("g"));
const Switch rotating(gravitationalProperties.lookup("rotating"));
const dimensionedVector Omega =
2010-09-21 14:32:04 +00:00
rotating ? dimensionedVector(gravitationalProperties.lookup("Omega"))
2010-08-26 14:22:03 +00:00
: dimensionedVector("Omega", -dimTime, vector(0,0,0));
const dimensionedScalar magg = mag(g);
const dimensionedVector gHat = g/magg;