mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -50,7 +50,9 @@ Foam::Lambda2::Lambda2
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
UName_("U")
|
||||
UName_("U"),
|
||||
resultName_(name),
|
||||
log_(true)
|
||||
{
|
||||
// Check if the available mesh is an fvMesh, otherwise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
@ -81,7 +83,7 @@ Foam::Lambda2::Lambda2
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
type(),
|
||||
resultName_,
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
@ -109,7 +111,17 @@ void Foam::Lambda2::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
UName_ = dict.lookupOrDefault<word>("UName", "U");
|
||||
log_.readIfPresent("log", dict);
|
||||
dict.readIfPresent("UName", UName_);
|
||||
|
||||
if (!dict.readIfPresent("resultName", resultName_))
|
||||
{
|
||||
resultName_ = name_;
|
||||
if (UName_ != "U")
|
||||
{
|
||||
resultName_ = resultName_ + "(" + UName_ + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +146,7 @@ void Foam::Lambda2::execute()
|
||||
volScalarField& Lambda2 =
|
||||
const_cast<volScalarField&>
|
||||
(
|
||||
mesh.lookupObject<volScalarField>(type())
|
||||
mesh.lookupObject<volScalarField>(resultName_)
|
||||
);
|
||||
|
||||
Lambda2 = -eigenValues(SSplusWW)().component(vector::Y);
|
||||
@ -162,9 +174,10 @@ void Foam::Lambda2::write()
|
||||
if (active_)
|
||||
{
|
||||
const volScalarField& Lambda2 =
|
||||
obr_.lookupObject<volScalarField>(type());
|
||||
obr_.lookupObject<volScalarField>(resultName_);
|
||||
|
||||
Info<< type() << " " << name_ << " output:" << nl
|
||||
if (log_) Info
|
||||
<< type() << " " << name_ << " output:" << nl
|
||||
<< " writing field " << Lambda2.name() << nl
|
||||
<< endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user