mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
making the interleaved solver works for blackoil polymer simulator.
The CPR solver does not work yet. An error will be thrown if people specify to use CPR linear solver.
This commit is contained in:
@@ -234,6 +234,8 @@ namespace Opm {
|
||||
const SolutionState& state,
|
||||
WellState& xw);
|
||||
|
||||
void updateEquationsScaling();
|
||||
|
||||
void
|
||||
computeMassFlux(const int actph ,
|
||||
const V& transi,
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace Opm {
|
||||
if (!active_[Water]) {
|
||||
OPM_THROW(std::logic_error, "Polymer must solved in water!\n");
|
||||
}
|
||||
residual_.matbalscale.resize(fluid_.numPhases() + 1, 1.1169); // use the same as the water phase
|
||||
// If deck has polymer, residual_ should contain polymer equation.
|
||||
rq_.resize(fluid_.numPhases() + 1);
|
||||
residual_.material_balance_eq.resize(fluid_.numPhases() + 1, ADB::null());
|
||||
@@ -339,6 +340,26 @@ namespace Opm {
|
||||
residual_.material_balance_eq[poly_pos_] = pvdt_ * (rq_[poly_pos_].accum[1] - rq_[poly_pos_].accum[0])
|
||||
+ ops_.div*rq_[poly_pos_].mflux;
|
||||
}
|
||||
|
||||
|
||||
if (param_.update_equations_scaling_) {
|
||||
updateEquationsScaling();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template <class Grid>
|
||||
void BlackoilPolymerModel<Grid>::updateEquationsScaling()
|
||||
{
|
||||
Base::updateEquationsScaling();
|
||||
if (has_polymer_) {
|
||||
const int water_pos = fluid_.phaseUsage().phase_pos[Water];
|
||||
residual_.matbalscale[poly_pos_] = residual_.matbalscale[water_pos];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user