mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
MultisegmentWell: move volumeFractionScaled to MultisegmentWellPrimaryVariables
This commit is contained in:
@@ -171,23 +171,6 @@ getWellConvergence(const WellState& well_state,
|
|||||||
return report;
|
return report;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
|
||||||
typename MultisegmentWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
|
||||||
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
|
||||||
volumeFractionScaled(const int seg,
|
|
||||||
const int comp_idx) const
|
|
||||||
{
|
|
||||||
// For reservoir rate control, the distr in well control is used for the
|
|
||||||
// rate conversion coefficients. For the injection well, only the distr of the injection
|
|
||||||
// phase is not zero.
|
|
||||||
const double scale = baseif_.scalingFactor(baseif_.ebosCompIdxToFlowCompIdx(comp_idx));
|
|
||||||
if (scale > 0.) {
|
|
||||||
return primary_variables_.volumeFraction(seg, comp_idx) / scale;
|
|
||||||
}
|
|
||||||
|
|
||||||
return primary_variables_.volumeFraction(seg, comp_idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
template<typename FluidSystem, typename Indices, typename Scalar>
|
||||||
typename MultisegmentWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
typename MultisegmentWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
||||||
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
||||||
@@ -196,12 +179,12 @@ surfaceVolumeFraction(const int seg,
|
|||||||
{
|
{
|
||||||
EvalWell sum_volume_fraction_scaled = 0.;
|
EvalWell sum_volume_fraction_scaled = 0.;
|
||||||
for (int idx = 0; idx < baseif_.numComponents(); ++idx) {
|
for (int idx = 0; idx < baseif_.numComponents(); ++idx) {
|
||||||
sum_volume_fraction_scaled += volumeFractionScaled(seg, idx);
|
sum_volume_fraction_scaled += primary_variables_.volumeFractionScaled(seg, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(sum_volume_fraction_scaled.value() != 0.);
|
assert(sum_volume_fraction_scaled.value() != 0.);
|
||||||
|
|
||||||
return volumeFractionScaled(seg, comp_idx) / sum_volume_fraction_scaled;
|
return primary_variables_.volumeFractionScaled(seg, comp_idx) / sum_volume_fraction_scaled;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
template<typename FluidSystem, typename Indices, typename Scalar>
|
||||||
@@ -237,7 +220,8 @@ getSegmentRateUpwinding(const int seg,
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EvalWell segment_rate = primary_variables_.evaluation_[seg][WQTotal] * volumeFractionScaled(seg_upwind, comp_idx);
|
const EvalWell segment_rate = primary_variables_.evaluation_[seg][WQTotal] *
|
||||||
|
primary_variables_.volumeFractionScaled(seg_upwind, comp_idx);
|
||||||
|
|
||||||
assert(segment_rate.derivative(SPres + Indices::numEq) == 0.);
|
assert(segment_rate.derivative(SPres + Indices::numEq) == 0.);
|
||||||
|
|
||||||
@@ -452,7 +436,8 @@ MultisegmentWellEval<FluidSystem,Indices,Scalar>::
|
|||||||
getSegmentRate(const int seg,
|
getSegmentRate(const int seg,
|
||||||
const int comp_idx) const
|
const int comp_idx) const
|
||||||
{
|
{
|
||||||
return primary_variables_.evaluation_[seg][WQTotal] * volumeFractionScaled(seg, comp_idx);
|
return primary_variables_.evaluation_[seg][WQTotal] *
|
||||||
|
primary_variables_.volumeFractionScaled(seg, comp_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename FluidSystem, typename Indices, typename Scalar>
|
template<typename FluidSystem, typename Indices, typename Scalar>
|
||||||
|
|||||||
@@ -186,10 +186,6 @@ protected:
|
|||||||
const double rho,
|
const double rho,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
// F_p / g_p, the basic usage of this value is because Q_p = G_t * F_p / G_p
|
|
||||||
EvalWell volumeFractionScaled(const int seg,
|
|
||||||
const int comp_idx) const;
|
|
||||||
|
|
||||||
// basically Q_p / \sigma_p Q_p
|
// basically Q_p / \sigma_p Q_p
|
||||||
EvalWell surfaceVolumeFraction(const int seg,
|
EvalWell surfaceVolumeFraction(const int seg,
|
||||||
const int comp_idx) const;
|
const int comp_idx) const;
|
||||||
|
|||||||
@@ -288,6 +288,23 @@ volumeFraction(const int seg,
|
|||||||
return oil_fraction;
|
return oil_fraction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class FluidSystem, class Indices, class Scalar>
|
||||||
|
typename MultisegmentWellPrimaryVariables<FluidSystem,Indices,Scalar>::EvalWell
|
||||||
|
MultisegmentWellPrimaryVariables<FluidSystem,Indices,Scalar>::
|
||||||
|
volumeFractionScaled(const int seg,
|
||||||
|
const int comp_idx) const
|
||||||
|
{
|
||||||
|
// For reservoir rate control, the distr in well control is used for the
|
||||||
|
// rate conversion coefficients. For the injection well, only the distr of the injection
|
||||||
|
// phase is not zero.
|
||||||
|
const double scale = well_.scalingFactor(well_.ebosCompIdxToFlowCompIdx(comp_idx));
|
||||||
|
if (scale > 0.) {
|
||||||
|
return this->volumeFraction(seg, comp_idx) / scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this->volumeFraction(seg, comp_idx);
|
||||||
|
}
|
||||||
|
|
||||||
#define INSTANCE(...) \
|
#define INSTANCE(...) \
|
||||||
template class MultisegmentWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
template class MultisegmentWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||||
|
|
||||||
|
|||||||
@@ -94,9 +94,10 @@ public:
|
|||||||
const double DFLimit,
|
const double DFLimit,
|
||||||
const double max_pressure_change);
|
const double max_pressure_change);
|
||||||
|
|
||||||
//! \brief Returns volume fraction for component in a segment.
|
//! \brief Returns scaled volume fraction for a component in a segment.
|
||||||
EvalWell volumeFraction(const int seg,
|
//! \details F_p / g_p, the basic usage of this value is because Q_p = G_t * F_p / G_p
|
||||||
const unsigned compIdx) const;
|
EvalWell volumeFractionScaled(const int seg,
|
||||||
|
const int compIdx) const;
|
||||||
|
|
||||||
// the values for the primary varibles
|
// the values for the primary varibles
|
||||||
// based on different solutioin strategies, the wells can have different primary variables
|
// based on different solutioin strategies, the wells can have different primary variables
|
||||||
@@ -109,6 +110,10 @@ private:
|
|||||||
//! \brief Handle non-reasonable fractions due to numerical overshoot.
|
//! \brief Handle non-reasonable fractions due to numerical overshoot.
|
||||||
void processFractions(const int seg);
|
void processFractions(const int seg);
|
||||||
|
|
||||||
|
//! \brief Returns volume fraction for component in a segment.
|
||||||
|
EvalWell volumeFraction(const int seg,
|
||||||
|
const unsigned compIdx) const;
|
||||||
|
|
||||||
const WellInterfaceIndices<FluidSystem,Indices,Scalar>& well_; //!< Reference to well interface
|
const WellInterfaceIndices<FluidSystem,Indices,Scalar>& well_; //!< Reference to well interface
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user