35 namespace functionObjects
51 Foam::functionObjects::adjustTimeStepToCombustion::propsDictIo
53 const IOobject::readOption& r
57 typeIOobject<timeIOdictionary>
59 name() +
"Properties",
80 phaseName_(
word::null),
83 haveCombustionDeltaT0_(false),
84 combustionDeltaT0_(
NaN)
104 maxCo_ =
dict.lookupOrDefault<scalar>(
"maxCo", 1);
105 extrapolate_ =
dict.lookupOrDefault<
bool>(
"extrapolate",
false);
112 if (propsDictIo.headerOk())
116 haveCombustionDeltaT0_ =
true;
117 combustionDeltaT0_ =
propsDict.lookup<scalar>(
"combustionDeltaT");
121 haveCombustionDeltaT0_ =
false;
130 if (!time_.controlDict().lookupOrDefault(
"adjustTimeStep",
false))
159 if (
thermo.composition().solve(i))
161 rhoDotByRho +=
mag(combustion.
R(i))/2/
thermo.rho()();
166 const scalar combustionDeltaT1 = maxCo_/
max(
gMax(rhoDotByRho), vSmall);
173 if (extrapolate_ && haveCombustionDeltaT0_)
175 const scalar
x =
min(
max(combustionDeltaT1/combustionDeltaT0_, 0), 1);
176 const scalar
f = (1 - rootSmall)*(1 -
sqrt(1 -
sqr(
x))) + rootSmall;
177 deltaT =
f*combustionDeltaT1;
181 deltaT = combustionDeltaT1;
185 haveCombustionDeltaT0_ =
true;
186 combustionDeltaT0_ = combustionDeltaT1;
193 const_cast<Time&
>(time_).setDeltaTNoAdjust
204 if (extrapolate_ && obr_.time().writeTime())
208 propsDict.add(
"combustionDeltaT", combustionDeltaT0_);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static tmp< DimensionedField< Type, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &, const Field< Type > &)
Return a temporary field constructed from name, mesh,.
static word groupName(Name name, const word &group)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Base class for combustion models.
const fluidMulticomponentThermo & thermo() const
Return const access to the thermo.
virtual tmp< volScalarField::Internal > R(const label speciei) const =0
Consumption rate, i.e. source term for specie equation.
static const word combustionPropertiesName
Default combustionProperties dictionary name.
const fvMesh & mesh() const
Return const access to the mesh database.
A list of keyword definitions, which are a keyword followed by any number of values (e....
const word & name() const
Return const reference to name.
Base-class for multi-component fluid thermodynamic properties.
Abstract base-class for Time/database functionObjects.
const word & name() const
Return the name of this functionObject.
Adjusts the time step to match bulk reaction time scales. This allows the solver to temporally resolv...
virtual ~adjustTimeStepToCombustion()
adjustTimeStepToCombustion(const word &name, const Time &runTime, const dictionary &dict)
Construct from components.
virtual bool execute()
Reset the timeStep from the Function1 of time.
virtual bool write()
Do nothing.
virtual bool read(const dictionary &)
Read and reset the timeStep Function1.
Specialisation of Foam::functionObject for a region and providing a reference to the region Foam::obj...
const objectRegistry & obr_
Reference to the region objectRegistry.
const Time & time() const
Return time.
static scalar deltaTFactor
deltaT increase factor
timeIOdictionary derived from IOdictionary with globalFile set false to enable writing to processor t...
Templated form of IOobject providing type information for file reading and header type checking.
A class for handling words, derived from string.
static const word null
An empty word.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimless
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
word name(const complex &)
Return a string representation of a complex.
Type gMax(const FieldField< Field, Type > &f)
fluidMulticomponentThermo & thermo
IOdictionary propsDict(systemDict("particleTracksDict", args, runTime))