mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: simplify computePerfRate signatures
pass a PerforationRates ref instead of multiple references to doubles
This commit is contained in:
parent
9bfe835652
commit
f06cc1f626
@ -205,8 +205,7 @@ namespace Opm
|
||||
const bool& allow_cf,
|
||||
std::vector<EvalWell>& cq_s,
|
||||
EvalWell& perf_press,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_vap_oil_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
template<class Value>
|
||||
@ -223,8 +222,7 @@ namespace Opm
|
||||
const std::vector<Value>& cmix_s,
|
||||
std::vector<Value>& cq_s,
|
||||
Value& perf_press,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_vap_oil_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
// compute the fluid properties, such as densities, viscosities, and so on, in the segments
|
||||
|
@ -769,8 +769,7 @@ namespace Opm
|
||||
const std::vector<Value>& cmix_s,
|
||||
std::vector<Value>& cq_s,
|
||||
Value& perf_press,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_vap_oil_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
// pressure difference between the segment and the perforation
|
||||
@ -887,10 +886,10 @@ namespace Opm
|
||||
const double d = 1.0 - getValue(rv) * getValue(rs);
|
||||
// vaporized oil into gas
|
||||
// rv * q_gr * b_g = rv * (q_gs - rs * q_os) / d
|
||||
perf_vap_oil_rate = getValue(rv) * (getValue(cq_s[gasCompIdx]) - getValue(rs) * getValue(cq_s[oilCompIdx])) / d;
|
||||
perf_rates.vap_oil = getValue(rv) * (getValue(cq_s[gasCompIdx]) - getValue(rs) * getValue(cq_s[oilCompIdx])) / d;
|
||||
// dissolved of gas in oil
|
||||
// rs * q_or * b_o = rs * (q_os - rv * q_gs) / d
|
||||
perf_dis_gas_rate = getValue(rs) * (getValue(cq_s[oilCompIdx]) - getValue(rv) * getValue(cq_s[gasCompIdx])) / d;
|
||||
perf_rates.dis_gas = getValue(rs) * (getValue(cq_s[oilCompIdx]) - getValue(rv) * getValue(cq_s[gasCompIdx])) / d;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -907,8 +906,7 @@ namespace Opm
|
||||
const bool& allow_cf,
|
||||
std::vector<EvalWell>& cq_s,
|
||||
EvalWell& perf_press,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_vap_oil_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const
|
||||
|
||||
{
|
||||
@ -948,8 +946,7 @@ namespace Opm
|
||||
cmix_s,
|
||||
cq_s,
|
||||
perf_press,
|
||||
perf_dis_gas_rate,
|
||||
perf_vap_oil_rate,
|
||||
perf_rates,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
@ -1008,8 +1005,7 @@ namespace Opm
|
||||
cmix_s,
|
||||
cq_s,
|
||||
perf_press,
|
||||
perf_rates.dis_gas,
|
||||
perf_rates.vap_oil,
|
||||
perf_rates,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
@ -1622,9 +1618,7 @@ namespace Opm
|
||||
EvalWell perf_press;
|
||||
PerforationRates perfRates;
|
||||
computePerfRateEval(int_quants, mob, Tw, seg, perf, seg_pressure,
|
||||
allow_cf, cq_s, perf_press,
|
||||
perfRates.dis_gas,
|
||||
perfRates.vap_oil, deferred_logger);
|
||||
allow_cf, cq_s, perf_press, perfRates, deferred_logger);
|
||||
|
||||
// updating the solution gas rate and solution oil rate
|
||||
if (this->isProducer()) {
|
||||
|
@ -295,10 +295,7 @@ namespace Opm
|
||||
const int perf,
|
||||
const bool allow_cf,
|
||||
std::vector<EvalWell>& cq_s,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_dis_gas_rate_in_water,
|
||||
double& perf_vap_oil_rate,
|
||||
double& perf_vap_wat_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
void computePerfRateScalar(const IntensiveQuantities& intQuants,
|
||||
@ -325,10 +322,7 @@ namespace Opm
|
||||
const Value& skin_pressure,
|
||||
const std::vector<Value>& cmix_s,
|
||||
std::vector<Value>& cq_s,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_dis_gas_rate_in_water,
|
||||
double& perf_vap_oil_rate,
|
||||
double& perf_vap_wat_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
void computeWellRatesWithBhpIterations(const Simulator& ebosSimulator,
|
||||
|
@ -100,10 +100,7 @@ namespace Opm
|
||||
const int perf,
|
||||
const bool allow_cf,
|
||||
std::vector<EvalWell>& cq_s,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_dis_gas_rate_in_water,
|
||||
double& perf_vap_oil_rate,
|
||||
double& perf_vap_wat_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
const auto& fs = intQuants.fluidState();
|
||||
@ -162,10 +159,7 @@ namespace Opm
|
||||
skin_pressure,
|
||||
cmix_s,
|
||||
cq_s,
|
||||
perf_dis_gas_rate,
|
||||
perf_dis_gas_rate_in_water,
|
||||
perf_vap_oil_rate,
|
||||
perf_vap_wat_rate,
|
||||
perf_rates,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
@ -237,10 +231,7 @@ namespace Opm
|
||||
skin_pressure,
|
||||
cmix_s,
|
||||
cq_s,
|
||||
perf_rates.dis_gas,
|
||||
perf_rates.dis_gas_in_water,
|
||||
perf_rates.vap_oil,
|
||||
perf_rates.vap_wat,
|
||||
perf_rates,
|
||||
deferred_logger);
|
||||
}
|
||||
|
||||
@ -262,10 +253,7 @@ namespace Opm
|
||||
const Value& skin_pressure,
|
||||
const std::vector<Value>& cmix_s,
|
||||
std::vector<Value>& cq_s,
|
||||
double& perf_dis_gas_rate,
|
||||
double& perf_dis_gas_rate_in_water,
|
||||
double& perf_vap_oil_rate,
|
||||
double& perf_vap_wat_rate,
|
||||
PerforationRates& perf_rates,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
// Pressure drawdown (also used to determine direction of flow)
|
||||
@ -301,8 +289,8 @@ namespace Opm
|
||||
|
||||
// recording the perforation solution gas rate and solution oil rates
|
||||
if (this->isProducer()) {
|
||||
perf_dis_gas_rate = getValue(dis_gas);
|
||||
perf_vap_oil_rate = getValue(vap_oil);
|
||||
perf_rates.dis_gas = getValue(dis_gas);
|
||||
perf_rates.vap_oil = getValue(vap_oil);
|
||||
}
|
||||
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
@ -310,7 +298,7 @@ namespace Opm
|
||||
const Value vap_wat = rvw * cq_sGas;
|
||||
cq_s[waterCompIdx] += vap_wat;
|
||||
if (this->isProducer())
|
||||
perf_vap_wat_rate = getValue(vap_wat);
|
||||
perf_rates.vap_wat = getValue(vap_wat);
|
||||
}
|
||||
} else if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
||||
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
||||
@ -322,8 +310,8 @@ namespace Opm
|
||||
cq_s[waterCompIdx] += vap_wat;
|
||||
cq_s[gasCompIdx] += dis_gas_wat;
|
||||
if (this->isProducer()) {
|
||||
perf_vap_wat_rate = getValue(vap_wat);
|
||||
perf_dis_gas_rate_in_water = getValue(dis_gas_wat);
|
||||
perf_rates.vap_wat = getValue(vap_wat);
|
||||
perf_rates.dis_gas_in_water = getValue(dis_gas_wat);
|
||||
}
|
||||
}
|
||||
|
||||
@ -443,25 +431,25 @@ namespace Opm
|
||||
} else {
|
||||
// vaporized oil into gas
|
||||
// rv * q_gr * b_g = rv * (q_gs - rs * q_os) / d
|
||||
perf_vap_oil_rate = getValue(rv) * (getValue(cq_s[gasCompIdx]) - getValue(rs) * getValue(cq_s[oilCompIdx])) / d;
|
||||
perf_rates.vap_oil = getValue(rv) * (getValue(cq_s[gasCompIdx]) - getValue(rs) * getValue(cq_s[oilCompIdx])) / d;
|
||||
// dissolved of gas in oil
|
||||
// rs * q_or * b_o = rs * (q_os - rv * q_gs) / d
|
||||
perf_dis_gas_rate = getValue(rs) * (getValue(cq_s[oilCompIdx]) - getValue(rv) * getValue(cq_s[gasCompIdx])) / d;
|
||||
perf_rates.dis_gas = getValue(rs) * (getValue(cq_s[oilCompIdx]) - getValue(rv) * getValue(cq_s[gasCompIdx])) / d;
|
||||
}
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
// q_ws = q_wr * b_w + rvw * q_gr * b_g
|
||||
// q_wr = 1 / b_w * (q_ws - rvw * q_gr * b_g) = 1 / b_w * (q_ws - rvw * 1 / d (q_gs - rs * q_os))
|
||||
// vaporized water in gas
|
||||
// rvw * q_gr * b_g = q_ws -q_wr *b_w = rvw * (q_gs -rs *q_os) / d
|
||||
perf_vap_wat_rate = getValue(rvw) * (getValue(cq_s[gasCompIdx]) - getValue(rs) * getValue(cq_s[oilCompIdx])) / d;
|
||||
perf_rates.vap_wat = getValue(rvw) * (getValue(cq_s[gasCompIdx]) - getValue(rs) * getValue(cq_s[oilCompIdx])) / d;
|
||||
}
|
||||
}
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) && FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
//no oil
|
||||
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
|
||||
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
|
||||
perf_vap_wat_rate = getValue(rvw) * getValue(cq_s[gasCompIdx]);
|
||||
perf_dis_gas_rate_in_water = getValue(rsw) * getValue(cq_s[waterCompIdx]);
|
||||
perf_rates.vap_wat = getValue(rvw) * getValue(cq_s[gasCompIdx]);
|
||||
perf_rates.dis_gas_in_water = getValue(rsw) * getValue(cq_s[waterCompIdx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -643,11 +631,7 @@ namespace Opm
|
||||
double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(intQuants, cell_idx);
|
||||
const double Tw = this->well_index_[perf] * trans_mult;
|
||||
computePerfRateEval(intQuants, mob, bhp, Tw, perf, allow_cf,
|
||||
cq_s,
|
||||
perf_rates.dis_gas,
|
||||
perf_rates.dis_gas_in_water,
|
||||
perf_rates.vap_oil,
|
||||
perf_rates.vap_wat, deferred_logger);
|
||||
cq_s, perf_rates, deferred_logger);
|
||||
|
||||
auto& ws = well_state.well(this->index_of_well_);
|
||||
auto& perf_data = ws.perf_data;
|
||||
@ -2052,10 +2036,7 @@ namespace Opm
|
||||
double trans_mult = ebos_simulator.problem().template rockCompTransMultiplier<double>(int_quant, cell_idx);
|
||||
const double Tw = this->well_index_[perf] * trans_mult;
|
||||
computePerfRateEval(int_quant, mob, bhp, Tw, perf, allow_cf, cq_s,
|
||||
perf_rates.dis_gas,
|
||||
perf_rates.dis_gas_in_water,
|
||||
perf_rates.vap_oil,
|
||||
perf_rates.vap_wat, deferred_logger);
|
||||
perf_rates, deferred_logger);
|
||||
// TODO: make area a member
|
||||
const double area = 2 * M_PI * this->perf_rep_radius_[perf] * this->perf_length_[perf];
|
||||
const auto& material_law_manager = ebos_simulator.problem().materialLawManager();
|
||||
|
Loading…
Reference in New Issue
Block a user