52 int main(
int argc,
char *argv[])
61 "Calculate the volume of the specified cellSet"
68 "Calculate the volume of the specified cellZone"
85 ccCells = ccCellSet.toc();
95 const scalar eps = 1.0e-10;
99 while (runTime.userTimeValue() > ca0)
105 if (
mag(runTime.userTimeValue() - ca0) > eps)
107 const scalar t0 = runTime.userTimeToTime(ca0 - runTime.userTimeValue());
108 runTime.setDeltaT(t0);
110 Info<<
"Moving to CA = " << runTime.userTimeValue() <<
endl;
115 Info <<
"Volume at " << runTime.userTimeValue() <<
"CA = " << V0 <<
endl;
117 if (
mag(runTime.userTimeValue()-ca1) > eps)
119 const scalar t1 = runTime.userTimeToTime(ca1 - runTime.userTimeValue());
120 runTime.setDeltaT(t1);
122 Info<<
"Moving to CA = " << runTime.userTimeValue() <<
endl;
127 Info <<
"Volume at " << runTime.userTimeValue() <<
"CA = " << V1 <<
endl;
129 const scalar Vmin(
min(V0, V1));
130 const scalar Vmax(
max(V0, V1));
132 Info<<
"\nCompression ratio = " << Vmax/Vmin <<
endl;
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
A collection of cell labels.
Named list of cell indices representing a sub-set of the mesh.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
bool move()
Move the mesh.
const cellZoneList & cellZones() const
Return cell zones.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
int main(int argc, char *argv[])
Type gSum(const FieldField< Field, Type > &f)
Ostream & endl(Ostream &os)
Add newline and flush stream.
void mag(LagrangianPatchField< scalar > &f, const LagrangianPatchField< Type > &f1)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
Foam::argList args(argc, argv)