Commit 7a624425 authored by Henry Weller's avatar Henry Weller
Browse files

utilities/postProcessing: Automate the selection of incompressible/compressible modes

parent 0b5082b8
......@@ -27,6 +27,10 @@ Application
Description
Calculates and writes the Reynolds stress R for the current time step.
Compressible modes is automatically selected based on the existence of the
"thermophysicalProperties" dictionary required to construct the
thermodynamics package.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
......@@ -108,22 +112,12 @@ void calcCompressibleR
int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "addRegionOption.H"
argList::addBoolOption
(
"compressible",
"calculate compressible R"
);
#include "setRootCase.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createNamedMesh.H"
const bool compressible = args.optionFound("compressible");
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
......@@ -143,7 +137,15 @@ int main(int argc, char *argv[])
Info<< "Reading field " << UHeader.name() << nl << endl;
volVectorField U(UHeader, mesh);
if (compressible)
if
(
IOobject
(
basicThermo::dictName,
runTime.constant(),
mesh
).headerOk()
)
{
calcCompressibleR(mesh, runTime, U);
}
......
......@@ -28,8 +28,9 @@ Description
Calculates and reports wall shear stress for all patches, for the
specified times when using RAS turbulence models.
Default behaviour assumes operating in incompressible mode.
Use the -compressible option for compressible RAS cases.
Compressible modes is automatically selected based on the existence of the
"thermophysicalProperties" dictionary required to construct the
thermodynamics package.
\*---------------------------------------------------------------------------*/
......@@ -128,22 +129,12 @@ void calcCompressible
int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "addRegionOption.H"
argList::addBoolOption
(
"compressible",
"calculate compressible wall shear stress"
);
#include "setRootCase.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
#include "createNamedMesh.H"
const bool compressible = args.optionFound("compressible");
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
......@@ -183,7 +174,15 @@ int main(int argc, char *argv[])
Info<< "Reading field U\n" << endl;
volVectorField U(UHeader, mesh);
if (compressible)
if
(
IOobject
(
basicThermo::dictName,
runTime.constant(),
mesh
).headerOk()
)
{
calcCompressible(mesh, runTime, U, wallShearStress);
}
......
......@@ -32,8 +32,9 @@ Description
the y+ values otherwise they are obtained directly from the near-wall
velocity gradient and effective and laminar viscosities.
Default behaviour assumes operating in incompressible mode.
Use the -compressible option for compressible cases.
Compressible modes is automatically selected based on the existence of the
"thermophysicalProperties" dictionary required to construct the
thermodynamics package.
\*---------------------------------------------------------------------------*/
......@@ -180,22 +181,12 @@ void calcCompressibleYPlus
int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "addRegionOption.H"
argList::addBoolOption
(
"compressible",
"calculate compressible y+"
);
#include "setRootCase.H"
#include "createTime.H"
instantList timeDirs = timeSelector::select(runTime, args, "yPlus");
#include "createNamedMesh.H"
const bool compressible = args.optionFound("compressible");
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
......@@ -230,7 +221,15 @@ int main(int argc, char *argv[])
Info<< "Reading field U\n" << endl;
volVectorField U(UHeader, mesh);
if (compressible)
if
(
IOobject
(
basicThermo::dictName,
runTime.constant(),
mesh
).headerOk()
)
{
calcCompressibleYPlus(mesh, runTime, U, yPlus);
}
......
Markdown is supported
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