mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
MultisegmentWell: move code using WellSegments to compile unit
This commit is contained in:
parent
61d485cbe5
commit
1bf36dfc08
@ -182,6 +182,27 @@ accelerationalPressureLossConsidered() const
|
|||||||
return (segmentSet().compPressureDrop() == WellSegments::CompPressureDrop::HFA);
|
return (segmentSet().compPressureDrop() == WellSegments::CompPressureDrop::HFA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
|
double
|
||||||
|
MultisegmentWellGeneric<Scalar>::getSegmentDp(const int seg,
|
||||||
|
const double density,
|
||||||
|
const std::vector<double>& seg_dp) const
|
||||||
|
{
|
||||||
|
const double segment_depth = this->segmentSet()[seg].depth();
|
||||||
|
const int outlet_segment_index = this->segmentNumberToIndex(this->segmentSet()[seg].outletSegment());
|
||||||
|
const double segment_depth_outlet = seg == 0 ? baseif_.refDepth() : this->segmentSet()[outlet_segment_index].depth();
|
||||||
|
double dp = wellhelpers::computeHydrostaticCorrection(segment_depth_outlet, segment_depth,
|
||||||
|
density, baseif_.gravity());
|
||||||
|
// we add the hydrostatic correction from the outlet segment
|
||||||
|
// in order to get the correction all the way to the bhp ref depth.
|
||||||
|
if (seg > 0) {
|
||||||
|
dp += seg_dp[outlet_segment_index];
|
||||||
|
}
|
||||||
|
|
||||||
|
return dp;
|
||||||
|
}
|
||||||
|
|
||||||
template class MultisegmentWellGeneric<double>;
|
template class MultisegmentWellGeneric<double>;
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -72,6 +72,10 @@ protected:
|
|||||||
bool accelerationalPressureLossConsidered() const;
|
bool accelerationalPressureLossConsidered() const;
|
||||||
bool frictionalPressureLossConsidered() const;
|
bool frictionalPressureLossConsidered() const;
|
||||||
|
|
||||||
|
double getSegmentDp(const int seg,
|
||||||
|
const double density,
|
||||||
|
const std::vector<double>& seg_dp) const;
|
||||||
|
|
||||||
const WellInterfaceGeneric& baseif_;
|
const WellInterfaceGeneric& baseif_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1246,20 +1246,12 @@ namespace Opm
|
|||||||
std::fill(this->ipr_b_.begin(), this->ipr_b_.end(), 0.);
|
std::fill(this->ipr_b_.begin(), this->ipr_b_.end(), 0.);
|
||||||
|
|
||||||
const int nseg = this->numberOfSegments();
|
const int nseg = this->numberOfSegments();
|
||||||
const double ref_depth = this->ref_depth_;
|
|
||||||
std::vector<double> seg_dp(nseg, 0.0);
|
std::vector<double> seg_dp(nseg, 0.0);
|
||||||
for (int seg = 0; seg < nseg; ++seg) {
|
for (int seg = 0; seg < nseg; ++seg) {
|
||||||
// calculating the perforation rate for each perforation that belongs to this segment
|
// calculating the perforation rate for each perforation that belongs to this segment
|
||||||
const double segment_depth = this->segmentSet()[seg].depth();
|
const double dp = this->getSegmentDp(seg,
|
||||||
const int outlet_segment_index = this->segmentNumberToIndex(this->segmentSet()[seg].outletSegment());
|
this->segments_.density(seg).value(),
|
||||||
const double segment_depth_outlet = seg == 0? ref_depth : this->segmentSet()[outlet_segment_index].depth();
|
seg_dp);
|
||||||
double dp = wellhelpers::computeHydrostaticCorrection(segment_depth_outlet, segment_depth,
|
|
||||||
this->segments_.density(seg).value(), this->gravity_);
|
|
||||||
// we add the hydrostatic correction from the outlet segment
|
|
||||||
// in order to get the correction all the way to the bhp ref depth.
|
|
||||||
if (seg > 0) {
|
|
||||||
dp += seg_dp[outlet_segment_index];
|
|
||||||
}
|
|
||||||
seg_dp[seg] = dp;
|
seg_dp[seg] = dp;
|
||||||
for (const int perf : this->segments_.perforations()[seg]) {
|
for (const int perf : this->segments_.perforations()[seg]) {
|
||||||
std::vector<Scalar> mob(this->num_components_, 0.0);
|
std::vector<Scalar> mob(this->num_components_, 0.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user