2015-05-24 10:33:06 -05:00
|
|
|
/*
|
|
|
|
Copyright 2015 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <opm/autodiff/BlackoilModelParameters.hpp>
|
|
|
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
2016-11-25 05:40:33 -06:00
|
|
|
#include <opm/parser/eclipse/Units/Units.hpp>
|
2015-05-24 10:33:06 -05:00
|
|
|
|
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
BlackoilModelParameters::BlackoilModelParameters()
|
|
|
|
{
|
|
|
|
// set default values
|
|
|
|
reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-28 08:36:25 -05:00
|
|
|
BlackoilModelParameters::BlackoilModelParameters( const ParameterGroup& param )
|
2015-05-24 10:33:06 -05:00
|
|
|
{
|
|
|
|
// set default values
|
|
|
|
reset();
|
|
|
|
|
|
|
|
// overload with given parameters
|
|
|
|
dp_max_rel_ = param.getDefault("dp_max_rel", dp_max_rel_);
|
|
|
|
ds_max_ = param.getDefault("ds_max", ds_max_);
|
|
|
|
dr_max_rel_ = param.getDefault("dr_max_rel", dr_max_rel_);
|
2016-10-27 08:01:44 -05:00
|
|
|
dbhp_max_rel_= param.getDefault("dbhp_max_rel", dbhp_max_rel_);
|
2016-11-25 05:40:33 -06:00
|
|
|
dwell_fraction_max_ = param.getDefault("dwell_fraction_max", dwell_fraction_max_);
|
2015-05-24 10:33:06 -05:00
|
|
|
max_residual_allowed_ = param.getDefault("max_residual_allowed", max_residual_allowed_);
|
|
|
|
tolerance_mb_ = param.getDefault("tolerance_mb", tolerance_mb_);
|
|
|
|
tolerance_cnv_ = param.getDefault("tolerance_cnv", tolerance_cnv_);
|
|
|
|
tolerance_wells_ = param.getDefault("tolerance_wells", tolerance_wells_ );
|
2016-11-11 06:26:22 -06:00
|
|
|
tolerance_well_control_ = param.getDefault("tolerance_well_control", tolerance_well_control_);
|
2017-10-04 06:09:49 -05:00
|
|
|
max_welleq_iter_ = param.getDefault("max_welleq_iter", max_welleq_iter_);
|
2017-10-17 06:21:02 -05:00
|
|
|
use_multisegment_well_ = param.getDefault("use_multisegment_well", use_multisegment_well_);
|
2017-10-16 09:46:28 -05:00
|
|
|
if (use_multisegment_well_) {
|
|
|
|
tolerance_pressure_ms_wells_ = param.getDefault("tolerance_pressure_ms_wells", tolerance_pressure_ms_wells_);
|
|
|
|
max_pressure_change_ms_wells_ = param.getDefault("max_pressure_change_ms_wells", max_pressure_change_ms_wells_);
|
|
|
|
use_inner_iterations_ms_wells_ = param.getDefault("use_inner_iterations_ms_wells", use_inner_iterations_ms_wells_);
|
|
|
|
max_inner_iter_ms_wells_ = param.getDefault("max_inner_iter_ms_wells", max_inner_iter_ms_wells_);
|
|
|
|
}
|
2016-11-21 10:18:24 -06:00
|
|
|
maxSinglePrecisionTimeStep_ = unit::convert::from(
|
|
|
|
param.getDefault("max_single_precision_days", unit::convert::to( maxSinglePrecisionTimeStep_, unit::day) ), unit::day );
|
2017-06-13 08:55:19 -05:00
|
|
|
max_strict_iter_ = param.getDefault("max_strict_iter",8);
|
2015-06-16 06:12:49 -05:00
|
|
|
solve_welleq_initially_ = param.getDefault("solve_welleq_initially",solve_welleq_initially_);
|
2015-08-27 09:58:44 -05:00
|
|
|
update_equations_scaling_ = param.getDefault("update_equations_scaling", update_equations_scaling_);
|
2016-01-15 04:30:07 -06:00
|
|
|
use_update_stabilization_ = param.getDefault("use_update_stabilization", use_update_stabilization_);
|
2016-07-12 10:53:38 -05:00
|
|
|
deck_file_name_ = param.template get<std::string>("deck_filename");
|
2015-05-24 10:33:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void BlackoilModelParameters::reset()
|
|
|
|
{
|
|
|
|
// default values for the solver parameters
|
2016-11-25 05:40:33 -06:00
|
|
|
dp_max_rel_ = 1.0;
|
2015-05-24 10:33:06 -05:00
|
|
|
ds_max_ = 0.2;
|
|
|
|
dr_max_rel_ = 1.0e9;
|
2016-10-27 08:01:44 -05:00
|
|
|
dbhp_max_rel_ = 1.0;
|
2016-11-25 05:40:33 -06:00
|
|
|
dwell_fraction_max_ = 0.2;
|
2015-05-24 10:33:06 -05:00
|
|
|
max_residual_allowed_ = 1e7;
|
|
|
|
tolerance_mb_ = 1.0e-5;
|
|
|
|
tolerance_cnv_ = 1.0e-2;
|
2017-01-31 03:50:10 -06:00
|
|
|
tolerance_wells_ = 1.0e-4;
|
2016-11-11 06:26:22 -06:00
|
|
|
tolerance_well_control_ = 1.0e-7;
|
2017-10-16 09:46:28 -05:00
|
|
|
tolerance_pressure_ms_wells_ = unit::convert::from(0.01, unit::barsa); // 0.01 bar
|
2017-10-04 06:09:49 -05:00
|
|
|
max_welleq_iter_ = 15;
|
2017-10-16 09:46:28 -05:00
|
|
|
max_pressure_change_ms_wells_ = unit::convert::from(2.0, unit::barsa); // 2.0 bar
|
2017-10-10 07:30:23 -05:00
|
|
|
use_inner_iterations_ms_wells_ = true;
|
2017-10-12 05:01:48 -05:00
|
|
|
max_inner_iter_ms_wells_ = 10;
|
2016-11-21 10:18:24 -06:00
|
|
|
maxSinglePrecisionTimeStep_ = unit::convert::from( 20.0, unit::day );
|
2015-09-03 05:38:03 -05:00
|
|
|
solve_welleq_initially_ = true;
|
2015-08-27 09:58:44 -05:00
|
|
|
update_equations_scaling_ = false;
|
2016-01-15 04:30:07 -06:00
|
|
|
use_update_stabilization_ = true;
|
2017-09-25 08:09:34 -05:00
|
|
|
use_multisegment_well_ = false;
|
2015-05-24 10:33:06 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|