mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-07 23:13:01 -06:00
MultisegmentWell: move updateUpwindingSegments to MultisegmentWellPrimaryVariables
This commit is contained in:
parent
37607c570a
commit
e1cd54b267
@ -1057,31 +1057,6 @@ getResidualMeasureValue(const WellState& well_state,
|
||||
return sum;
|
||||
}
|
||||
|
||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
||||
void
|
||||
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
||||
updateUpwindingSegments()
|
||||
{
|
||||
for (int seg = 0; seg < this->numberOfSegments(); ++seg) {
|
||||
// special treatment is needed for segment 0
|
||||
if (seg == 0) {
|
||||
// we are not supposed to have injecting producers and producing injectors
|
||||
assert( ! (baseif_.isProducer() && primary_variables_.evaluation_[seg][WQTotal] > 0.) );
|
||||
assert( ! (baseif_.isInjector() && primary_variables_.evaluation_[seg][WQTotal] < 0.) );
|
||||
upwinding_segments_[seg] = seg;
|
||||
continue;
|
||||
}
|
||||
|
||||
// for other normal segments
|
||||
if (primary_variables_.evaluation_[seg][WQTotal] <= 0.) {
|
||||
upwinding_segments_[seg] = seg;
|
||||
} else {
|
||||
const int outlet_segment_index = this->segmentNumberToIndex(this->segmentSet()[seg].outletSegment());
|
||||
upwinding_segments_[seg] = outlet_segment_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define INSTANCE(...) \
|
||||
template class MultisegmentWellEval<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||
|
||||
|
@ -131,8 +131,6 @@ protected:
|
||||
const double relaxed_inner_tolerance_pressure_ms_well,
|
||||
const bool relax_tolerance) const;
|
||||
|
||||
void updateUpwindingSegments();
|
||||
|
||||
void computeSegmentFluidProperties(const EvalWell& temperature,
|
||||
const EvalWell& saltConcentration,
|
||||
int pvt_region_index,
|
||||
|
@ -600,6 +600,31 @@ getWQTotal() const
|
||||
return evaluation_[0][WQTotal];
|
||||
}
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
void MultisegmentWellPrimaryVariables<FluidSystem,Indices,Scalar>::
|
||||
updateUpwindingSegments(const MultisegmentWellGeneric<Scalar>& mswell,
|
||||
std::vector<int>& upwinding_segments) const
|
||||
{
|
||||
for (size_t seg = 0; seg < value_.size(); ++seg) {
|
||||
// special treatment is needed for segment 0
|
||||
if (seg == 0) {
|
||||
// we are not supposed to have injecting producers and producing injectors
|
||||
assert(!(well_.isProducer() && evaluation_[seg][WQTotal] > 0.));
|
||||
assert(!(well_.isInjector() && evaluation_[seg][WQTotal] < 0.));
|
||||
upwinding_segments[seg] = seg;
|
||||
continue;
|
||||
}
|
||||
|
||||
// for other normal segments
|
||||
if (evaluation_[seg][WQTotal] <= 0.) {
|
||||
upwinding_segments[seg] = seg;
|
||||
} else {
|
||||
const int outlet_segment_index = mswell.segmentNumberToIndex(mswell.segmentSet()[seg].outletSegment());
|
||||
upwinding_segments[seg] = outlet_segment_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define INSTANCE(...) \
|
||||
template class MultisegmentWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||
|
||||
|
@ -133,6 +133,10 @@ public:
|
||||
//! \brief Get WQTotal.
|
||||
EvalWell getWQTotal() const;
|
||||
|
||||
//! \brief Update upwinding segments.
|
||||
void updateUpwindingSegments(const MultisegmentWellGeneric<Scalar>& mswell,
|
||||
std::vector<int>& upwinding_segments) const;
|
||||
|
||||
// the values for the primary varibles
|
||||
// based on different solutioin strategies, the wells can have different primary variables
|
||||
std::vector<std::array<double, numWellEq> > value_;
|
||||
|
@ -1526,11 +1526,11 @@ namespace Opm
|
||||
const GroupState& group_state,
|
||||
DeferredLogger& deferred_logger)
|
||||
{
|
||||
|
||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
|
||||
|
||||
// update the upwinding segments
|
||||
this->updateUpwindingSegments();
|
||||
this->primary_variables_.updateUpwindingSegments(*this,
|
||||
this->upwinding_segments_);
|
||||
|
||||
// calculate the fluid properties needed.
|
||||
computeSegmentFluidProperties(ebosSimulator, deferred_logger);
|
||||
|
Loading…
Reference in New Issue
Block a user