mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-25 08:41:00 -06:00
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:
parent
fb9e21d695
commit
6106d560ba
@ -948,7 +948,7 @@ namespace detail {
|
||||
|
||||
|
||||
if (param_.update_equations_scaling_) {
|
||||
updateEquationsScaling();
|
||||
asImpl().updateEquationsScaling();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -198,6 +198,7 @@ namespace Opm {
|
||||
void computeWellConnectionPressures(const SolutionState& state,
|
||||
const WellState& xw);
|
||||
|
||||
void updateEquationsScaling();
|
||||
|
||||
void
|
||||
computeMassFlux(const int actph ,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user