Merge pull request #4370 from totto82/computeCVIR

compute CVIR and CVPR
This commit is contained in:
Bård Skaflestad 2023-02-22 17:38:33 +01:00 committed by GitHub
commit 4e8381b6f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 11 deletions

View File

@ -64,7 +64,7 @@ WellInterfaceFluidSystem(const Well& well,
{
}
template<typename FluidSystem>
template <typename FluidSystem>
void
WellInterfaceFluidSystem<FluidSystem>::
calculateReservoirRates(SingleWellState& ws) const
@ -72,14 +72,32 @@ calculateReservoirRates(SingleWellState& ws) const
const int fipreg = 0; // not considering the region for now
const int np = number_of_phases_;
std::vector<double> surface_rates(np, 0.0);
for (int p = 0; p < np; ++p) {
surface_rates[p] = ws.surface_rates[p];
}
this->rateConverter_
.calcReservoirVoidageRates(fipreg,
this->pvtRegionIdx_,
ws.surface_rates,
ws.reservoir_rates);
std::vector<double> voidage_rates(np, 0.0);
rateConverter_.calcReservoirVoidageRates(fipreg, pvtRegionIdx_, surface_rates, voidage_rates);
ws.reservoir_rates = voidage_rates;
// Compute total connection reservoir rate CVPR/CVIR
auto& perf_data = ws.perf_data;
const auto num_perf_well = perf_data.size();
const auto& surf_perf_rates = perf_data.phase_rates;
for (auto i = 0*num_perf_well; i < num_perf_well; ++i) {
const auto surface_rates_perf = std::vector<double>
{ surf_perf_rates.begin() + (i + 0)*np ,
surf_perf_rates.begin() + (i + 1)*np };
std::vector<double> voidage_rates_perf(np, 0.0);
this->rateConverter_
.calcReservoirVoidageRates(fipreg,
this->pvtRegionIdx_,
surface_rates_perf,
voidage_rates_perf);
perf_data.rates[i] =
std::accumulate(voidage_rates_perf.begin(),
voidage_rates_perf.end(), 0.0);
}
}
template <typename FluidSystem>

View File

@ -48,7 +48,7 @@ add_test_compare_parallel_simulation(CASENAME spe3
SIMULATOR flow
ABS_TOL ${abs_tol_parallel}
REL_TOL ${coarse_rel_tol_parallel}
TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8)
TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --tolerance-wells=1e-7)
add_test_compare_parallel_simulation(CASENAME spe1_solvent
FILENAME SPE1CASE2_SOLVENT
@ -92,7 +92,7 @@ add_test_compare_parallel_simulation(CASENAME spe1_water
ABS_TOL ${abs_tol}
REL_TOL ${rel_tol}
DIR spe1
TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8)
TEST_ARGS --linear-solver-reduction=1e-7 --tolerance-cnv=5e-6 --tolerance-mb=1e-8 --tolerance-wells=1e-7)
add_test_compare_parallel_simulation(CASENAME spe1_brine
FILENAME SPE1CASE1_BRINE

View File

@ -69,7 +69,7 @@ add_test_compare_restarted_simulation(CASENAME msw_3d_hfa
ABS_TOL ${abs_tol_restart_msw}
REL_TOL ${rel_tol_restart_msw}
RESTART_STEP 10
TEST_ARGS --enable-adaptive-time-stepping=false --sched-restart=true)
TEST_ARGS --enable-adaptive-time-stepping=false --sched-restart=true --tolerance-wells=1e-7)
# Basic restart tests which only compare the summary output, this test driver should