mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fixes comments from PR
Don't sum ghost cells in the RateConverter Some cleaning and comments.
This commit is contained in:
parent
6bca2ea69c
commit
6146190844
@ -172,7 +172,7 @@ namespace Opm {
|
|||||||
, has_solvent_(GET_PROP_VALUE(TypeTag, EnableSolvent))
|
, has_solvent_(GET_PROP_VALUE(TypeTag, EnableSolvent))
|
||||||
, has_polymer_(GET_PROP_VALUE(TypeTag, EnablePolymer))
|
, has_polymer_(GET_PROP_VALUE(TypeTag, EnablePolymer))
|
||||||
, param_( param )
|
, param_( param )
|
||||||
, well_model_ (well_model)
|
, well_model_ (well_model)
|
||||||
, terminal_output_ (terminal_output)
|
, terminal_output_ (terminal_output)
|
||||||
, rate_converter_(rate_converter)
|
, rate_converter_(rate_converter)
|
||||||
, current_relaxation_(1.0)
|
, current_relaxation_(1.0)
|
||||||
@ -303,20 +303,20 @@ namespace Opm {
|
|||||||
perfTimer.start();
|
perfTimer.start();
|
||||||
|
|
||||||
if (param_.use_update_stabilization_) {
|
if (param_.use_update_stabilization_) {
|
||||||
// Stabilize the nonlinear update.
|
// Stabilize the nonlinear update.
|
||||||
bool isOscillate = false;
|
bool isOscillate = false;
|
||||||
bool isStagnate = false;
|
bool isStagnate = false;
|
||||||
nonlinear_solver.detectOscillations(residual_norms_history_, iteration, isOscillate, isStagnate);
|
nonlinear_solver.detectOscillations(residual_norms_history_, iteration, isOscillate, isStagnate);
|
||||||
if (isOscillate) {
|
if (isOscillate) {
|
||||||
current_relaxation_ -= nonlinear_solver.relaxIncrement();
|
current_relaxation_ -= nonlinear_solver.relaxIncrement();
|
||||||
current_relaxation_ = std::max(current_relaxation_, nonlinear_solver.relaxMax());
|
current_relaxation_ = std::max(current_relaxation_, nonlinear_solver.relaxMax());
|
||||||
if (terminalOutputEnabled()) {
|
if (terminalOutputEnabled()) {
|
||||||
std::string msg = " Oscillating behavior detected: Relaxation set to "
|
std::string msg = " Oscillating behavior detected: Relaxation set to "
|
||||||
+ std::to_string(current_relaxation_);
|
+ std::to_string(current_relaxation_);
|
||||||
OpmLog::info(msg);
|
OpmLog::info(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
nonlinear_solver.stabilizeNonlinearUpdate(x, dx_old_, current_relaxation_);
|
||||||
nonlinear_solver.stabilizeNonlinearUpdate(x, dx_old_, current_relaxation_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply the update, with considering model-dependent limitations and
|
// Apply the update, with considering model-dependent limitations and
|
||||||
@ -396,7 +396,7 @@ namespace Opm {
|
|||||||
Scalar resultDelta = 0.0;
|
Scalar resultDelta = 0.0;
|
||||||
Scalar resultDenom = 0.0;
|
Scalar resultDenom = 0.0;
|
||||||
|
|
||||||
const auto& elemMapper = ebosSimulator_.model().elementMapper();
|
const auto& elemMapper = ebosSimulator_.model().elementMapper();
|
||||||
const auto& gridView = ebosSimulator_.gridView();
|
const auto& gridView = ebosSimulator_.gridView();
|
||||||
auto elemIt = gridView.template begin</*codim=*/0>();
|
auto elemIt = gridView.template begin</*codim=*/0>();
|
||||||
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
||||||
@ -621,6 +621,7 @@ namespace Opm {
|
|||||||
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
||||||
SolutionVector& solution = ebosSimulator_.model().solution( 0 /* timeIdx */ );
|
SolutionVector& solution = ebosSimulator_.model().solution( 0 /* timeIdx */ );
|
||||||
|
|
||||||
|
// Store the initial solution.
|
||||||
if( iterationIdx == 0 )
|
if( iterationIdx == 0 )
|
||||||
{
|
{
|
||||||
ebosSimulator_.model().solution( 1 /* timeIdx */ ) = solution;
|
ebosSimulator_.model().solution( 1 /* timeIdx */ ) = solution;
|
||||||
@ -674,6 +675,7 @@ namespace Opm {
|
|||||||
// polymer
|
// polymer
|
||||||
const double dc = has_polymer_ ? dx[cell_idx][Indices::polymerConcentrationIdx] : 0.0;
|
const double dc = has_polymer_ ? dx[cell_idx][Indices::polymerConcentrationIdx] : 0.0;
|
||||||
|
|
||||||
|
// oil
|
||||||
dso = - (dsw + dsg + dss);
|
dso = - (dsw + dsg + dss);
|
||||||
|
|
||||||
// compute a scaling factor for the saturation update so that the maximum
|
// compute a scaling factor for the saturation update so that the maximum
|
||||||
|
@ -485,7 +485,11 @@ namespace Opm {
|
|||||||
elemIt != elemEndIt;
|
elemIt != elemEndIt;
|
||||||
++elemIt)
|
++elemIt)
|
||||||
{
|
{
|
||||||
|
|
||||||
const auto& elem = *elemIt;
|
const auto& elem = *elemIt;
|
||||||
|
if (elem.partitionType() != Dune::InteriorEntity)
|
||||||
|
continue;
|
||||||
|
|
||||||
elemCtx.updatePrimaryStencil(elem);
|
elemCtx.updatePrimaryStencil(elem);
|
||||||
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
||||||
const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||||
|
@ -988,6 +988,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// store the solution at the beginning of the time step
|
||||||
if( iterationIdx == 0 )
|
if( iterationIdx == 0 )
|
||||||
{
|
{
|
||||||
simulator.model().solution( 1 /* timeIdx */ ) = solution;
|
simulator.model().solution( 1 /* timeIdx */ ) = solution;
|
||||||
|
Loading…
Reference in New Issue
Block a user