mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adjust some utilities to use postCalc wrapper or timeSelector directly.
When required, also adjusted to use XXXApp.C for the source name. Adjusted some names in preparation for merge with master.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
polyDualMesh.C
|
||||
makePolyDualMesh.C
|
||||
polyDualMeshApp.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/polyDualMesh
|
||||
|
||||
@ -22,6 +22,9 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
polyDualMesh
|
||||
|
||||
Description
|
||||
Calculate the dual of a polyMesh. Adheres to all the feature&patch edges
|
||||
|
||||
@ -22,8 +22,11 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
foamFormatConvert
|
||||
|
||||
Description
|
||||
Converts all IOobjects associated with a case into the format specified
|
||||
Converts all IOobjects associated with a case into the format specified
|
||||
in the controlDict.
|
||||
|
||||
Mainly used to convert binary mesh/field files to ASCII.
|
||||
@ -31,6 +34,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "timeSelector.H"
|
||||
#include "Time.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
@ -47,22 +51,15 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addTimeOptions.H"
|
||||
|
||||
timeSelector::addOptions();
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll (timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
Info<< " Time = " << runTime.timeName() << endl;
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
// Convert all the standard mesh files
|
||||
writeMeshObject<cellIOList>("cells", runTime);
|
||||
@ -78,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const word& headerClassName = iter()->headerClassName();
|
||||
|
||||
if
|
||||
if
|
||||
(
|
||||
headerClassName == volScalarField::typeName
|
||||
|| headerClassName == volVectorField::typeName
|
||||
@ -116,7 +113,6 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1,128 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
magGrad
|
||||
|
||||
Description
|
||||
Calculates and writes the scalar magnitude of a scalar or vector field
|
||||
at each time
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validArgs.append("field");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
const word fieldName(args.additionalArgs()[0]);
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject header
|
||||
(
|
||||
fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (header.headerOk())
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
if (header.headerClassName() == volVectorField::typeName)
|
||||
{
|
||||
Info<< " Reading " << fieldName << endl;
|
||||
volVectorField U(header, mesh);
|
||||
|
||||
volScalarField magGrad
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magGrad" + fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(fvc::grad(U))
|
||||
);
|
||||
Info<< " Calculating " << magGrad.name() << endl;
|
||||
magGrad.write();
|
||||
}
|
||||
else if (header.headerClassName() == volScalarField::typeName)
|
||||
{
|
||||
Info<< " Reading " << fieldName << endl;
|
||||
volScalarField U(header, mesh);
|
||||
|
||||
volScalarField magGrad
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magGrad" + fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(fvc::grad(U))
|
||||
);
|
||||
Info<< " Calculating " << magGrad.name() << endl;
|
||||
magGrad.write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No " << fieldName << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,3 @@
|
||||
components.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/components
|
||||
@ -0,0 +1,147 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
Ucomponents
|
||||
|
||||
Description
|
||||
Writes scalar fields corresponding to each component of the supplied
|
||||
field (name).
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template <class Type>
|
||||
void writeComponents
|
||||
(
|
||||
const IOobject& header,
|
||||
const fvMesh& mesh,
|
||||
bool& processed
|
||||
)
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||
|
||||
if (header.headerClassName() == fieldType::typeName)
|
||||
{
|
||||
Info<< " Reading " << header.name() << endl;
|
||||
fieldType field(header, mesh);
|
||||
|
||||
for (direction i=0; i<Type::nComponents; i++)
|
||||
{
|
||||
Info<< " Calculating " << header.name()
|
||||
<< Type::componentNames[i] << endl;
|
||||
|
||||
volScalarField componentField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
header.name() + word(Type::componentNames[i]),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
field.component(i)
|
||||
);
|
||||
componentField.write();
|
||||
}
|
||||
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
argList::validArgs.append("field1 ... fieldN"); // abuse for usage
|
||||
|
||||
// setRootCase, but skip args check
|
||||
argList args(argc, argv, false);
|
||||
if (!args.checkRootCase())
|
||||
{
|
||||
Foam::FatalError.exit();
|
||||
}
|
||||
|
||||
const stringList& params = args.additionalArgs();
|
||||
|
||||
if (!params.size())
|
||||
{
|
||||
Info<< nl << "must specify one or more fields" << nl;
|
||||
args.printUsage();
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
# include "createTime.H"
|
||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
mesh.readUpdate();
|
||||
|
||||
forAll(params, paramI)
|
||||
{
|
||||
const word fieldName(params[paramI]);
|
||||
|
||||
IOobject fieldHeader
|
||||
(
|
||||
fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check field exists
|
||||
if (fieldHeader.headerOk())
|
||||
{
|
||||
bool processed = false;
|
||||
|
||||
writeComponents<vector>(fieldHeader, mesh, processed);
|
||||
writeComponents<sphericalTensor>(fieldHeader, mesh, processed);
|
||||
writeComponents<symmTensor>(fieldHeader, mesh, processed);
|
||||
writeComponents<tensor>(fieldHeader, mesh, processed);
|
||||
if (!processed)
|
||||
{
|
||||
FatalError
|
||||
<< "Unable to process " << fieldName << nl
|
||||
<< "No call to components for fields of type "
|
||||
<< fieldHeader.headerClassName() << nl << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No " << fieldName << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,3 @@
|
||||
mag.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/mag
|
||||
142
applications/utilities/postProcessing/field/mag/mag.C
Normal file
142
applications/utilities/postProcessing/field/mag/mag.C
Normal file
@ -0,0 +1,142 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
mag
|
||||
|
||||
Description
|
||||
Calculates and writes the scalar magnitude of a field
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
template<class Type>
|
||||
void writeMagField
|
||||
(
|
||||
const IOobject& header,
|
||||
const fvMesh& mesh,
|
||||
bool& processed
|
||||
)
|
||||
{
|
||||
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
|
||||
|
||||
if (header.headerClassName() == fieldType::typeName)
|
||||
{
|
||||
Info<< " Reading " << header.name() << endl;
|
||||
fieldType field(header, mesh);
|
||||
|
||||
Info<< " Calculating mag" << header.name() << endl;
|
||||
volScalarField magField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mag" + header.name(),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(field)
|
||||
);
|
||||
magField.write();
|
||||
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
argList::validArgs.append("field1 ... fieldN"); // abuse for usage
|
||||
|
||||
// setRootCase, but skip args check
|
||||
argList args(argc, argv, false);
|
||||
if (!args.checkRootCase())
|
||||
{
|
||||
Foam::FatalError.exit();
|
||||
}
|
||||
|
||||
const stringList& params = args.additionalArgs();
|
||||
|
||||
if (!params.size())
|
||||
{
|
||||
Info<< nl << "must specify one or more fields" << nl;
|
||||
args.printUsage();
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
mesh.readUpdate();
|
||||
|
||||
forAll(params, paramI)
|
||||
{
|
||||
const word fieldName(params[paramI]);
|
||||
|
||||
IOobject fieldHeader
|
||||
(
|
||||
fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check field exists
|
||||
if (fieldHeader.headerOk())
|
||||
{
|
||||
bool processed = false;
|
||||
|
||||
writeMagField<scalar>(fieldHeader, mesh, processed);
|
||||
writeMagField<vector>(fieldHeader, mesh, processed);
|
||||
writeMagField<sphericalTensor>(fieldHeader, mesh, processed);
|
||||
writeMagField<symmTensor>(fieldHeader, mesh, processed);
|
||||
writeMagField<tensor>(fieldHeader, mesh, processed);
|
||||
if (!processed)
|
||||
{
|
||||
FatalError
|
||||
<< "Unable to process " << fieldName << nl
|
||||
<< "No call to mag for fields of type "
|
||||
<< fieldHeader.headerClassName() << nl << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No " << fieldName << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
139
applications/utilities/postProcessing/field/magGrad/magGrad.C
Normal file
139
applications/utilities/postProcessing/field/magGrad/magGrad.C
Normal file
@ -0,0 +1,139 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
magGrad
|
||||
|
||||
Description
|
||||
Calculates and writes the scalar magnitude of a scalar or vector field
|
||||
at each time
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
argList::validArgs.append("field1 ... fieldN"); // abuse for usage
|
||||
|
||||
// setRootCase, but skip args check
|
||||
argList args(argc, argv, false);
|
||||
if (!args.checkRootCase())
|
||||
{
|
||||
Foam::FatalError.exit();
|
||||
}
|
||||
|
||||
const stringList& params = args.additionalArgs();
|
||||
|
||||
if (!params.size())
|
||||
{
|
||||
Info<< nl << "must specify one or more fields" << nl;
|
||||
args.printUsage();
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
# include "createTime.H"
|
||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
mesh.readUpdate();
|
||||
|
||||
forAll(params, paramI)
|
||||
{
|
||||
const word fieldName(params[paramI]);
|
||||
|
||||
IOobject header
|
||||
(
|
||||
fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check field exists
|
||||
if (header.headerOk())
|
||||
{
|
||||
if (header.headerClassName() == volScalarField::typeName)
|
||||
{
|
||||
Info<< " Reading " << fieldName << " ...";
|
||||
volScalarField field(header, mesh);
|
||||
|
||||
volScalarField magGrad
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magGrad" + fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(fvc::grad(field))
|
||||
);
|
||||
Info<< "Writing " << magGrad.name() << endl;
|
||||
magGrad.write();
|
||||
}
|
||||
else if (header.headerClassName() == volVectorField::typeName)
|
||||
{
|
||||
Info<< " Reading " << fieldName << " ...";
|
||||
volVectorField field(header, mesh);
|
||||
|
||||
volScalarField magGrad
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magGrad" + fieldName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(fvc::grad(field))
|
||||
);
|
||||
Info<< "Writing " << magGrad.name() << endl;
|
||||
magGrad.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " Skipping " << fieldName << " : type "
|
||||
<< header.headerClassName() << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No " << fieldName << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -37,31 +37,20 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
argList::validArgs.append("fieldName");
|
||||
argList::validArgs.append("patchName");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
word fieldName(args.additionalArgs()[0]);
|
||||
word patchName(args.additionalArgs()[1]);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject fieldHeader
|
||||
@ -77,21 +66,40 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading field " << fieldName << endl;
|
||||
volScalarField field(fieldHeader, mesh);
|
||||
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
if (patchi >= 0)
|
||||
if (patchi < 0)
|
||||
{
|
||||
FatalError
|
||||
<< "Unable to find patch " << patchName << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (fieldHeader.headerClassName() == "volScalarField")
|
||||
{
|
||||
Info<< " Reading volScalarField " << fieldName << endl;
|
||||
volScalarField field(fieldHeader, mesh);
|
||||
|
||||
scalar area = sum(mesh.magSf().boundaryField()[patchi]);
|
||||
scalar sumField = 0;
|
||||
|
||||
if (area > 0)
|
||||
{
|
||||
sumField = sum
|
||||
(
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
* field.boundaryField()[patchi]
|
||||
) / area;
|
||||
}
|
||||
|
||||
Info<< " Average of " << fieldName << " over patch "
|
||||
<< patchName << '[' << patchi << ']' << " = "
|
||||
<< sum
|
||||
(
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
*field.boundaryField()[patchi]
|
||||
)/sum(mesh.magSf().boundaryField()[patchi])
|
||||
<< endl;
|
||||
<< sumField << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalError
|
||||
<< "Only possible to average volScalarFields "
|
||||
<< nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -104,8 +112,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -37,31 +37,20 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeSelector::addOptions();
|
||||
argList::validArgs.append("fieldName");
|
||||
argList::validArgs.append("patchName");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
word fieldName(args.additionalArgs()[0]);
|
||||
word patchName(args.additionalArgs()[1]);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject fieldHeader
|
||||
@ -77,21 +66,43 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading field " << fieldName << endl;
|
||||
volScalarField field(fieldHeader, mesh);
|
||||
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
if (patchi >= 0)
|
||||
if (patchi < 0)
|
||||
{
|
||||
FatalError
|
||||
<< "Unable to find patch " << patchName << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (fieldHeader.headerClassName() == "volScalarField")
|
||||
{
|
||||
Info<< " Reading volScalarField " << fieldName << endl;
|
||||
volScalarField field(fieldHeader, mesh);
|
||||
vector sumField = sum
|
||||
(
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
* field.boundaryField()[patchi]
|
||||
);
|
||||
|
||||
Info<< " Integral of " << fieldName << " over patch "
|
||||
<< patchName << '[' << patchi << ']' << " = "
|
||||
<< sum
|
||||
(
|
||||
mesh.Sf().boundaryField()[patchi]
|
||||
*field.boundaryField()[patchi]
|
||||
)
|
||||
<< endl;
|
||||
<< sumField << nl;
|
||||
}
|
||||
else if (fieldHeader.headerClassName() == "surfaceScalarField")
|
||||
{
|
||||
Info<< " Reading surfaceScalarField " << fieldName << endl;
|
||||
surfaceScalarField field(fieldHeader, mesh);
|
||||
scalar sumField = sum(field.boundaryField()[patchi]);
|
||||
|
||||
Info<< " Integral of " << fieldName << " over patch "
|
||||
<< patchName << '[' << patchi << ']' << " = "
|
||||
<< sumField << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalError
|
||||
<< "Only possible to integrate volScalarFields "
|
||||
<< "and surfaceScalarFields" << nl << exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -104,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "timeSelector.H"
|
||||
#include "IOprobes.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -37,27 +38,17 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
timeSelector::addOptions();
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
IOprobes sniff(mesh, "probesDict", true);
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
// Handle geometry/topology changes
|
||||
@ -77,7 +68,6 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -83,6 +83,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
#include "timeSelector.H"
|
||||
#include "IOsampledSets.H"
|
||||
#include "IOsampledSurfaces.H"
|
||||
|
||||
@ -93,28 +94,18 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
timeSelector::addOptions();
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
IOsampledSets sSets(mesh, "sampleDict", true);
|
||||
IOsampledSurfaces sSurfaces(mesh, "sampleDict", true);
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
// Handle geometry/topology changes
|
||||
@ -129,7 +120,6 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
||||
@ -108,6 +108,9 @@ sets
|
||||
// Surface sampling definition: choice of
|
||||
// plane : values on plane defined by point, normal.
|
||||
// patch : values on patch.
|
||||
//
|
||||
// 1] planes are triangulated by default
|
||||
// 2] patches are not triangulated by default
|
||||
surfaces
|
||||
(
|
||||
constantPlane
|
||||
@ -141,15 +144,15 @@ surfaces
|
||||
{
|
||||
type patch;
|
||||
patchName movingWall;
|
||||
triangulate false;
|
||||
// Optional: whether to leave as faces (=default) or triangulate
|
||||
}
|
||||
|
||||
movingWall_interpolated
|
||||
{
|
||||
type patch;
|
||||
patchName movingWall;
|
||||
triangulate false;
|
||||
interpolate true;
|
||||
// Optional: whether to leave as faces (=default) or triangulate
|
||||
}
|
||||
|
||||
/* not yet (re)implemented --
|
||||
|
||||
@ -26,60 +26,56 @@ Application
|
||||
Co
|
||||
|
||||
Description
|
||||
Calculates and writes the Co number as a surfaceScalarField obtained from
|
||||
field phi for each time
|
||||
Calculates and writes the Co number as a surfaceScalarField obtained
|
||||
from field phi.
|
||||
The -noWrite option just outputs the max values without writing the
|
||||
field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject phiHeader
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (phiHeader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
autoPtr<surfaceScalarField> CoPtr;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< " Reading phi" << endl;
|
||||
surfaceScalarField phi(phiHeader, mesh);
|
||||
Info<< " Calculating Co" << endl;
|
||||
|
||||
IOobject phiHeader
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (phiHeader.headerOk())
|
||||
if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||
{
|
||||
mesh.readUpdate();
|
||||
// compressible
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
Info<< " Reading phi" << endl;
|
||||
surfaceScalarField phi(phiHeader, mesh);
|
||||
|
||||
Info<< " Calculating Co" << endl;
|
||||
|
||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||
{
|
||||
surfaceScalarField Co
|
||||
CoPtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -88,30 +84,20 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*(mag(phi)/mesh.magSf())
|
||||
*runTime.deltaT()
|
||||
);
|
||||
|
||||
Info << " Max Co = " << max(Co).value() << endl;
|
||||
|
||||
Co.write();
|
||||
}
|
||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||
{
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
surfaceScalarField Co
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* (mag(phi)/(fvc::interpolate(rho)*mesh.magSf()))
|
||||
* runTime.deltaT()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||
{
|
||||
// incompressible
|
||||
CoPtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -120,34 +106,32 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*(mag(phi)/(fvc::interpolate(rho)*mesh.magSf()))
|
||||
*runTime.deltaT()
|
||||
);
|
||||
|
||||
Info << " Max Co = " << max(Co).value() << endl;
|
||||
|
||||
Co.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
(
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* (mag(phi)/mesh.magSf())
|
||||
* runTime.deltaT()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No phi" << endl;
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
Info<< "Co max : " << max(CoPtr()).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
CoPtr().write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No phi" << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,81 +26,58 @@ Application
|
||||
Lambda2
|
||||
|
||||
Description
|
||||
Calculates and writes the second largest eigenvalue of the sum of the
|
||||
square of the symmetrical and anti-symmetrical parts of the velocity
|
||||
gradient tensor, for each time.
|
||||
Calculates and writes the second largest eigenvalue of the sum of the
|
||||
square of the symmetrical and anti-symmetrical parts of the velocity
|
||||
gradient tensor.
|
||||
The -noWrite option has no meaning.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "tensorField.H"
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
const volTensorField gradU(fvc::grad(U));
|
||||
|
||||
IOobject Uheader
|
||||
volTensorField SSplusWW =
|
||||
(symm(gradU) & symm(gradU)) + (skew(gradU) & skew(gradU));
|
||||
|
||||
volScalarField Lambda2
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"Lambda2",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
-eigenValues(SSplusWW)().component(vector::Y)
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
const volTensorField gradU(fvc::grad(U));
|
||||
|
||||
volTensorField SSplusWW =
|
||||
(symm(gradU) & symm(gradU)) + (skew(gradU) & skew(gradU));
|
||||
|
||||
volScalarField Lambda2
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Lambda2",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
-eigenValues(SSplusWW)().component(vector::Y)
|
||||
);
|
||||
|
||||
Info << " Writing -Lambda2" << endl;
|
||||
Lambda2.write();
|
||||
}
|
||||
Info << " Writing -Lambda2" << endl;
|
||||
Lambda2.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,44 +26,114 @@ Application
|
||||
Mach
|
||||
|
||||
Description
|
||||
Calculates and writes the local Mach number from the velocity field U at
|
||||
each time
|
||||
Calculates and optionally writes the local Mach number from the velocity
|
||||
field U at each time. The -nowrite option just outputs the max value
|
||||
without writing the field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "calc.H"
|
||||
#include "basicThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
IOobject Theader
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
if (file(runTime.constantPath()/"thermophysicalProperties"))
|
||||
// Check U and T exists
|
||||
if (Uheader.headerOk() && Theader.headerOk())
|
||||
{
|
||||
# include "thermophysicalMach.H"
|
||||
autoPtr<volScalarField> MachPtr;
|
||||
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
if (file(runTime.constantPath()/"thermophysicalProperties"))
|
||||
{
|
||||
// thermophysical Mach
|
||||
autoPtr<basicThermo> thermo
|
||||
(
|
||||
basicThermo::New(mesh)
|
||||
);
|
||||
|
||||
volScalarField Cp = thermo->Cp();
|
||||
volScalarField Cv = thermo->Cv();
|
||||
|
||||
MachPtr.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Ma",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mag(U)/(sqrt((Cp/Cv)*(Cp - Cv)*thermo->T()))
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// thermodynamic Mach
|
||||
IOdictionary thermoProps
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"thermodynamicProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar R(thermoProps.lookup("R"));
|
||||
dimensionedScalar Cv(thermoProps.lookup("Cv"));
|
||||
|
||||
volScalarField T(Theader, mesh);
|
||||
|
||||
MachPtr.set
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Ma",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mag(U)/(sqrt(((Cv + R)/Cv)*R*T))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Info<< "Mach max : " << max(MachPtr()).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
MachPtr().write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# include "thermodynamicMach.H"
|
||||
Info<< " Missing U or T" << endl;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie \
|
||||
-lmeshTools \
|
||||
|
||||
-lspecie
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
@ -9,6 +10,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lincompressibleTransportModels \
|
||||
|
||||
@ -27,106 +27,87 @@ Application
|
||||
|
||||
Description
|
||||
Calculates and writes the Pe number as a surfaceScalarField obtained from
|
||||
field phi for each time
|
||||
field phi.
|
||||
The -noWrite option just outputs the max/min values without writing
|
||||
the field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
||||
|
||||
#include "incompressible/turbulenceModel/turbulenceModel.H"
|
||||
#include "incompressible/LESmodel/LESmodel.H"
|
||||
|
||||
#include "basicThermo.H"
|
||||
#include "compressible/turbulenceModel/turbulenceModel.H"
|
||||
#include "compressible/LESmodel/LESmodel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject phiHeader
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (phiHeader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
autoPtr<surfaceScalarField> PePtr;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
Info<< " Reading phi" << endl;
|
||||
surfaceScalarField phi(phiHeader, mesh);
|
||||
|
||||
IOobject phiHeader
|
||||
volVectorField U
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// Check phi exists
|
||||
if (phiHeader.headerOk())
|
||||
Info<< " Calculating Pe" << endl;
|
||||
|
||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading phi" << endl;
|
||||
surfaceScalarField phi(phiHeader, mesh);
|
||||
|
||||
volVectorField U
|
||||
IOobject turbulencePropertiesHeader
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
|
||||
Info<< " Calculating Pe" << endl;
|
||||
|
||||
if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
|
||||
if (turbulencePropertiesHeader.headerOk())
|
||||
{
|
||||
IOobject turbulencePropertiesHeader
|
||||
IOdictionary turbulenceProperties
|
||||
(
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
turbulencePropertiesHeader
|
||||
);
|
||||
|
||||
if (turbulencePropertiesHeader.headerOk())
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
if (turbulenceProperties.found("turbulenceModel"))
|
||||
{
|
||||
IOdictionary turbulenceProperties
|
||||
autoPtr<turbulenceModel> turbulenceModel
|
||||
(
|
||||
turbulencePropertiesHeader
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
if (turbulenceProperties.found("turbulenceModel"))
|
||||
{
|
||||
autoPtr<turbulenceModel> turbulenceModel
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
surfaceScalarField Pe
|
||||
PePtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -135,24 +116,25 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(phi)
|
||||
/(
|
||||
mag(phi) /
|
||||
(
|
||||
mesh.magSf()
|
||||
*mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*fvc::interpolate(turbulenceModel->nuEff())
|
||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* fvc::interpolate(turbulenceModel->nuEff())
|
||||
)
|
||||
);
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (turbulenceProperties.found("LESmodel"))
|
||||
{
|
||||
autoPtr<LESmodel> sgsModel
|
||||
(
|
||||
LESmodel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
Pe.write();
|
||||
}
|
||||
else if (turbulenceProperties.found("LESmodel"))
|
||||
{
|
||||
autoPtr<LESmodel> sgsModel
|
||||
(
|
||||
LESmodel::New(U, phi, laminarTransport)
|
||||
);
|
||||
|
||||
surfaceScalarField Pe
|
||||
PePtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -161,232 +143,235 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(phi)
|
||||
/(
|
||||
mag(phi) /
|
||||
(
|
||||
mesh.magSf()
|
||||
*mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*fvc::interpolate(sgsModel->nuEff())
|
||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* fvc::interpolate(sgsModel->nuEff())
|
||||
)
|
||||
);
|
||||
|
||||
Info << " Max Pe = " << max(Pe).value() << endl;
|
||||
|
||||
/*
|
||||
label count = 0;
|
||||
forAll(Pe, i)
|
||||
{
|
||||
if (Pe[i] > 200) count++;
|
||||
}
|
||||
|
||||
Info<< "Fraction > 200 = "
|
||||
<< scalar(count)/Pe.size() << endl;
|
||||
*/
|
||||
|
||||
Pe.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot find turbulence model type in"
|
||||
"turbulenceModel dictionary"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar nu
|
||||
(
|
||||
transportProperties.lookup("nu")
|
||||
);
|
||||
|
||||
surfaceScalarField Pe
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*(mag(phi)/mesh.magSf())*(runTime.deltaT()/nu)
|
||||
);
|
||||
|
||||
Info << " Max Pe = " << max(Pe).value() << endl;
|
||||
|
||||
Pe.write();
|
||||
}
|
||||
}
|
||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||
{
|
||||
IOobject turbulencePropertiesHeader
|
||||
(
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (turbulencePropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary turbulenceProperties
|
||||
(
|
||||
turbulencePropertiesHeader
|
||||
);
|
||||
|
||||
autoPtr<basicThermo> thermo
|
||||
(
|
||||
basicThermo::New(mesh)
|
||||
);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
thermo->rho()
|
||||
);
|
||||
|
||||
if (turbulenceProperties.found("turbulenceModel"))
|
||||
{
|
||||
autoPtr<compressible::turbulenceModel> turbulenceModel
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
|
||||
surfaceScalarField Pe
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(phi)
|
||||
/(
|
||||
mesh.magSf()
|
||||
*mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*fvc::interpolate(turbulenceModel->muEff())
|
||||
)
|
||||
);
|
||||
|
||||
Pe.write();
|
||||
}
|
||||
else if (turbulenceProperties.found("LESmodel"))
|
||||
{
|
||||
autoPtr<compressible::LESmodel> sgsModel
|
||||
(
|
||||
compressible::LESmodel::New(rho, U, phi, thermo())
|
||||
);
|
||||
|
||||
surfaceScalarField Pe
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(phi)
|
||||
/(
|
||||
mesh.magSf()
|
||||
*mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*fvc::interpolate(sgsModel->muEff())
|
||||
)
|
||||
);
|
||||
|
||||
Info << " Max Pe = " << max(Pe).value() << endl;
|
||||
|
||||
Pe.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot find turbulence model type in"
|
||||
"turbulenceModel dictionary"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar mu
|
||||
(
|
||||
transportProperties.lookup("mu")
|
||||
);
|
||||
|
||||
surfaceScalarField Pe
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
*(mag(phi)/(mesh.magSf()))*(runTime.deltaT()/mu)
|
||||
);
|
||||
|
||||
Info << " Max Pe = " << max(Pe).value() << endl;
|
||||
|
||||
Pe.write();
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot find turbulence model type in "
|
||||
"turbulenceModel dictionary"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||
<< abort(FatalError);
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar nu
|
||||
(
|
||||
transportProperties.lookup("nu")
|
||||
);
|
||||
|
||||
PePtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* (mag(phi)/mesh.magSf())*(runTime.deltaT()/nu)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
|
||||
{
|
||||
IOobject turbulencePropertiesHeader
|
||||
(
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (turbulencePropertiesHeader.headerOk())
|
||||
{
|
||||
IOdictionary turbulenceProperties
|
||||
(
|
||||
turbulencePropertiesHeader
|
||||
);
|
||||
|
||||
autoPtr<basicThermo> thermo
|
||||
(
|
||||
basicThermo::New(mesh)
|
||||
);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
thermo->rho()
|
||||
);
|
||||
|
||||
if (turbulenceProperties.found("turbulenceModel"))
|
||||
{
|
||||
autoPtr<compressible::turbulenceModel> turbulenceModel
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
|
||||
PePtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(phi) /
|
||||
(
|
||||
mesh.magSf()
|
||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* fvc::interpolate(turbulenceModel->muEff())
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else if (turbulenceProperties.found("LESmodel"))
|
||||
{
|
||||
autoPtr<compressible::LESmodel> sgsModel
|
||||
(
|
||||
compressible::LESmodel::New(rho, U, phi, thermo())
|
||||
);
|
||||
|
||||
PePtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(phi) /
|
||||
(
|
||||
mesh.magSf()
|
||||
* mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* fvc::interpolate(sgsModel->muEff())
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot find turbulence model type in"
|
||||
"turbulenceModel dictionary"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar mu
|
||||
(
|
||||
transportProperties.lookup("mu")
|
||||
);
|
||||
|
||||
PePtr.set
|
||||
(
|
||||
new surfaceScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Pe",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh.surfaceInterpolation::deltaCoeffs()
|
||||
* (mag(phi)/(mesh.magSf()))*(runTime.deltaT()/mu)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No phi" << endl;
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Incorrect dimensions of phi: " << phi.dimensions()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
|
||||
// can also check how many cells exceed a particular Pe limit
|
||||
/*
|
||||
{
|
||||
label count = 0;
|
||||
label PeLimit = 200;
|
||||
forAll(PePtr(), i)
|
||||
{
|
||||
if (PePtr()[i] > PeLimit)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Info<< "Fraction > " << PeLimit << " = "
|
||||
<< scalar(count)/Pe.size() << endl;
|
||||
}
|
||||
*/
|
||||
|
||||
Info << "Pe max : " << max(PePtr()).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
PePtr().write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No phi" << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,101 +26,85 @@ Application
|
||||
Q
|
||||
|
||||
Description
|
||||
Calculates and writes the second invariant of the velocity gradient tensor
|
||||
for each time.
|
||||
Calculates and writes the second invariant of the velocity gradient tensor.
|
||||
The -noWrite option just outputs the max/min values without writing
|
||||
the field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
volTensorField gradU = fvc::grad(U);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
volScalarField Q
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"Q",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
0.5*(sqr(tr(gradU)) - tr(((gradU)&(gradU))))
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
/*
|
||||
// This is a second way of calculating Q, that delivers results
|
||||
// very close, but not identical to the first approach.
|
||||
|
||||
volSymmTensorField S = symm(gradU); // symmetric part of tensor
|
||||
volTensorField W = skew(gradU); // anti-symmetric part
|
||||
|
||||
volScalarField SS = S&&S;
|
||||
volScalarField WW = W&&W;
|
||||
|
||||
volScalarField Q
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Q",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
0.5*(WW - SS)
|
||||
);
|
||||
*/
|
||||
|
||||
Info<< "mag(Q) max/min : "
|
||||
<< max(Q).value() << " "
|
||||
<< min(Q).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
volTensorField gradU = fvc::grad(U);
|
||||
|
||||
volScalarField Q
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Q",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
0.5*(sqr(tr(gradU)) - tr(((gradU)&(gradU))))
|
||||
);
|
||||
|
||||
/*
|
||||
// This is a second way of calculating Q, that delivers results
|
||||
// very close, but not identical to the first approach.
|
||||
|
||||
volSymmTensorField S = symm(gradU); // symmetric part of tensor
|
||||
volTensorField W = skew(gradU); // anti-symmetric part
|
||||
|
||||
volScalarField SS = S&&S;
|
||||
volScalarField WW = W&&W;
|
||||
|
||||
volScalarField Q
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Q",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
0.5*(WW - SS)
|
||||
);
|
||||
*/
|
||||
|
||||
Info << " Writing Q" << endl;
|
||||
Q.write();
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.0 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
// Ucomponents tool definition
|
||||
|
||||
description "U velocity components";
|
||||
|
||||
UcomponentsDict
|
||||
{
|
||||
type dictionary;
|
||||
description "Ucomponents control dictionary";
|
||||
dictionaryPath "system";
|
||||
|
||||
entries
|
||||
{
|
||||
arguments
|
||||
{
|
||||
type rootCaseTimeArguments;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,3 +0,0 @@
|
||||
Ucomponents.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/Ucomponents
|
||||
@ -1,108 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
Ucomponents
|
||||
|
||||
Description
|
||||
Writes the three scalar fields, Ux, Uy and Uz, for each component of the
|
||||
velocity field U for each time
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
for (direction i=0; i<vector::nComponents; i++)
|
||||
{
|
||||
Info<< " Calculating U" << vector::componentNames[i] << endl;
|
||||
|
||||
volScalarField Ui
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U" + word(vector::componentNames[i]),
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
U.component(i)
|
||||
);
|
||||
Ui.write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,4 +0,0 @@
|
||||
:q
|
||||
calcDivPhi.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/divPhi
|
||||
@ -1,7 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lpostCalc \
|
||||
-lfiniteVolume
|
||||
@ -1,3 +1,3 @@
|
||||
calcDivPhi.C
|
||||
divPhiApp.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/divPhi
|
||||
|
||||
@ -22,11 +22,13 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Global
|
||||
calcDivPhi
|
||||
Application
|
||||
divPhi
|
||||
|
||||
Description
|
||||
Calculates and writes the divergence of the flux field phi
|
||||
Calculates and writes the divergence of the flux field phi. The
|
||||
-noWrite option just outputs the max/min values without writing the
|
||||
field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -74,5 +76,4 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,3 +1,3 @@
|
||||
calcDivU.C
|
||||
divUApp.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/divU
|
||||
|
||||
@ -22,11 +22,13 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Global
|
||||
calcDivU
|
||||
Application
|
||||
divU
|
||||
|
||||
Description
|
||||
Calculates and writes the divergence of velocity field U
|
||||
Calculates and writes the divergence of the velocity field U.
|
||||
The -noWrite option just outputs the max/min values without writing the
|
||||
field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -39,40 +41,44 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U
|
||||
IOobject Uheader
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
mesh
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
Info<< " Calculating divU" << endl;
|
||||
volScalarField divU
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"divU",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
fvc::div(U)
|
||||
);
|
||||
|
||||
Info<< "div(phi) max/min : "
|
||||
<< max(divU).value() << " "
|
||||
<< min(divU).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
divU.write();
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< " Calculating divU" << endl;
|
||||
volScalarField divU
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"divU",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
fvc::div(U)
|
||||
);
|
||||
|
||||
Info<< "div(U) max/min : "
|
||||
<< max(divU).value() << " "
|
||||
<< min(divU).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
divU.write();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,77 +26,60 @@ Application
|
||||
enstrophy
|
||||
|
||||
Description
|
||||
Calculates and writes the enstrophy of velocity field U at each time
|
||||
Calculates and writes the enstrophy of the velocity field U.
|
||||
The -noWrite option just outputs the max/min values without writing the
|
||||
field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
Info<< " Calculating enstrophy" << endl;
|
||||
volScalarField enstrophy
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"enstrophy",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
0.5*magSqr(fvc::curl(U))
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
Info<< "enstrophy(U) max/min : "
|
||||
<< max(enstrophy).value() << " "
|
||||
<< min(enstrophy).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< " Calculating enstrophy" << endl;
|
||||
volScalarField enstrophy
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"enstrophy",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
0.5*magSqr(fvc::curl(U))
|
||||
);
|
||||
|
||||
enstrophy.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,10 +26,11 @@ Application
|
||||
flowType
|
||||
|
||||
Description
|
||||
Calculates and writes the flowType of velocity field U at each time
|
||||
|
||||
The flow tye parameter is obtained from
|
||||
Calculates and writes the flowType of velocity field U.
|
||||
The -noWrite option has no meaning.
|
||||
|
||||
The flow type parameter is obtained according to the following equation:
|
||||
@verbatim
|
||||
|D| - |Omega|
|
||||
lambda = -------------
|
||||
|D| + |Omega|
|
||||
@ -37,79 +38,55 @@ Description
|
||||
-1 = rotational flow
|
||||
0 = simple shear flow
|
||||
1 = planar extensional flow
|
||||
@endverbatim
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
volTensorField gradU = fvc::grad(U);
|
||||
volScalarField magD = mag(symm(gradU));
|
||||
volScalarField magOmega = mag(skew(gradU));
|
||||
dimensionedScalar smallMagD("smallMagD", magD.dimensions(), SMALL);
|
||||
|
||||
IOobject Uheader
|
||||
Info<< " Calculating flowType" << endl;
|
||||
|
||||
volScalarField flowType
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"flowType",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
(magD - magOmega)/(magD + magOmega + smallMagD)
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
volTensorField gradU = fvc::grad(U);
|
||||
volScalarField magD = mag(symm(gradU));
|
||||
volScalarField magOmega = mag(skew(gradU));
|
||||
dimensionedScalar smallMagD("smallMagD", magD.dimensions(), SMALL);
|
||||
|
||||
Info<< " Calculating flowType" << endl;
|
||||
volScalarField flowType
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"flowType",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
(magD - magOmega)/(magD + magOmega + smallMagD)
|
||||
);
|
||||
|
||||
flowType.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
flowType.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,77 +26,61 @@ Application
|
||||
magGradU
|
||||
|
||||
Description
|
||||
Calculates and writes the scalar magnitude of velocity field U at each time
|
||||
|
||||
Calculates and writes the scalar magnitude of the gradient of the
|
||||
velocity field U.
|
||||
The -noWrite option just outputs the max/min values without writing
|
||||
the field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
Info<< " Calculating magGradU" << endl;
|
||||
volScalarField magGradU
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"magGradU",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(fvc::grad(U))
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
Info<< "magGrad(U) max/min : "
|
||||
<< max(magGradU).value() << " "
|
||||
<< min(magGradU).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< " Calculating magGradU" << endl;
|
||||
volScalarField magGradU
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magGradU",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(fvc::grad(U))
|
||||
);
|
||||
magGradU.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.0 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
// magU tool definition
|
||||
|
||||
description "Magnitude of U components";
|
||||
|
||||
magUDict
|
||||
{
|
||||
type dictionary;
|
||||
description "magU control dictionary";
|
||||
dictionaryPath "system";
|
||||
|
||||
entries
|
||||
{
|
||||
arguments
|
||||
{
|
||||
type rootCaseTimeArguments;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,3 +0,0 @@
|
||||
magU.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/magU
|
||||
@ -1,110 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
magU
|
||||
|
||||
Description
|
||||
Calculates and writes the scalar magnitude of the gradient of the velocity
|
||||
field U for each time
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< " Calculating magU" << endl;
|
||||
volScalarField magU
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magU",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(U)
|
||||
);
|
||||
|
||||
Info << "mag(U): max: " << max(magU.internalField())
|
||||
<< " min: " << min(magU.internalField()) << endl;
|
||||
|
||||
magU.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,80 +26,60 @@ Application
|
||||
uprime
|
||||
|
||||
Description
|
||||
Calculates and writes the scalar field of uprime (sqrt(2/3 k)) at
|
||||
each time
|
||||
Calculates and writes the scalar field of uprime (sqrt(2/3 k)).
|
||||
The -noWrite option just outputs the max/min values without writing
|
||||
the field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject kheader
|
||||
(
|
||||
"k",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (kheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading k" << endl;
|
||||
volScalarField k(kheader, mesh);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject kheader
|
||||
Info<< " Calculating uprime" << endl;
|
||||
volScalarField uprime
|
||||
(
|
||||
"k",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"uprime",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
sqrt((2.0/3.0)*k)
|
||||
);
|
||||
|
||||
// Check k exists
|
||||
if (kheader.headerOk())
|
||||
Info<< "uprime max/min : "
|
||||
<< max(uprime).value() << " "
|
||||
<< min(uprime).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading k" << endl;
|
||||
volScalarField k(kheader, mesh);
|
||||
|
||||
Info<< " Calculating uprime" << endl;
|
||||
volScalarField uprime
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"uprime",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
sqrt((2.0/3.0)*k)
|
||||
);
|
||||
uprime.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No k" << endl;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
return(0);
|
||||
else
|
||||
{
|
||||
Info<< " No k" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
|
||||
$(FOAM_LIBBIN)/postCalc.o \
|
||||
-lfiniteVolume
|
||||
|
||||
@ -26,91 +26,73 @@ Application
|
||||
vorticity
|
||||
|
||||
Description
|
||||
Calculates and writes the vorticity of velocity field U at each time
|
||||
Calculates and writes the vorticity of velocity field U.
|
||||
The -noWrite option just outputs the max/min values without writing
|
||||
the field.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "calc.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
|
||||
{
|
||||
bool writeResults = !args.options().found("noWrite");
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
IOobject Uheader
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
if (Uheader.headerOk())
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
Info<< " Calculating vorticity" << endl;
|
||||
volVectorField vorticity
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
IOobject
|
||||
(
|
||||
"vorticity",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
fvc::curl(U)
|
||||
);
|
||||
|
||||
// Check U exists
|
||||
if (Uheader.headerOk())
|
||||
volScalarField magVorticity
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magVorticity",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(vorticity)
|
||||
);
|
||||
|
||||
Info<< "vorticity max/min : "
|
||||
<< max(magVorticity).value() << " "
|
||||
<< min(magVorticity).value() << endl;
|
||||
|
||||
if (writeResults)
|
||||
{
|
||||
mesh.readUpdate();
|
||||
|
||||
Info<< " Reading U" << endl;
|
||||
volVectorField U(Uheader, mesh);
|
||||
|
||||
Info<< " Calculating vorticity" << endl;
|
||||
volVectorField vorticity
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"vorticity",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
fvc::curl(U)
|
||||
);
|
||||
vorticity.write();
|
||||
|
||||
Info<< " Calculating vorticity magnitude" << endl;
|
||||
volScalarField magVorticity
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"magVorticity",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mag(vorticity)
|
||||
);
|
||||
magVorticity.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
else
|
||||
{
|
||||
Info<< " No U" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
autoPtr<transportModel> laminarTransport
|
||||
(
|
||||
transportModel::New(U, phi)
|
||||
);
|
||||
|
||||
autoPtr<turbulenceModel> turbulence
|
||||
(
|
||||
turbulenceModel::New(U, phi, laminarTransport())
|
||||
);
|
||||
@ -23,7 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
wallGradU
|
||||
wallGradU
|
||||
|
||||
Description
|
||||
Calculates and writes the gradient of U at the wall
|
||||
@ -33,31 +33,19 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "incompressible/turbulenceModel/turbulenceModel.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
|
||||
timeSelector::addOptions();
|
||||
#include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
IOobject Uheader
|
||||
@ -113,7 +101,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,32 +41,21 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
timeSelector::addOptions();
|
||||
#include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
mesh.readUpdate();
|
||||
|
||||
# include "createFields.H"
|
||||
|
||||
surfaceScalarField heatFlux =
|
||||
surfaceScalarField heatFlux =
|
||||
fvc::interpolate(turbulence->alphaEff())*fvc::snGrad(h);
|
||||
|
||||
const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
|
||||
@ -83,7 +72,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh.magSf().boundaryField()[patchi]
|
||||
*patchHeatFlux[patchi]
|
||||
)
|
||||
)
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@ -111,8 +100,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -26,8 +26,7 @@ Application
|
||||
wallShearStress
|
||||
|
||||
Description
|
||||
Calculates and writes the wall shear stress for the current
|
||||
time step.
|
||||
Calculates and writes the wall shear stress, for the specified times.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -35,33 +34,20 @@ Description
|
||||
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
|
||||
#include "incompressible/turbulenceModel/turbulenceModel.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
# include "addTimeOptions.H"
|
||||
# include "setRootCase.H"
|
||||
|
||||
timeSelector::addOptions();
|
||||
#include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
# include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
mesh.readUpdate();
|
||||
|
||||
# include "createFields.H"
|
||||
@ -101,7 +87,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ Application
|
||||
yPlusLES
|
||||
|
||||
Description
|
||||
Calculates and reports yPlus for all wall patches, for each time.
|
||||
Calculates and reports yPlus for all wall patches, for the specified times.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -39,27 +39,16 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "addTimeOptions.H"
|
||||
timeSelector::addOptions();
|
||||
#include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
#include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
#include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
mesh.readUpdate();
|
||||
|
||||
volScalarField yPlus
|
||||
@ -90,7 +79,7 @@ int main(int argc, char *argv[])
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
# include "createPhi.H"
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
@ -121,8 +110,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Patch " << patchi
|
||||
<< " named " << currPatch.name()
|
||||
<< " y+ : min: " << min(Yp) << " max: " << max(Yp)
|
||||
<< " average: " << average(Yp) << nl << endl;
|
||||
<< " y+ : min: " << min(yPlus) << " max: " << max(yPlus)
|
||||
<< " average: " << average(yPlus) << nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +120,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
checkYPlus.C
|
||||
yPlusRAS.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/checkYPlus
|
||||
EXE = $(FOAM_APPBIN)/yPlusRAS
|
||||
|
||||
@ -26,7 +26,7 @@ Application
|
||||
yPlusRAS
|
||||
|
||||
Description
|
||||
Calculates and reports yPlus for all wall patches, for each time.
|
||||
Calculates and reports yPlus for all wall patches, for the specified times.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -39,27 +39,16 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "addTimeOptions.H"
|
||||
timeSelector::addOptions();
|
||||
#include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// set startTime and endTime depending on -time and -latestTime options
|
||||
#include "checkTimeOptions.H"
|
||||
|
||||
runTime.setTime(Times[startTime], startTime);
|
||||
|
||||
#include "createMesh.H"
|
||||
|
||||
for (label i=startTime; i<endTime; i++)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(Times[i], i);
|
||||
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
Info<< "Time = " << runTime.timeName() << endl;
|
||||
|
||||
mesh.readUpdate();
|
||||
|
||||
volScalarField yPlus
|
||||
@ -90,7 +79,7 @@ int main(int argc, char *argv[])
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
# include "createPhi.H"
|
||||
|
||||
singlePhaseTransportModel laminarTransport(U, phi);
|
||||
|
||||
@ -122,8 +111,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -23,10 +23,10 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
divPhi
|
||||
postCalc
|
||||
|
||||
Description
|
||||
Calculates and writes the divergence of phi U at each time
|
||||
Generic wrapper for calculating a quantity at each time
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -66,9 +66,9 @@ int main(int argc, char *argv[])
|
||||
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
|
||||
# include "createMesh.H"
|
||||
|
||||
forAll(timeDirs, timei)
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timei], timei);
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
|
||||
Foam::Info<< "Time = " << runTime.timeName() << Foam::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user