From 2b7c977da5cd3b9a0efa0176c7419c09b40565de Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Tue, 12 Sep 2023 10:23:23 +0100 Subject: [PATCH] solvers::functions: Apply maxDeltaT from functions The functions module now applies time-step restrictions from the functions that are running, rather than from the sub-solver. The sub-solver only exists to be constructed so that its data is available to the functions. It should not affect the solution process in any way. --- applications/modules/functions/functions.C | 2 +- .../fvModelFunctionObject/fvModelFunctionObject.C | 6 ++++++ .../fvModelFunctionObject/fvModelFunctionObject.H | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/applications/modules/functions/functions.C b/applications/modules/functions/functions.C index 8fa1244653..e9476559f6 100644 --- a/applications/modules/functions/functions.C +++ b/applications/modules/functions/functions.C @@ -100,7 +100,7 @@ Foam::solvers::functions::~functions() Foam::scalar Foam::solvers::functions::maxDeltaT() const { - return solverPtr->maxDeltaT(); + return vGreat; } diff --git a/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.C b/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.C index 07398e3f67..42adc12cd9 100644 --- a/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.C +++ b/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.C @@ -78,4 +78,10 @@ bool Foam::functionObjects::fvModel::write() } +Foam::scalar Foam::functionObjects::fvModel::maxDeltaT() const +{ + return fvModelPtr_().maxDeltaT(); +} + + // ************************************************************************* // diff --git a/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.H b/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.H index 176555ba19..18488f55eb 100644 --- a/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.H +++ b/src/finiteVolume/functionObjects/fvModelFunctionObject/fvModelFunctionObject.H @@ -124,6 +124,9 @@ public: //- Do nothing virtual bool write(); + //- Return the maximum time-step for stable operation + virtual scalar maxDeltaT() const; + // Member Operators