addressing the comments.

This commit is contained in:
Kai Bao 2018-02-21 13:12:48 +01:00
parent 89bb589755
commit a8f560b046
3 changed files with 24 additions and 5 deletions

View File

@ -582,7 +582,13 @@ namespace Opm {
*
*
* \param[out] coeff Surface-to-reservoir conversion
* coefficients for all active phases.
* coefficients that can be used to compute total reservoir
* volumes from surface volumes with the formula
* q_{rT} = \sum_p coeff[p] q_{sp}.
* However, individual phase reservoir volumes cannot be calculated from
* these coefficients (i.e. q_{rp} is not equal to coeff[p] q_{sp})
* since they can depend on more than one surface volume rate when
* we have dissolved gas or vaporized oil.
*/
template <class Coeff>
void
@ -664,6 +670,8 @@ namespace Opm {
{
assert(voidage_rates.size() == surface_rates.size());
std::fill(voidage_rates.begin(), voidage_rates.end(), 0.0);
const auto& pu = phaseUsage_;
const auto& ra = attr_.attributes(r);
const double p = ra.pressure;

View File

@ -522,10 +522,21 @@ namespace Opm
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) && FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
const unsigned oilCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
const unsigned gasCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx);
// TODO: not sure if this is the correct way
// TODO: the formulations here remain to be tested with cases with strong crossflow through production wells
// s means standard condition, r means reservoir condition
// q_os = q_or * b_o + rv * q_gr * b_g
// q_gs = q_gr * g_g + rs * q_or * b_o
// d = 1.0 - rs * rv
// q_or = 1 / (b_o * d) * (q_os - rv * q_gs)
// q_gr = 1 / (b_g * d) * (q_gs - rs * q_os)
const double d = 1.0 - rv.value() * rs.value();
perf_vap_oil_rate = (rv.value() * cq_s[gasCompIdx].value()) / d;
perf_dis_gas_rate = (rs.value() * cq_s[oilCompIdx].value()) / d;
// vaporized oil into gas
// rv * q_gr * b_g = rv * (q_gs - rs * q_os) / d
perf_vap_oil_rate = rv.value() * (cq_s[gasCompIdx].value() - rs.value() * cq_s[oilCompIdx].value()) / d;
// dissolved of gas in oil
// rs * q_or * b_o = rs * (q_os - rv * q_gs) / d
perf_dis_gas_rate = rs.value() * (cq_s[oilCompIdx].value() - rv.value() * cq_s[gasCompIdx].value()) / d;
}
}
}

View File

@ -857,7 +857,7 @@ namespace Opm
std::vector<double> surface_rates(np, 0.0);
const int well_rate_index = np * index_of_well_;
for (int p =0; p < np; ++p) {
for (int p = 0; p < np; ++p) {
surface_rates[p] = well_state.wellRates()[well_rate_index + p];
}