ENH: Multiple updates to function objects

Updated objects
- corrected Peclet number for compressible cases
- propagated log flag and resultName across objects

New function objects
- new fluxSummary:
  - calculates positive, negative, absolute and net flux across face
    zones
- new runTimeControl
  - abort the calculation when a user-defined metric is achieved.
    Available options include:
    - average value remains unchanged wrt a given threshold
    - equation initial residual exceeds a threshold - useful to abort
      diverging cases
    - equation max iterations exceeds a threshold - useful to abort
      diverging cases
    - min/max of a function object value
    - min time step exceeds a threshold - useful to abort diverging
      cases
- new valueAverage:
  - average singular values from other function objects, e.g. Cd, Cl and
    Cm from the forceCoeffs function object
This commit is contained in:
Andrew Heather
2015-11-25 17:19:06 +00:00
parent f4de5d17e4
commit 6838df9cd2
129 changed files with 9233 additions and 3546 deletions

View File

@ -50,7 +50,8 @@ Foam::vorticity::vorticity
obr_(obr),
active_(true),
UName_("U"),
outputName_(typeName)
resultName_(name),
log_(true)
{
// Check if the available mesh is an fvMesh, otherwise deactivate
if (!isA<fvMesh>(obr_))
@ -81,7 +82,7 @@ Foam::vorticity::vorticity
(
IOobject
(
outputName_,
resultName_,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
@ -109,10 +110,16 @@ void Foam::vorticity::read(const dictionary& dict)
{
if (active_)
{
UName_ = dict.lookupOrDefault<word>("UName", "U");
if (UName_ != "U")
log_.readIfPresent("log", dict);
dict.readIfPresent("UName", UName_);
if (!dict.readIfPresent("resultName", resultName_))
{
outputName_ = typeName + "(" + UName_ + ")";
resultName_ = name_;
if (UName_ != "U")
{
resultName_ = resultName_ + "(" + UName_ + ")";
}
}
}
}
@ -127,7 +134,7 @@ void Foam::vorticity::execute()
volVectorField& vorticity =
const_cast<volVectorField&>
(
obr_.lookupObject<volVectorField>(outputName_)
obr_.lookupObject<volVectorField>(resultName_)
);
vorticity = fvc::curl(U);
@ -155,9 +162,10 @@ void Foam::vorticity::write()
if (active_)
{
const volVectorField& vorticity =
obr_.lookupObject<volVectorField>(outputName_);
obr_.lookupObject<volVectorField>(resultName_);
Info<< type() << " " << name_ << " output:" << nl
if (log_) Info
<< type() << " " << name_ << " output:" << nl
<< " writing field " << vorticity.name() << nl
<< endl;

View File

@ -28,7 +28,29 @@ Group
grpUtilitiesFunctionObjects
Description
This function object calculates the vorticity, the curl of the velocity.
This function object calculates and outputs the vorticity, the curl of
the velocity as a volvectorField. The field is stored on the mesh
database so that it can be retrieved and used for other applications.
Example of function object specification to calculate the vorticity:
\verbatim
vorticity1
{
type vorticity;
functionObjectLibs ("libutilityFunctionObjects.so");
...
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | Type name: vorticity | yes |
UName | Name of velocity field | no | U
resultName | Name of Courant number field | no | \<function name\>
log | Log to standard output | no | yes
\endtable
SourceFiles
vorticity.C
@ -40,6 +62,7 @@ SourceFiles
#define vorticity_H
#include "volFieldsFwd.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -73,7 +96,10 @@ class vorticity
word UName_;
//- Name of vorticity field
word outputName_;
word resultName_;
//- Switch to send output to Info as well as to file
Switch log_;
// Private Member Functions