functionObjects::fluidMaxDeltaT: New functionObject to set the maximum Courant number and time-step
at Function1s of time. Underlying this new functionObject is a generalisation of the handling of the maximum time-step in the modular solvers to allow complex user-specification of the maximum time-step used in a simulation, not just the time-dependency provided by fluidMaxDeltaT but functions of anything in the simulation by creating a specialised functionObject in which the maxDeltaT function is defined. The chemical and combustion time-scale functionObjects adjustTimeStepToChemistry and adjustTimeStepToCombustion have been updated and simplified using the above mechanism.
This commit is contained in:
@ -47,6 +47,11 @@ void Foam::setDeltaT(Time& runTime, const PtrList<solver>& solvers)
|
||||
}
|
||||
}
|
||||
|
||||
if (transient)
|
||||
{
|
||||
deltaT = min(deltaT, runTime.functionObjects().maxDeltaT());
|
||||
}
|
||||
|
||||
if (transient && deltaT < rootVGreat)
|
||||
{
|
||||
runTime.setDeltaT(min(runTime.deltaTValue(), deltaT));
|
||||
@ -72,6 +77,11 @@ void Foam::adjustDeltaT(Time& runTime, const PtrList<solver>& solvers)
|
||||
}
|
||||
}
|
||||
|
||||
if (transient)
|
||||
{
|
||||
deltaT = min(deltaT, runTime.functionObjects().maxDeltaT());
|
||||
}
|
||||
|
||||
if (transient && deltaT < rootVGreat)
|
||||
{
|
||||
runTime.setDeltaT
|
||||
|
||||
@ -34,10 +34,15 @@ void Foam::setDeltaT(Time& runTime, const solver& solver)
|
||||
runTime.timeIndex() == 0
|
||||
&& runTime.controlDict().lookupOrDefault("adjustTimeStep", false)
|
||||
&& solver.transient()
|
||||
&& solver.maxDeltaT() < rootVGreat
|
||||
)
|
||||
{
|
||||
runTime.setDeltaT(min(runTime.deltaTValue(), solver.maxDeltaT()));
|
||||
const scalar deltaT =
|
||||
min(solver.maxDeltaT(), runTime.functionObjects().maxDeltaT());
|
||||
|
||||
if (deltaT < rootVGreat)
|
||||
{
|
||||
runTime.setDeltaT(min(runTime.deltaTValue(), deltaT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,18 +54,19 @@ void Foam::adjustDeltaT(Time& runTime, const solver& solver)
|
||||
(
|
||||
runTime.controlDict().lookupOrDefault("adjustTimeStep", false)
|
||||
&& solver.transient()
|
||||
&& solver.maxDeltaT() < rootVGreat
|
||||
)
|
||||
{
|
||||
runTime.setDeltaT
|
||||
(
|
||||
min
|
||||
const scalar deltaT =
|
||||
min(solver.maxDeltaT(), runTime.functionObjects().maxDeltaT());
|
||||
|
||||
if (deltaT < rootVGreat)
|
||||
{
|
||||
runTime.setDeltaT
|
||||
(
|
||||
solver::deltaTFactor*runTime.deltaTValue(),
|
||||
solver.maxDeltaT()
|
||||
)
|
||||
);
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
min(solver::deltaTFactor*runTime.deltaTValue(), deltaT)
|
||||
);
|
||||
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user