Compute matbal_scale for the solvent model

The material balance scaling is extended to the solvent model
The gas value is used as default and an updateEquationsScaling() method
is added.

Minor modifications is done to the BlackoilModelBase.hpp and
BlackoilModelBase_impl.hpp in order to re-use code from the base case.
This commit is contained in:
Tor Harald Sandve 2015-09-21 14:04:41 +02:00
parent fb9e21d695
commit 6106d560ba
3 changed files with 17 additions and 4 deletions

View File

@ -948,7 +948,7 @@ namespace detail {
if (param_.update_equations_scaling_) {
updateEquationsScaling();
asImpl().updateEquationsScaling();
}
}

View File

@ -198,6 +198,7 @@ namespace Opm {
void computeWellConnectionPressures(const SolutionState& state,
const WellState& xw);
void updateEquationsScaling();
void
computeMassFlux(const int actph ,

View File

@ -98,6 +98,9 @@ namespace Opm {
if (has_vapoil_) {
OPM_THROW(std::runtime_error, "Solvent option only works with dead gas\n");
}
residual_.matbalscale.resize(fluid_.numPhases() + 1, 0.0031); // use the same as gas
}
}
@ -224,9 +227,18 @@ namespace Opm {
}
template <class Grid>
void
BlackoilSolventModel<Grid>::updateEquationsScaling()
{
Base::updateEquationsScaling();
assert(MaxNumPhases + 1 == resdual.matbalscale.size());
if (has_solvent_) {
const ADB& temp_b = rq_[solvent_pos_].b;
ADB::V B = 1. / temp_b.value();
residual_.matbalscale[solvent_pos_] = B.mean();
}
}
template <class Grid>
void BlackoilSolventModel<Grid>::addWellContributionToMassBalanceEq(const std::vector<ADB>& cq_s,