22#ifndef OPM_MULTISEGMENTWELL_SEGMENTS_HEADER_INCLUDED
23#define OPM_MULTISEGMENTWELL_SEGMENTS_HEADER_INCLUDED
34 template<
class Scalar>
class SegmentState;
36 template<
typename Scalar,
typename IndexTraits>
class WellInterfaceGeneric;
43template<
typename Flu
idSystem,
typename Indices>
47 using Scalar =
typename FluidSystem::Scalar;
49 using IndexTraits =
typename FluidSystem::IndexTraitsType;
51 static constexpr bool enable_energy = Indices::enableFullyImplicitThermal;
59 const Scalar firstPerfSaltConcentration,
67 const int seg_side)
const;
71 const int local_perf_index)
const;
74 const Scalar firstPerfSaltConcentration,
80 const bool extra_reverse_flow_derivatives =
false)
const;
84 const bool extra_reverse_flow_derivatives =
false)
const;
88 const UnitSystem& unit_system,
89 const bool extra_reverse_flow_derivatives =
false)
const;
93 const SummaryState& st,
94 const bool extra_reverse_flow_derivatives =
false)
const;
99 const bool extra_reverse_flow_derivatives =
false)
const;
101 const std::vector<std::vector<int>>&
inlets()
const
106 const std::vector<int>&
inlets(
const int seg)
const
113 return perforations_;
118 return upwinding_segments_[seg];
123 return densities_[0].value();
128 return densities_[seg];
133 return local_perforation_depth_diffs_[local_perf_index];
148 std::vector<std::vector<int>> perforations_;
156 std::vector<Scalar> local_perforation_depth_diffs_;
159 std::vector<std::vector<int>> inlets_;
161 std::vector<Scalar> depth_diffs_;
163 std::vector<Scalar> surface_densities_;
167 std::vector<EvalWell> densities_;
170 std::vector<EvalWell> mass_rates_;
173 std::vector<EvalWell> viscosities_;
176 std::vector<int> upwinding_segments_;
178 std::vector<std::vector<EvalWell>> phase_densities_;
179 std::vector<std::vector<EvalWell>> phase_fractions_;
180 std::vector<std::vector<EvalWell>> phase_viscosities_;
185 const std::size_t stride,
188 Scalar mixtureDensity(
const int seg)
const;
189 Scalar mixtureDensityWithExponents(
const int seg)
const;
190 Scalar mixtureDensityWithExponents(
const AutoICD& aicd,
const int seg)
const;
193 struct PhaseCalcResult {
194 explicit PhaseCalcResult(
const std::size_t num_quantities)
195 : b(num_quantities, 0.0)
196 , mix(num_quantities, 0.0)
197 , mix_s(num_quantities, 0.0)
198 , phase_viscosities(num_quantities, 0.0)
199 , phase_densities(num_quantities, 0.0)
204 std::vector<EvalWell> b;
205 std::vector<EvalWell> mix;
206 std::vector<EvalWell> mix_s;
207 std::vector<EvalWell> phase_viscosities;
208 std::vector<EvalWell> phase_densities;
209 EvalWell vol_ratio{0.};
212 void calculatePhaseProperties(PhaseCalcResult& result,
213 const EvalWell& temperature,
214 const EvalWell& saltConcentration,
215 const PrimaryVariables& primary_variables,
217 bool update_visc_and_den,
218 DeferredLogger& deferred_logger)
const;
Definition: DeferredLogger.hpp:57
Definition: MultisegmentWellPrimaryVariables.hpp:45
DenseAd::Evaluation< Scalar, Indices::numEq+numWellEq > EvalWell
Definition: MultisegmentWellPrimaryVariables.hpp:79
Definition: MultisegmentWellSegments.hpp:45
void computeFluidProperties(const Scalar firstPerfTemperature, const Scalar firstPerfSaltConcentration, const PrimaryVariables &primary_variables, DeferredLogger &deferred_logger)
EvalWell pressureDropAutoICD(const int seg, const UnitSystem &unit_system, const bool extra_reverse_flow_derivatives=false) const
EvalWell getSurfaceVolume(const Scalar firstPerfTemperature, const Scalar firstPerfSaltConcentration, const PrimaryVariables &primary_variables, const int seg_idx, DeferredLogger &deferred_logger) const
EvalWell pressureDropValve(const int seg, const SummaryState &st, const bool extra_reverse_flow_derivatives=false) const
void copyPhaseDensities(SegmentState< Scalar > &segSol) const
EvalWell accelerationPressureLossContribution(const int seg, const Scalar area, const bool extra_reverse_flow_derivatives=false) const
const std::vector< std::vector< int > > & inlets() const
Definition: MultisegmentWellSegments.hpp:101
EvalWell getHydroPressureLoss(const int seg, const int seg_side) const
const EvalWell & density(const int seg) const
Definition: MultisegmentWellSegments.hpp:126
Scalar getPressureDiffSegLocalPerf(const int seg, const int local_perf_index) const
Pressure difference between segment and perforation.
Scalar getRefDensity() const
Definition: MultisegmentWellSegments.hpp:121
void updateUpwindingSegments(const PrimaryVariables &primary_variables)
Update upwinding segments.
EvalWell getFrictionPressureLoss(const int seg, const bool extra_reverse_flow_derivatives=false) const
const std::vector< std::vector< int > > & perforations() const
Definition: MultisegmentWellSegments.hpp:111
MultisegmentWellSegments(const int numSegments, const ParallelWellInfo< Scalar > ¶llel_well_info, WellInterfaceGeneric< Scalar, IndexTraits > &well)
int upwinding_segment(const int seg) const
Definition: MultisegmentWellSegments.hpp:116
Scalar local_perforation_depth_diff(const int local_perf_index) const
Definition: MultisegmentWellSegments.hpp:131
const std::vector< int > & inlets(const int seg) const
Definition: MultisegmentWellSegments.hpp:106
EvalWell pressureDropSpiralICD(const int seg, const bool extra_reverse_flow_derivatives=false) const
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:198
Definition: SegmentState.hpp:34
Definition: WellInterfaceGeneric.hpp:55
Definition: blackoilbioeffectsmodules.hh:45