solvers: Adjust time step even if Courant number is zero
This change means that even if the Courant number is zero, the time step is adjusted based on maximum time step settings and/or constraints specified by active fvModels. If none of these additional constraints are present then adjustment is deactivated.
This commit is contained in:
@ -47,7 +47,7 @@ void Foam::solvers::solid::readControls()
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxDi", 1.0);
|
||||
|
||||
maxDeltaT_ =
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxDeltaT", great);
|
||||
runTime.controlDict().lookupOrDefault<scalar>("maxDeltaT", vGreat);
|
||||
}
|
||||
|
||||
|
||||
@ -131,15 +131,14 @@ Foam::solvers::solid::~solid()
|
||||
|
||||
Foam::scalar Foam::solvers::solid::maxDeltaT() const
|
||||
{
|
||||
scalar deltaT = min(fvModels().maxDeltaT(), maxDeltaT_);
|
||||
|
||||
if (DiNum > small)
|
||||
{
|
||||
const scalar deltaT = maxDi*runTime.deltaTValue()/DiNum;
|
||||
return min(min(deltaT, fvModels().maxDeltaT()), maxDeltaT_);
|
||||
}
|
||||
else
|
||||
{
|
||||
return maxDeltaT_;
|
||||
deltaT = min(deltaT, maxDi/DiNum*runTime.deltaTValue());
|
||||
}
|
||||
|
||||
return deltaT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user