From 39d0d06bd5ea735d491c672b516c6b82ab299958 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Wed, 3 Jun 2026 16:57:39 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=90=9B=20allow=20to=20validate=20a=20?= =?UTF-8?q?timestep=20when=20allowNonConverged=20is=20enabled=20by=20preve?= =?UTF-8?q?nting=20any=20timestep-cut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../physicsSolvers/NonlinearSolverParameters.cpp | 5 +++-- src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp index d50a3f79152..d80c6c6b832 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp @@ -104,8 +104,9 @@ NonlinearSolverParameters::NonlinearSolverParameters( string const & name, registerWrapper( viewKeysStruct::allowNonConvergedString(), &m_allowNonConverged ). setApplyDefaultValue( 0 ). setInputFlag( InputFlags::OPTIONAL ). - setDescription( "Allow non-converged solution to be accepted. " - "(i.e. exit from the Newton loop without achieving the desired tolerance)" ); + setDescription( "Allow non-converged solution to be accepted " + "(i.e. exit from the Newton loop without achieving the desired tolerance). " + "With this parameter enabledthus timestep cuts never occur" ); registerWrapper( viewKeysStruct::timeStepDecreaseIterLimString(), &m_timeStepDecreaseIterLimit ). setApplyDefaultValue( 0.7 ). diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index 8d05dfd6958..fe634215f75 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -917,7 +917,7 @@ real64 PhysicsSolverBase::nonlinearImplicitStep( real64 const & time_n, } // end of configuration loop - if( isConfigurationLoopConverged ) + if( isConfigurationLoopConverged || allowNonConverged ) { // get out of outer loop break; From 743110d834ec441402942763a9a98acea6de70c4 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Wed, 3 Jun 2026 18:01:30 +0200 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20bugfix=20approach=20change:?= =?UTF-8?q?=20allow=20to=20validate=20a=20timestep=20when=20allowNonConver?= =?UTF-8?q?ged=20is=20enabled=20without=20preventing=20timestep-cuts,=20bu?= =?UTF-8?q?t=20at=20the=20last=20level=20of=20sub-steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NonlinearSolverParameters.cpp | 6 +++--- .../physicsSolvers/PhysicsSolverBase.cpp | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp index d80c6c6b832..93955523260 100644 --- a/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp +++ b/src/coreComponents/physicsSolvers/NonlinearSolverParameters.cpp @@ -104,9 +104,9 @@ NonlinearSolverParameters::NonlinearSolverParameters( string const & name, registerWrapper( viewKeysStruct::allowNonConvergedString(), &m_allowNonConverged ). setApplyDefaultValue( 0 ). setInputFlag( InputFlags::OPTIONAL ). - setDescription( "Allow non-converged solution to be accepted " - "(i.e. exit from the Newton loop without achieving the desired tolerance). " - "With this parameter enabledthus timestep cuts never occur" ); + setDescription( "When enabled, the simulation can continue even with a non-converged solution (residuals exceeding the tolerance during the " + "newton loops) at the deepest level of sub-timesteps (maxSubSteps).\n" + "When disabled, the simulation will stop with an error when no converged solution has been found at the last sub-step level." ); registerWrapper( viewKeysStruct::timeStepDecreaseIterLimString(), &m_timeStepDecreaseIterLimit ). setApplyDefaultValue( 0.7 ). diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index fe634215f75..d5451370504 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -367,9 +367,19 @@ bool PhysicsSolverBase::execute( real64 const time_n, getName(), subStep, dtAccepted, nextDt, dtRemaining ) ); } } - GEOS_ERROR_IF( dtRemaining > 0.0, - "Maximum allowed number of sub-steps reached. Consider increasing maxSubSteps.", - getDataContext() ); + + if( m_nonlinearSolverParameters.m_allowNonConverged ) + { + GEOS_WARNING_IF( dtRemaining > 0.0, + "Maximum allowed number of sub-steps reached, non-converged solutions are allowed so the simulation continues with innacurate results.", + getDataContext(), getWrapperDataContext( NonlinearSolverParameters::viewKeysStruct::allowNonConvergedString()) ); + } + else + { + GEOS_ERROR_IF( dtRemaining > 0.0, + "Maximum allowed number of sub-steps reached. Consider increasing maxSubSteps.", + getDataContext() ); + } // Decide what to do with the next Dt for the event running the solver. m_nextDt = setNextDt( time_n + dt, nextDt, domain ); @@ -917,7 +927,7 @@ real64 PhysicsSolverBase::nonlinearImplicitStep( real64 const & time_n, } // end of configuration loop - if( isConfigurationLoopConverged || allowNonConverged ) + if( isConfigurationLoopConverged ) { // get out of outer loop break; From d2dae02ed71288b8ea9244f6cf69e0fa523818a8 Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Thu, 4 Jun 2026 09:43:48 +0200 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=87=20only=20log=20this=20error/wa?= =?UTF-8?q?rning=20on=20rank=200=20as=20dtRemaining=20will=20be=20the=20sa?= =?UTF-8?q?me=20on=20all=20ranks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index d5451370504..cf6521b3af9 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -370,13 +370,13 @@ bool PhysicsSolverBase::execute( real64 const time_n, if( m_nonlinearSolverParameters.m_allowNonConverged ) { - GEOS_WARNING_IF( dtRemaining > 0.0, + GEOS_WARNING_IF( dtRemaining > 0.0 && MpiWrapper::commRank() == 0, "Maximum allowed number of sub-steps reached, non-converged solutions are allowed so the simulation continues with innacurate results.", getDataContext(), getWrapperDataContext( NonlinearSolverParameters::viewKeysStruct::allowNonConvergedString()) ); } else { - GEOS_ERROR_IF( dtRemaining > 0.0, + GEOS_ERROR_IF( dtRemaining > 0.0 && MpiWrapper::commRank() == 0, "Maximum allowed number of sub-steps reached. Consider increasing maxSubSteps.", getDataContext() ); } From 9e16b4594666c3588a90faec9f5fb375e95347ce Mon Sep 17 00:00:00 2001 From: MelReyCG Date: Thu, 4 Jun 2026 10:50:51 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=93=A6=20schema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/coreComponents/schema/schema.xsd | 3 ++- src/coreComponents/schema/schema.xsd.other | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd index bd776c2bac0..4e5e210fb83 100644 --- a/src/coreComponents/schema/schema.xsd +++ b/src/coreComponents/schema/schema.xsd @@ -2452,7 +2452,8 @@ Information output from lower logLevels is added with the desired log level - + diff --git a/src/coreComponents/schema/schema.xsd.other b/src/coreComponents/schema/schema.xsd.other index 355f061e7f5..11e08ccc206 100644 --- a/src/coreComponents/schema/schema.xsd.other +++ b/src/coreComponents/schema/schema.xsd.other @@ -526,7 +526,7 @@ A field can represent a physical variable. (pressure, temperature, global compos - + @@ -1603,7 +1603,7 @@ A field can represent a physical variable. (pressure, temperature, global compos - + From 3f38ea86f381afac3f8e9f18dff89d26640ec55e Mon Sep 17 00:00:00 2001 From: MelReyCG <122801580+MelReyCG@users.noreply.github.com> Date: Fri, 5 Jun 2026 16:57:10 +0200 Subject: [PATCH 5/5] Update src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp Co-authored-by: Dickson Kachuma <81433670+dkachuma@users.noreply.github.com> --- src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp index cf6521b3af9..ad68e0d7ba7 100644 --- a/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp +++ b/src/coreComponents/physicsSolvers/PhysicsSolverBase.cpp @@ -371,7 +371,7 @@ bool PhysicsSolverBase::execute( real64 const time_n, if( m_nonlinearSolverParameters.m_allowNonConverged ) { GEOS_WARNING_IF( dtRemaining > 0.0 && MpiWrapper::commRank() == 0, - "Maximum allowed number of sub-steps reached, non-converged solutions are allowed so the simulation continues with innacurate results.", + "Maximum allowed number of sub-steps reached but non-converged solutions are allowed so the simulation will continue with potentially inaccurate results.", getDataContext(), getWrapperDataContext( NonlinearSolverParameters::viewKeysStruct::allowNonConvergedString()) ); } else