Merge pull request #4919 from daavid00/saltprecPermFac

Multiply well trans due to perm reduction in salt prec
This commit is contained in:
Tor Harald Sandve 2023-11-01 13:29:57 +01:00 committed by GitHub
commit d7401e3b6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 9 deletions

View File

@ -1666,6 +1666,40 @@ public:
return this->rockCompTransMultWc_[tableIdx].eval(effectiveOilPressure, SwDeltaMax, /*extrapolation=*/true); return this->rockCompTransMultWc_[tableIdx].eval(effectiveOilPressure, SwDeltaMax, /*extrapolation=*/true);
} }
/*!
* \brief Calculate the transmissibility multiplier due to porosity reduction.
*
* TODO: The API of this is a bit ad-hoc, it would be better to use context objects.
*/
template <class LhsEval>
LhsEval permFactTransMultiplier(const IntensiveQuantities& intQuants) const
{
OPM_TIMEBLOCK_LOCAL(permFactTransMultiplier);
if (!enableSaltPrecipitation)
return 1.0;
const auto& fs = intQuants.fluidState();
unsigned tableIdx = fs.pvtRegionIndex();
LhsEval porosityFactor = decay<LhsEval>(1. - fs.saltSaturation());
porosityFactor = min(porosityFactor, 1.0);
const auto& permfactTable = BrineModule::permfactTable(tableIdx);
return permfactTable.eval(porosityFactor, /*extrapolation=*/true);
}
/*!
* \brief Return the well transmissibility multiplier due to rock changues.
*/
template <class LhsEval>
LhsEval wellTransMultiplier(const IntensiveQuantities& intQuants, unsigned elementIdx) const
{
OPM_TIMEBLOCK_LOCAL(wellTransMultiplier);
double trans_mult = this->simulator().problem().template rockCompTransMultiplier<double>(intQuants, elementIdx);
trans_mult *= this->simulator().problem().template permFactTransMultiplier<double>(intQuants);
return trans_mult;
}
std::pair<BCType, RateVector> boundaryCondition(const unsigned int globalSpaceIdx, const int directionId) const std::pair<BCType, RateVector> boundaryCondition(const unsigned int globalSpaceIdx, const int directionId) const
{ {
OPM_TIMEBLOCK_LOCAL(boundaryCondition); OPM_TIMEBLOCK_LOCAL(boundaryCondition);

View File

@ -347,7 +347,7 @@ namespace Opm
// flux for each perforation // flux for each perforation
std::vector<Scalar> mob(this->num_components_, 0.); std::vector<Scalar> mob(this->num_components_, 0.);
getMobility(ebosSimulator, perf, mob, deferred_logger); getMobility(ebosSimulator, perf, mob, deferred_logger);
const double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(intQuants, cell_idx); const double trans_mult = ebosSimulator.problem().template wellTransMultiplier<double>(intQuants, cell_idx);
const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol); const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol);
const Scalar seg_pressure = segment_pressure[seg]; const Scalar seg_pressure = segment_pressure[seg];
@ -1180,7 +1180,7 @@ namespace Opm
} }
// the well index associated with the connection // the well index associated with the connection
const double trans_mult = ebos_simulator.problem().template rockCompTransMultiplier<double>(int_quantities, cell_idx); const double trans_mult = ebos_simulator.problem().template wellTransMultiplier<double>(int_quantities, cell_idx);
const auto& wellstate_nupcol = ebos_simulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebos_simulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double tw_perf = this->wellIndex(perf, int_quantities, trans_mult, wellstate_nupcol); const double tw_perf = this->wellIndex(perf, int_quantities, trans_mult, wellstate_nupcol);
std::vector<double> ipr_a_perf(this->ipr_a_.size()); std::vector<double> ipr_a_perf(this->ipr_a_.size());
@ -1680,7 +1680,7 @@ namespace Opm
const auto& int_quants = ebosSimulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/ 0); const auto& int_quants = ebosSimulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/ 0);
std::vector<EvalWell> mob(this->num_components_, 0.0); std::vector<EvalWell> mob(this->num_components_, 0.0);
getMobility(ebosSimulator, perf, mob, deferred_logger); getMobility(ebosSimulator, perf, mob, deferred_logger);
const double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(int_quants, cell_idx); const double trans_mult = ebosSimulator.problem().template wellTransMultiplier<double>(int_quants, cell_idx);
const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double Tw = this->wellIndex(perf, int_quants, trans_mult, wellstate_nupcol); const double Tw = this->wellIndex(perf, int_quants, trans_mult, wellstate_nupcol);
std::vector<EvalWell> cq_s(this->num_components_, 0.0); std::vector<EvalWell> cq_s(this->num_components_, 0.0);
@ -1993,7 +1993,7 @@ namespace Opm
const auto& int_quants = ebosSimulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/ 0); const auto& int_quants = ebosSimulator.model().intensiveQuantities(cell_idx, /*timeIdx=*/ 0);
std::vector<Scalar> mob(this->num_components_, 0.0); std::vector<Scalar> mob(this->num_components_, 0.0);
getMobility(ebosSimulator, perf, mob, deferred_logger); getMobility(ebosSimulator, perf, mob, deferred_logger);
const double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(int_quants, cell_idx); const double trans_mult = ebosSimulator.problem().template wellTransMultiplier<double>(int_quants, cell_idx);
const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double Tw = this->wellIndex(perf, int_quants, trans_mult, wellstate_nupcol); const double Tw = this->wellIndex(perf, int_quants, trans_mult, wellstate_nupcol);
std::vector<Scalar> cq_s(this->num_components_, 0.0); std::vector<Scalar> cq_s(this->num_components_, 0.0);

View File

@ -494,7 +494,7 @@ namespace Opm
getMobility(ebosSimulator, perf, mob, deferred_logger); getMobility(ebosSimulator, perf, mob, deferred_logger);
PerforationRates perf_rates; PerforationRates perf_rates;
double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(intQuants, cell_idx); double trans_mult = ebosSimulator.problem().template wellTransMultiplier<double>(intQuants, cell_idx);
const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol); const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol);
computePerfRate(intQuants, mob, bhp, Tw, perf, allow_cf, computePerfRate(intQuants, mob, bhp, Tw, perf, allow_cf,
@ -790,7 +790,7 @@ namespace Opm
} }
// the well index associated with the connection // the well index associated with the connection
const double tw_perf = this->well_index_[perf]*ebos_simulator.problem().template rockCompTransMultiplier<double>(int_quantities, cell_idx); const double tw_perf = this->well_index_[perf]*ebos_simulator.problem().template wellTransMultiplier<double>(int_quantities, cell_idx);
std::vector<double> ipr_a_perf(this->ipr_a_.size()); std::vector<double> ipr_a_perf(this->ipr_a_.size());
std::vector<double> ipr_b_perf(this->ipr_b_.size()); std::vector<double> ipr_b_perf(this->ipr_b_.size());
@ -1364,7 +1364,7 @@ namespace Opm
// flux for each perforation // flux for each perforation
std::vector<Scalar> mob(this->num_components_, 0.); std::vector<Scalar> mob(this->num_components_, 0.);
getMobility(ebosSimulator, perf, mob, deferred_logger); getMobility(ebosSimulator, perf, mob, deferred_logger);
double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(intQuants, cell_idx); double trans_mult = ebosSimulator.problem().template wellTransMultiplier<double>(intQuants, cell_idx);
const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol); const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol);
@ -1668,7 +1668,7 @@ namespace Opm
std::vector<EvalWell> cq_s(this->num_components_, {this->primary_variables_.numWellEq() + Indices::numEq, 0.}); std::vector<EvalWell> cq_s(this->num_components_, {this->primary_variables_.numWellEq() + Indices::numEq, 0.});
PerforationRates perf_rates; PerforationRates perf_rates;
double trans_mult = ebos_simulator.problem().template rockCompTransMultiplier<double>(int_quant, cell_idx); double trans_mult = ebos_simulator.problem().template wellTransMultiplier<double>(int_quant, cell_idx);
const double Tw = this->well_index_[perf] * trans_mult; const double Tw = this->well_index_[perf] * trans_mult;
computePerfRate(int_quant, mob, bhp, Tw, perf, allow_cf, cq_s, computePerfRate(int_quant, mob, bhp, Tw, perf, allow_cf, cq_s,
perf_rates, deferred_logger); perf_rates, deferred_logger);
@ -2272,7 +2272,7 @@ namespace Opm
std::vector<Scalar> mob(this->num_components_, 0.); std::vector<Scalar> mob(this->num_components_, 0.);
getMobility(ebosSimulator, perf, mob, deferred_logger); getMobility(ebosSimulator, perf, mob, deferred_logger);
std::vector<Scalar> cq_s(this->num_components_, 0.); std::vector<Scalar> cq_s(this->num_components_, 0.);
double trans_mult = ebosSimulator.problem().template rockCompTransMultiplier<double>(intQuants, cell_idx); double trans_mult = ebosSimulator.problem().template wellTransMultiplier<double>(intQuants, cell_idx);
const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_); const auto& wellstate_nupcol = ebosSimulator.problem().wellModel().nupcolWellState().well(this->index_of_well_);
const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol); const double Tw = this->wellIndex(perf, intQuants, trans_mult, wellstate_nupcol);
PerforationRates perf_rates; PerforationRates perf_rates;