mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: MultisegmentWellAssemble::assembleOutflowTerm
extracted from MultisegmentWell::assembleWellEqWithoutIteration
This commit is contained in:
parent
517dd49771
commit
d5bbccde65
@ -223,6 +223,25 @@ assembleAccumulationTerm(const int seg,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class FluidSystem, class Indices, class Scalar>
|
||||||
|
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>::
|
||||||
|
assembleOutflowTerm(const int seg,
|
||||||
|
const int seg_upwind,
|
||||||
|
const int comp_idx,
|
||||||
|
const EvalWell& segment_rate,
|
||||||
|
Equations& eqns) const
|
||||||
|
{
|
||||||
|
eqns.resWell_[seg][comp_idx] -= segment_rate.value();
|
||||||
|
eqns.duneD_[seg][seg][comp_idx][WQTotal] -= segment_rate.derivative(WQTotal + Indices::numEq);
|
||||||
|
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||||
|
eqns.duneD_[seg][seg_upwind][comp_idx][WFrac] -= segment_rate.derivative(WFrac + Indices::numEq);
|
||||||
|
}
|
||||||
|
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
||||||
|
eqns.duneD_[seg][seg_upwind][comp_idx][GFrac] -= segment_rate.derivative(GFrac + Indices::numEq);
|
||||||
|
}
|
||||||
|
// pressure derivative should be zero
|
||||||
|
}
|
||||||
|
|
||||||
#define INSTANCE(...) \
|
#define INSTANCE(...) \
|
||||||
template class MultisegmentWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
template class MultisegmentWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>;
|
||||||
|
|
||||||
|
@ -109,6 +109,13 @@ public:
|
|||||||
const EvalWell& accumulation_term,
|
const EvalWell& accumulation_term,
|
||||||
Equations& eqns1) const;
|
Equations& eqns1) const;
|
||||||
|
|
||||||
|
//! \brief Assemble outflow term.
|
||||||
|
void assembleOutflowTerm(const int seg,
|
||||||
|
const int seg_upwind,
|
||||||
|
const int comp_idx,
|
||||||
|
const EvalWell& segment_rate,
|
||||||
|
Equations& eqns1) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const WellInterfaceIndices<FluidSystem,Indices,Scalar>& well_; //!< Reference to well
|
const WellInterfaceIndices<FluidSystem,Indices,Scalar>& well_; //!< Reference to well
|
||||||
};
|
};
|
||||||
|
@ -1569,21 +1569,12 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
// considering the contributions due to flowing out from the segment
|
// considering the contributions due to flowing out from the segment
|
||||||
{
|
{
|
||||||
for (int comp_idx = 0; comp_idx < this->num_components_; ++comp_idx) {
|
|
||||||
const EvalWell segment_rate = this->getSegmentRateUpwinding(seg, comp_idx) * this->well_efficiency_factor_;
|
|
||||||
|
|
||||||
const int seg_upwind = this->upwinding_segments_[seg];
|
const int seg_upwind = this->upwinding_segments_[seg];
|
||||||
// segment_rate contains the derivatives with respect to WQTotal in seg,
|
for (int comp_idx = 0; comp_idx < this->num_components_; ++comp_idx) {
|
||||||
// and WFrac and GFrac in seg_upwind
|
const EvalWell segment_rate = this->getSegmentRateUpwinding(seg, comp_idx) *
|
||||||
this->linSys_.resWell_[seg][comp_idx] -= segment_rate.value();
|
this->well_efficiency_factor_;
|
||||||
this->linSys_.duneD_[seg][seg][comp_idx][WQTotal] -= segment_rate.derivative(WQTotal + Indices::numEq);
|
MultisegmentWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
assembleOutflowTerm(seg, seg_upwind, comp_idx, segment_rate, this->linSys_);
|
||||||
this->linSys_.duneD_[seg][seg_upwind][comp_idx][WFrac] -= segment_rate.derivative(WFrac + Indices::numEq);
|
|
||||||
}
|
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
|
||||||
this->linSys_.duneD_[seg][seg_upwind][comp_idx][GFrac] -= segment_rate.derivative(GFrac + Indices::numEq);
|
|
||||||
}
|
|
||||||
// pressure derivative should be zero
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user