solver: Make time-step fractional increase available externally

This commit is contained in:
Will Bainbridge
2023-01-27 13:18:06 +00:00
parent 0f24197be1
commit 0543521992
4 changed files with 25 additions and 2 deletions

View File

@ -74,7 +74,14 @@ void Foam::adjustDeltaT(Time& runTime, const PtrList<solver>& solvers)
if (transient && deltaT < rootVGreat)
{
runTime.setDeltaT(min(1.2*runTime.deltaTValue(), deltaT));
runTime.setDeltaT
(
min
(
solver::maxIncreaseDeltaT*runTime.deltaTValue(),
deltaT
)
);
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
}

View File

@ -52,7 +52,14 @@ void Foam::adjustDeltaT(Time& runTime, const solver& solver)
&& solver.maxDeltaT() < rootVGreat
)
{
runTime.setDeltaT(min(1.2*runTime.deltaTValue(), solver.maxDeltaT()));
runTime.setDeltaT
(
min
(
solver::maxIncreaseDeltaT*runTime.deltaTValue(),
solver.maxDeltaT()
)
);
Info<< "deltaT = " << runTime.deltaTValue() << endl;
}
}

View File

@ -35,6 +35,9 @@ namespace Foam
}
const Foam::scalar Foam::solver::maxIncreaseDeltaT = 1.2;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::solver::writeData(Ostream&) const

View File

@ -76,6 +76,12 @@ public:
bool LTS;
// Public Static Data
//- Maximum fractional increase in deltaT
static const scalar maxIncreaseDeltaT;
private:
// Private Member Data