22 #ifndef OPM_MULTISEGMENTWELL_SEGMENTS_HEADER_INCLUDED 23 #define OPM_MULTISEGMENTWELL_SEGMENTS_HEADER_INCLUDED 25 #include <opm/simulators/wells/MultisegmentWellPrimaryVariables.hpp> 26 #include <opm/simulators/wells/ParallelWellInfo.hpp> 43 template<
typename Flu
idSystem,
typename Indices>
47 using Scalar =
typename FluidSystem::Scalar;
48 using EvalWell =
typename PrimaryVariables::EvalWell;
49 using IndexTraits =
typename FluidSystem::IndexTraitsType;
51 static constexpr
bool enable_energy = Indices::enableFullyImplicitThermal;
58 void computeFluidProperties(
const Scalar firstPerfTemperature,
59 const Scalar firstPerfSaltConcentration,
66 EvalWell getHydroPressureLoss(
const int seg,
67 const int seg_side)
const;
71 const int local_perf_index)
const;
73 EvalWell getSurfaceVolume(
const Scalar firstPerfTemperature,
74 const Scalar firstPerfSaltConcentration,
79 EvalWell getFrictionPressureLoss(
const int seg,
80 const bool extra_reverse_flow_derivatives =
false)
const;
83 EvalWell pressureDropSpiralICD(
const int seg,
84 const bool extra_reverse_flow_derivatives =
false)
const;
87 EvalWell pressureDropAutoICD(
const int seg,
88 const UnitSystem& unit_system,
89 const bool extra_reverse_flow_derivatives =
false)
const;
92 EvalWell pressureDropValve(
const int seg,
93 const SummaryState& st,
94 const bool extra_reverse_flow_derivatives =
false)
const;
97 EvalWell accelerationPressureLossContribution(
const int seg,
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 111 const std::vector<std::vector<int>>& perforations()
const 113 return perforations_;
116 int upwinding_segment(
const int seg)
const 118 return upwinding_segments_[seg];
121 Scalar getRefDensity()
const 123 return densities_[0].value();
126 const EvalWell& density(
const int seg)
const 128 return densities_[seg];
131 Scalar local_perforation_depth_diff(
const int local_perf_index)
const 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_;
184 void copyPhaseDensities(
const unsigned phaseIdx,
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,
217 bool update_visc_and_den,
223 #endif // OPM_MULTISEGMENTWELL_SEGMENTS_HEADER_INCLUDED Scalar getPressureDiffSegLocalPerf(const int seg, const int local_perf_index) const
Pressure difference between segment and perforation.
Definition: MultisegmentWellSegments.cpp:255
void updateUpwindingSegments(const PrimaryVariables &primary_variables)
Update upwinding segments.
Definition: MultisegmentWellSegments.cpp:220
Definition: MultisegmentWellAssemble.hpp:35
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Class encapsulating some information about parallel wells.
Definition: MSWellHelpers.hpp:34
Definition: DeferredLogger.hpp:56
Definition: MultisegmentWellSegments.hpp:44
Definition: BlackoilWellModelGeneric.hpp:76
Definition: MultisegmentWellSegments.hpp:34