mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3716 from totto82/moveGetPerfCellPressureToInterface
Move getPerfCellPressure to wellInterface
This commit is contained in:
commit
44faf036c9
@ -887,7 +887,7 @@ namespace Opm
|
||||
{
|
||||
const auto& fs = int_quants.fluidState();
|
||||
|
||||
const EvalWell pressure_cell = this->extendEval(fs.pressure(FluidSystem::oilPhaseIdx));
|
||||
const EvalWell pressure_cell = this->extendEval(this->getPerfCellPressure(fs));
|
||||
const EvalWell rs = this->extendEval(fs.Rs());
|
||||
const EvalWell rv = this->extendEval(fs.Rv());
|
||||
|
||||
@ -944,7 +944,7 @@ namespace Opm
|
||||
{
|
||||
const auto& fs = int_quants.fluidState();
|
||||
|
||||
const Scalar pressure_cell = getValue(fs.pressure(FluidSystem::oilPhaseIdx));
|
||||
const Scalar pressure_cell = getValue(this->getPerfCellPressure(fs));
|
||||
const Scalar rs = getValue(fs.Rs());
|
||||
const Scalar rv = getValue(fs.Rv());
|
||||
|
||||
@ -1225,7 +1225,7 @@ namespace Opm
|
||||
const double perf_seg_press_diff = this->gravity_ * this->segment_densities_[seg].value() * this->perforation_segment_depth_diffs_[perf];
|
||||
// pressure difference between the perforation and the grid cell
|
||||
const double cell_perf_press_diff = this->cell_perforation_pressure_diffs_[perf];
|
||||
const double pressure_cell = fs.pressure(FluidSystem::oilPhaseIdx).value();
|
||||
const double pressure_cell = this->getPerfCellPressure(fs).value();
|
||||
|
||||
// calculating the b for the connection
|
||||
std::vector<double> b_perf(this->num_components_);
|
||||
@ -1674,7 +1674,7 @@ namespace Opm
|
||||
// pressure difference between the perforation and the grid cell
|
||||
const double cell_perf_press_diff = this->cell_perforation_pressure_diffs_[perf];
|
||||
|
||||
const double pressure_cell = (fs.pressure(FluidSystem::oilPhaseIdx)).value();
|
||||
const double pressure_cell = this->getPerfCellPressure(fs).value();
|
||||
const double perf_press = pressure_cell - cell_perf_press_diff;
|
||||
// Pressure drawdown (also used to determine direction of flow)
|
||||
// TODO: not 100% sure about the sign of the seg_perf_press_diff
|
||||
@ -1844,7 +1844,7 @@ namespace Opm
|
||||
const int cell_idx = this->well_cells_[perf];
|
||||
const auto& int_quants = *(ebos_simulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/ 0));
|
||||
const auto& fs = int_quants.fluidState();
|
||||
double pressure_cell = fs.pressure(FluidSystem::oilPhaseIdx).value();
|
||||
double pressure_cell = this->getPerfCellPressure(fs).value();
|
||||
max_pressure = std::max(max_pressure, pressure_cell);
|
||||
}
|
||||
}
|
||||
|
@ -263,8 +263,6 @@ namespace Opm
|
||||
|
||||
|
||||
protected:
|
||||
Eval getPerfCellPressure(const FluidState& fs) const;
|
||||
|
||||
// xw = inv(D)*(rw - C*x)
|
||||
void recoverSolutionWell(const BVector& x, BVectorWell& xw) const;
|
||||
|
||||
|
@ -82,24 +82,6 @@ namespace Opm
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
typename StandardWell<TypeTag>::Eval
|
||||
StandardWell<TypeTag>::getPerfCellPressure(const typename StandardWell<TypeTag>::FluidState& fs) const
|
||||
{
|
||||
Eval pressure;
|
||||
if (Indices::oilEnabled) {
|
||||
pressure = fs.pressure(FluidSystem::oilPhaseIdx);
|
||||
} else {
|
||||
if (Indices::waterEnabled) {
|
||||
pressure = fs.pressure(FluidSystem::waterPhaseIdx);
|
||||
} else {
|
||||
pressure = fs.pressure(FluidSystem::gasPhaseIdx);
|
||||
}
|
||||
}
|
||||
return pressure;
|
||||
}
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
StandardWell<TypeTag>::
|
||||
@ -115,7 +97,7 @@ namespace Opm
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
const auto& fs = intQuants.fluidState();
|
||||
const EvalWell pressure = this->extendEval(getPerfCellPressure(fs));
|
||||
const EvalWell pressure = this->extendEval(this->getPerfCellPressure(fs));
|
||||
const EvalWell rs = this->extendEval(fs.Rs());
|
||||
const EvalWell rv = this->extendEval(fs.Rv());
|
||||
std::vector<EvalWell> b_perfcells_dense(this->num_components_, EvalWell{this->numWellEq_ + Indices::numEq, 0.0});
|
||||
@ -182,7 +164,7 @@ namespace Opm
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
const auto& fs = intQuants.fluidState();
|
||||
const Scalar pressure = getPerfCellPressure(fs).value();
|
||||
const Scalar pressure = this->getPerfCellPressure(fs).value();
|
||||
const Scalar rs = fs.Rs().value();
|
||||
const Scalar rv = fs.Rv().value();
|
||||
std::vector<Scalar> b_perfcells_dense(this->num_components_, 0.0);
|
||||
@ -964,8 +946,7 @@ namespace Opm
|
||||
const auto& int_quantities = *(ebos_simulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/ 0));
|
||||
const auto& fs = int_quantities.fluidState();
|
||||
// the pressure of the reservoir grid block the well connection is in
|
||||
Eval perf_pressure = getPerfCellPressure(fs);
|
||||
double p_r = perf_pressure.value();
|
||||
double p_r = this->getPerfCellPressure(fs).value();
|
||||
|
||||
// calculating the b for the connection
|
||||
std::vector<double> b_perf(this->num_components_);
|
||||
@ -1145,7 +1126,7 @@ namespace Opm
|
||||
const auto& intQuants = *(ebos_simulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/0));
|
||||
const auto& fs = intQuants.fluidState();
|
||||
|
||||
const double pressure = (fs.pressure(FluidSystem::oilPhaseIdx)).value();
|
||||
const double pressure = this->getPerfCellPressure(fs).value();
|
||||
const double bhp = this->getBhp().value();
|
||||
|
||||
// Pressure drawdown (also used to determine direction of flow)
|
||||
|
@ -332,6 +332,9 @@ protected:
|
||||
bool solveWellForTesting(const Simulator& ebosSimulator, WellState& well_state, const GroupState& group_state,
|
||||
DeferredLogger& deferred_logger);
|
||||
|
||||
Eval getPerfCellPressure(const FluidState& fs) const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1024,6 +1024,20 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
typename WellInterface<TypeTag>::Eval
|
||||
WellInterface<TypeTag>::getPerfCellPressure(const typename WellInterface<TypeTag>::FluidState& fs) const
|
||||
{
|
||||
Eval pressure;
|
||||
if (Indices::oilEnabled) {
|
||||
pressure = fs.pressure(FluidSystem::oilPhaseIdx);
|
||||
} else {
|
||||
if (Indices::waterEnabled) {
|
||||
pressure = fs.pressure(FluidSystem::waterPhaseIdx);
|
||||
} else {
|
||||
pressure = fs.pressure(FluidSystem::gasPhaseIdx);
|
||||
}
|
||||
}
|
||||
return pressure;
|
||||
}
|
||||
} // namespace Opm
|
||||
|
Loading…
Reference in New Issue
Block a user