Merge pull request #4855 from erikhide/master

Fixed indexing error in PID controller
This commit is contained in:
Atgeirr Flø Rasmussen 2024-09-24 13:33:14 +02:00 committed by GitHub
commit 4becb4c3fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -192,7 +192,7 @@ namespace Opm
OpmLog::info(fmt::format("Computed step size (tol): {} days", unit::convert::to( newDt, unit::day )));
return newDt;
}
else if (errors_[1] == 0 || errors_[2] == 0.)
else if (errors_[0] == 0 || errors_[1] == 0 || errors_[2] == 0.)
{
if ( verbose_ )
OpmLog::info("The solution between time steps does not change, there is no time step constraint from the PID time step control ");
@ -206,7 +206,7 @@ namespace Opm
const double kD = 0.01 ;
const double newDt = (dt * std::pow( errors_[ 1 ] / errors_[ 2 ], kP ) *
std::pow( tol_ / errors_[ 2 ], kI ) *
std::pow( errors_[0]*errors_[0]/errors_[ 1 ]/errors_[ 2 ], kD ));
std::pow( errors_[1]*errors_[1]/errors_[ 0 ]/errors_[ 2 ], kD ));
if( verbose_ )
OpmLog::info(fmt::format("Computed step size (pow): {} days", unit::convert::to( newDt, unit::day )));
return newDt;

View File

@ -201,9 +201,9 @@ add_test_compare_parallel_simulation(CASENAME 3_a_mpi_multflt_mod2
FILENAME 3_A_MPI_MULTFLT_SCHED_MODEL2
SIMULATOR flow
ABS_TOL ${abs_tol_parallel}
REL_TOL ${rel_tol_parallel}
DIR model2
TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --enable-drift-compensation=false)
REL_TOL 1.0e-3
DIR model2
TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --newton-max-iterations=30 --enable-drift-compensation=false)
add_test_compare_parallel_simulation(CASENAME rxft
FILENAME TEST_RXFT