mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move wellSurfaceVolumeFraction to StandardWellPrimaryVariables
This commit is contained in:
parent
2fb53a4ef6
commit
1aa74a9830
@ -156,7 +156,7 @@ getQs(const int comp_idx) const
|
|||||||
// deferred_logger.warning("MULTI_PHASE_INJECTOR_NOT_SUPPORTED",
|
// deferred_logger.warning("MULTI_PHASE_INJECTOR_NOT_SUPPORTED",
|
||||||
// "Multi phase injectors are not supported, requested for well " + name());
|
// "Multi phase injectors are not supported, requested for well " + name());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return inj_frac * primary_variables_.evaluation_[WQTotal];
|
return inj_frac * primary_variables_.evaluation_[WQTotal];
|
||||||
} else { // producers
|
} else { // producers
|
||||||
return primary_variables_.evaluation_[WQTotal] *
|
return primary_variables_.evaluation_[WQTotal] *
|
||||||
@ -164,21 +164,6 @@ getQs(const int comp_idx) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class FluidSystem, class Indices, class Scalar>
|
|
||||||
typename StandardWellEval<FluidSystem,Indices,Scalar>::EvalWell
|
|
||||||
StandardWellEval<FluidSystem,Indices,Scalar>::
|
|
||||||
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 += primary_variables_.volumeFractionScaled(idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(sum_volume_fraction_scaled.value() != 0.);
|
|
||||||
|
|
||||||
return this->primary_variables_.volumeFractionScaled(compIdx) / sum_volume_fraction_scaled;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class FluidSystem, class Indices, class Scalar>
|
template<class FluidSystem, class Indices, class Scalar>
|
||||||
void
|
void
|
||||||
StandardWellEval<FluidSystem,Indices,Scalar>::
|
StandardWellEval<FluidSystem,Indices,Scalar>::
|
||||||
@ -311,8 +296,8 @@ void
|
|||||||
StandardWellEval<FluidSystem,Indices,Scalar>::
|
StandardWellEval<FluidSystem,Indices,Scalar>::
|
||||||
computeAccumWell()
|
computeAccumWell()
|
||||||
{
|
{
|
||||||
for (int eq_idx = 0; eq_idx < numWellConservationEq; ++eq_idx) {
|
for (size_t eq_idx = 0; eq_idx < F0_.size(); ++eq_idx) {
|
||||||
F0_[eq_idx] = wellSurfaceVolumeFraction(eq_idx).value();
|
F0_[eq_idx] = this->primary_variables_.surfaceVolumeFraction(eq_idx).value();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ protected:
|
|||||||
|
|
||||||
EvalWell extendEval(const Eval& in) const;
|
EvalWell extendEval(const Eval& in) const;
|
||||||
EvalWell getQs(const int compIdx) const;
|
EvalWell getQs(const int compIdx) const;
|
||||||
EvalWell wellSurfaceVolumeFraction(const int compIdx) const;
|
|
||||||
|
|
||||||
// calculate a relaxation factor to avoid overshoot of the fractions for producers
|
// calculate a relaxation factor to avoid overshoot of the fractions for producers
|
||||||
// which might result in negative rates
|
// which might result in negative rates
|
||||||
|
@ -363,6 +363,21 @@ volumeFractionScaled(const int compIdx) const
|
|||||||
return this->volumeFraction(compIdx);
|
return this->volumeFraction(compIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class FluidSystem, class Indices, class Scalar>
|
||||||
|
typename StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>::EvalWell
|
||||||
|
StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>::
|
||||||
|
surfaceVolumeFraction(const int compIdx) const
|
||||||
|
{
|
||||||
|
EvalWell sum_volume_fraction_scaled(numWellEq_ + Indices::numEq, 0.);
|
||||||
|
for (int idx = 0; idx < well_.numComponents(); ++idx) {
|
||||||
|
sum_volume_fraction_scaled += this->volumeFractionScaled(idx);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(sum_volume_fraction_scaled.value() != 0.);
|
||||||
|
|
||||||
|
return this->volumeFractionScaled(compIdx) / sum_volume_fraction_scaled;
|
||||||
|
}
|
||||||
|
|
||||||
#define INSTANCE(...) \
|
#define INSTANCE(...) \
|
||||||
template class StandardWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
template class StandardWellPrimaryVariables<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||||
|
|
||||||
|
@ -123,6 +123,9 @@ public:
|
|||||||
//! \brief Returns scaled volume fraction for a component.
|
//! \brief Returns scaled volume fraction for a component.
|
||||||
EvalWell volumeFractionScaled(const int compIdx) const;
|
EvalWell volumeFractionScaled(const int compIdx) const;
|
||||||
|
|
||||||
|
//! \brief Returns surface volume fraction for a component.
|
||||||
|
EvalWell surfaceVolumeFraction(const int compIdx) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! \brief Returns volume fraction for a component.
|
//! \brief Returns volume fraction for a component.
|
||||||
EvalWell volumeFraction(const unsigned compIdx) const;
|
EvalWell volumeFraction(const unsigned compIdx) const;
|
||||||
|
@ -136,7 +136,7 @@ namespace Opm
|
|||||||
// surface volume fraction of fluids within wellbore
|
// surface volume fraction of fluids within wellbore
|
||||||
std::vector<EvalWell> cmix_s(this->numComponents(), EvalWell{this->primary_variables_.numWellEq() + Indices::numEq});
|
std::vector<EvalWell> cmix_s(this->numComponents(), EvalWell{this->primary_variables_.numWellEq() + Indices::numEq});
|
||||||
for (int componentIdx = 0; componentIdx < this->numComponents(); ++componentIdx) {
|
for (int componentIdx = 0; componentIdx < this->numComponents(); ++componentIdx) {
|
||||||
cmix_s[componentIdx] = this->wellSurfaceVolumeFraction(componentIdx);
|
cmix_s[componentIdx] = this->primary_variables_.surfaceVolumeFraction(componentIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
computePerfRate(mob,
|
computePerfRate(mob,
|
||||||
@ -210,7 +210,7 @@ namespace Opm
|
|||||||
// surface volume fraction of fluids within wellbore
|
// surface volume fraction of fluids within wellbore
|
||||||
std::vector<Scalar> cmix_s(this->numComponents(), 0.0);
|
std::vector<Scalar> cmix_s(this->numComponents(), 0.0);
|
||||||
for (int componentIdx = 0; componentIdx < this->numComponents(); ++componentIdx) {
|
for (int componentIdx = 0; componentIdx < this->numComponents(); ++componentIdx) {
|
||||||
cmix_s[componentIdx] = getValue(this->wellSurfaceVolumeFraction(componentIdx));
|
cmix_s[componentIdx] = getValue(this->primary_variables_.surfaceVolumeFraction(componentIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
computePerfRate(mob,
|
computePerfRate(mob,
|
||||||
@ -529,7 +529,8 @@ namespace Opm
|
|||||||
EvalWell resWell_loc(this->primary_variables_.numWellEq() + Indices::numEq, 0.0);
|
EvalWell resWell_loc(this->primary_variables_.numWellEq() + Indices::numEq, 0.0);
|
||||||
if (FluidSystem::numActivePhases() > 1) {
|
if (FluidSystem::numActivePhases() > 1) {
|
||||||
assert(dt > 0);
|
assert(dt > 0);
|
||||||
resWell_loc += (this->wellSurfaceVolumeFraction(componentIdx) - this->F0_[componentIdx]) * volume / dt;
|
resWell_loc += (this->primary_variables_.surfaceVolumeFraction(componentIdx) -
|
||||||
|
this->F0_[componentIdx]) * volume / dt;
|
||||||
}
|
}
|
||||||
resWell_loc -= this->getQs(componentIdx) * this->well_efficiency_factor_;
|
resWell_loc -= this->getQs(componentIdx) * this->well_efficiency_factor_;
|
||||||
StandardWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
StandardWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||||
|
Loading…
Reference in New Issue
Block a user