mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move wellVolumeFractionScaled to StandardWellPrimaryVariables
This commit is contained in:
parent
d6a6671eb0
commit
2fb53a4ef6
@ -159,24 +159,11 @@ getQs(const int comp_idx) const
|
||||
}
|
||||
return inj_frac * primary_variables_.evaluation_[WQTotal];
|
||||
} else { // producers
|
||||
return primary_variables_.evaluation_[WQTotal] * wellVolumeFractionScaled(comp_idx);
|
||||
return primary_variables_.evaluation_[WQTotal] *
|
||||
primary_variables_.volumeFractionScaled(comp_idx);
|
||||
}
|
||||
}
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
typename StandardWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
||||
StandardWellEval<FluidSystem,Indices,Scalar>::
|
||||
wellVolumeFractionScaled(const int compIdx) const
|
||||
{
|
||||
const int legacyCompIdx = baseif_.ebosCompIdxToFlowCompIdx(compIdx);
|
||||
const double scal = baseif_.scalingFactor(legacyCompIdx);
|
||||
if (scal > 0)
|
||||
return this->primary_variables_.volumeFraction(compIdx) / scal;
|
||||
|
||||
// the scaling factor may be zero for RESV controlled wells.
|
||||
return this->primary_variables_.volumeFraction(compIdx);
|
||||
}
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
typename StandardWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
||||
StandardWellEval<FluidSystem,Indices,Scalar>::
|
||||
@ -184,12 +171,12 @@ wellSurfaceVolumeFraction(const int compIdx) const
|
||||
{
|
||||
EvalWell sum_volume_fraction_scaled(this->primary_variables_.numWellEq() + Indices::numEq, 0.);
|
||||
for (int idx = 0; idx < baseif_.numComponents(); ++idx) {
|
||||
sum_volume_fraction_scaled += wellVolumeFractionScaled(idx);
|
||||
sum_volume_fraction_scaled += primary_variables_.volumeFractionScaled(idx);
|
||||
}
|
||||
|
||||
assert(sum_volume_fraction_scaled.value() != 0.);
|
||||
|
||||
return wellVolumeFractionScaled(compIdx) / sum_volume_fraction_scaled;
|
||||
return this->primary_variables_.volumeFractionScaled(compIdx) / sum_volume_fraction_scaled;
|
||||
}
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
|
@ -86,7 +86,6 @@ protected:
|
||||
EvalWell extendEval(const Eval& in) const;
|
||||
EvalWell getQs(const int compIdx) const;
|
||||
EvalWell wellSurfaceVolumeFraction(const int compIdx) const;
|
||||
EvalWell wellVolumeFractionScaled(const int phase) const;
|
||||
|
||||
// calculate a relaxation factor to avoid overshoot of the fractions for producers
|
||||
// which might result in negative rates
|
||||
|
@ -349,6 +349,20 @@ volumeFraction(const unsigned compIdx) const
|
||||
return well_fraction;
|
||||
}
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
typename StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>::EvalWell
|
||||
StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>::
|
||||
volumeFractionScaled(const int compIdx) const
|
||||
{
|
||||
const int legacyCompIdx = well_.ebosCompIdxToFlowCompIdx(compIdx);
|
||||
const double scal = well_.scalingFactor(legacyCompIdx);
|
||||
if (scal > 0)
|
||||
return this->volumeFraction(compIdx) / scal;
|
||||
|
||||
// the scaling factor may be zero for RESV controlled wells.
|
||||
return this->volumeFraction(compIdx);
|
||||
}
|
||||
|
||||
#define INSTANCE(...) \
|
||||
template class StandardWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||
|
||||
|
@ -120,10 +120,13 @@ public:
|
||||
//! \brief Copy polymer molecular weight values to well state.
|
||||
void copyToWellStatePolyMW(WellState& well_state) const;
|
||||
|
||||
//! \brief Returns scaled volume fraction for a component.
|
||||
EvalWell volumeFractionScaled(const int compIdx) const;
|
||||
|
||||
private:
|
||||
//! \brief Returns volume fraction for a component.
|
||||
EvalWell volumeFraction(const unsigned compIdx) const;
|
||||
|
||||
private:
|
||||
const WellInterfaceIndices<FluidSystem,Indices,Scalar>& well_; //!< Reference to well interface
|
||||
|
||||
//! \brief Total number of the well equations and primary variables.
|
||||
|
Loading…
Reference in New Issue
Block a user