added: StandardWellAssemble::assembleSourceEq

extracted from StandardWell::assembleWellEqWithoutIterationImpl
This commit is contained in:
Arne Morten Kvarving 2022-11-18 12:09:43 +01:00
parent 5bbf205619
commit 68bc90b3be
3 changed files with 34 additions and 5 deletions

View File

@ -188,6 +188,20 @@ assemblePerforationEq(const EvalWell& cq_s_effective,
}
}
template<class FluidSystem, class Indices, class Scalar>
template<class EvalWell>
void StandardWellAssemble<FluidSystem,Indices,Scalar>::
assembleSourceEq(const EvalWell& resWell_loc,
const int componentIdx,
const int numWellEq,
StandardWellEquations<Scalar,Indices::numEq>& eqns) const
{
for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) {
eqns.duneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+Indices::numEq);
}
eqns.resWell_[0][componentIdx] += resWell_loc.value();
}
template<class FluidSystem, class Indices, class Scalar>
template<class EvalWell>
void StandardWellAssemble<FluidSystem,Indices,Scalar>::
@ -236,6 +250,12 @@ StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA
template void \
StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>:: \
assembleZFracEq(const DenseAd::Evaluation<double,-1,Dim>&, \
const int, \
const int, \
StandardWellEquations<double,__VA_ARGS__::numEq>&) const; \
template void \
StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>:: \
assembleSourceEq(const DenseAd::Evaluation<double,-1,Dim>&, \
const int, \
const int, \
StandardWellEquations<double,__VA_ARGS__::numEq>&) const;

View File

@ -86,6 +86,14 @@ public:
const int numWellEq,
StandardWellEquations<Scalar,Indices::numEq>& eqns) const;
//! \brief Assemble a source term.
template<class EvalWell>
void assembleSourceEq(const EvalWell& resWell_loc,
const int componentIdx,
const int numWellEq,
StandardWellEquations<Scalar,Indices::numEq>& eqns) const;
private:
const WellInterfaceFluidSystem<FluidSystem>& well_; //!< Reference to well
};

View File

@ -532,10 +532,11 @@ namespace Opm
resWell_loc += (this->wellSurfaceVolumeFraction(componentIdx) - this->F0_[componentIdx]) * volume / dt;
}
resWell_loc -= this->getQs(componentIdx) * this->well_efficiency_factor_;
for (int pvIdx = 0; pvIdx < this->numWellEq_; ++pvIdx) {
this->linSys_.duneD_[0][0][componentIdx][pvIdx] += resWell_loc.derivative(pvIdx+Indices::numEq);
}
this->linSys_.resWell_[0][componentIdx] += resWell_loc.value();
StandardWellAssemble<FluidSystem,Indices,Scalar>(*this).
assembleSourceEq(resWell_loc,
componentIdx,
this->numWellEq_,
this->linSys_);
}
const auto& summaryState = ebosSimulator.vanguard().summaryState();