mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Move polymer code extraAddWellEq -> addWellContributionToMassBalanceEq.
This commit is contained in:
@@ -207,12 +207,9 @@ namespace Opm {
|
|||||||
assembleMassBalanceEq(const SolutionState& state);
|
assembleMassBalanceEq(const SolutionState& state);
|
||||||
|
|
||||||
void
|
void
|
||||||
extraAddWellEq(const SolutionState& state,
|
addWellContributionToMassBalanceEq(const SolutionState& state,
|
||||||
const WellState& xw,
|
const WellState& xw,
|
||||||
const std::vector<ADB>& cq_ps,
|
const std::vector<ADB>& cq_s);
|
||||||
const std::vector<ADB>& cmix_s,
|
|
||||||
const ADB& cqt_is,
|
|
||||||
const std::vector<int>& well_cells);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
computeMassFlux(const int actph ,
|
computeMassFlux(const int actph ,
|
||||||
|
|||||||
@@ -279,23 +279,25 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
template <class Grid>
|
template <class Grid>
|
||||||
void BlackoilPolymerModel<Grid>::extraAddWellEq(const SolutionState& state,
|
void BlackoilPolymerModel<Grid>::addWellContributionToMassBalanceEq(const SolutionState& state,
|
||||||
const WellState& xw,
|
const WellState& xw,
|
||||||
const std::vector<ADB>& cq_ps,
|
const std::vector<ADB>& cq_s)
|
||||||
const std::vector<ADB>& cmix_s,
|
|
||||||
const ADB& cqt_is,
|
|
||||||
const std::vector<int>& well_cells)
|
|
||||||
{
|
{
|
||||||
|
Base::addWellContributionToMassBalanceEq(state, xw, cq_s);
|
||||||
|
|
||||||
// Add well contributions to polymer mass balance equation
|
// Add well contributions to polymer mass balance equation
|
||||||
if (has_polymer_) {
|
if (has_polymer_) {
|
||||||
const ADB mc = computeMc(state);
|
const ADB mc = computeMc(state);
|
||||||
const int nc = xw.polymerInflow().size();
|
const int nc = xw.polymerInflow().size();
|
||||||
const V polyin = Eigen::Map<const V>(xw.polymerInflow().data(), nc);
|
const V polyin = Eigen::Map<const V>(xw.polymerInflow().data(), nc);
|
||||||
|
const int nperf = wells().well_connpos[wells().number_of_wells];
|
||||||
|
const std::vector<int> well_cells(wells().well_cells, wells().well_cells + nperf);
|
||||||
const V poly_in_perf = subset(polyin, well_cells);
|
const V poly_in_perf = subset(polyin, well_cells);
|
||||||
const V poly_mc_perf = subset(mc, well_cells).value();
|
const V poly_mc_perf = subset(mc.value(), well_cells);
|
||||||
const PhaseUsage& pu = fluid_.phaseUsage();
|
const ADB& cq_s_water = cq_s[fluid_.phaseUsage().phase_pos[Water]];
|
||||||
const ADB cq_s_poly = cq_ps[pu.phase_pos[Water]] * poly_mc_perf
|
Selector<double> injector_selector(cq_s_water.value());
|
||||||
+ cmix_s[pu.phase_pos[Water]] * cqt_is * poly_in_perf;
|
const V poly_perf = injector_selector.select(poly_in_perf, poly_mc_perf);
|
||||||
|
const ADB cq_s_poly = cq_s_water * poly_perf;
|
||||||
residual_.material_balance_eq[poly_pos_] -= superset(cq_s_poly, well_cells, nc);
|
residual_.material_balance_eq[poly_pos_] -= superset(cq_s_poly, well_cells, nc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user