functionObjects::age: Added fvOption support
This commit is contained in:
@ -95,7 +95,8 @@ Foam::functionObjects::age::age
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fvMeshFunctionObject(name, runTime, dict)
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
fvOptions_(mesh_)
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
@ -118,6 +119,11 @@ bool Foam::functionObjects::age::read(const dictionary& dict)
|
||||
diffusion_ = dict.lookupOrDefault<Switch>("diffusion", false);
|
||||
tolerance_ = dict.lookupOrDefault<scalar>("tolerance", 1e-5);
|
||||
|
||||
if (dict.found("fvOptions"))
|
||||
{
|
||||
fvOptions_.reset(dict.subDict("fvOptions"));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -186,7 +192,7 @@ bool Foam::functionObjects::age::execute()
|
||||
{
|
||||
fvScalarMatrix ageEqn
|
||||
(
|
||||
fvm::div(phi, age, divScheme) == rho
|
||||
fvm::div(phi, age, divScheme) == rho + fvOptions_(rho, age)
|
||||
);
|
||||
|
||||
if (diffusion_)
|
||||
@ -196,6 +202,8 @@ bool Foam::functionObjects::age::execute()
|
||||
|
||||
ageEqn.relax(relaxCoeff);
|
||||
|
||||
fvOptions_.constrain(ageEqn);
|
||||
|
||||
if (converged(i, ageEqn.solve(schemesField_).initialResidual()))
|
||||
{
|
||||
break;
|
||||
@ -223,7 +231,8 @@ bool Foam::functionObjects::age::execute()
|
||||
{
|
||||
fvScalarMatrix ageEqn
|
||||
(
|
||||
fvm::div(phi, age, divScheme) == dimensionedScalar(1)
|
||||
fvm::div(phi, age, divScheme)
|
||||
== dimensionedScalar(1) + fvOptions_(age)
|
||||
);
|
||||
|
||||
if (diffusion_)
|
||||
@ -233,6 +242,8 @@ bool Foam::functionObjects::age::execute()
|
||||
|
||||
ageEqn.relax(relaxCoeff);
|
||||
|
||||
fvOptions_.constrain(ageEqn);
|
||||
|
||||
if (converged(i, ageEqn.solve(schemesField_).initialResidual()))
|
||||
{
|
||||
break;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -68,11 +68,12 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef age_H
|
||||
#define age_H
|
||||
#ifndef functionObjects_age_H
|
||||
#define functionObjects_age_H
|
||||
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "volFields.H"
|
||||
#include "fvOptionList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -109,6 +110,9 @@ class age
|
||||
//- Convergence tolerance
|
||||
scalar tolerance_;
|
||||
|
||||
//- Run-time selectable finite volume options, e.g. sources, constraints
|
||||
fv::optionList fvOptions_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user