mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: StandardWellAssemble::assembleInjectivityEq
extracted from StandardWell::handleInjectivityEquations
This commit is contained in:
parent
10e967653b
commit
57ecd2a5e9
@ -140,6 +140,30 @@ assembleControlEq(const WellState& well_state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class FluidSystem, class Indices, class Scalar>
|
||||||
|
template<class EvalWell>
|
||||||
|
void StandardWellAssemble<FluidSystem,Indices,Scalar>::
|
||||||
|
assembleInjectivityEq(const EvalWell& eq_pskin,
|
||||||
|
const EvalWell& eq_wat_vel,
|
||||||
|
const int pskin_index,
|
||||||
|
const int wat_vel_index,
|
||||||
|
const int cell_idx,
|
||||||
|
const int numWellEq,
|
||||||
|
StandardWellEquations<Scalar,Indices::numEq>& eqns) const
|
||||||
|
{
|
||||||
|
eqns.resWell_[0][pskin_index] = eq_pskin.value();
|
||||||
|
eqns.resWell_[0][wat_vel_index] = eq_wat_vel.value();
|
||||||
|
for (int pvIdx = 0; pvIdx < numWellEq; ++pvIdx) {
|
||||||
|
eqns.duneD_[0][0][wat_vel_index][pvIdx] = eq_wat_vel.derivative(pvIdx+Indices::numEq);
|
||||||
|
eqns.duneD_[0][0][pskin_index][pvIdx] = eq_pskin.derivative(pvIdx+Indices::numEq);
|
||||||
|
}
|
||||||
|
|
||||||
|
// the water velocity is impacted by the reservoir primary varaibles. It needs to enter matrix B
|
||||||
|
for (int pvIdx = 0; pvIdx < Indices::numEq; ++pvIdx) {
|
||||||
|
eqns.duneB_[0][cell_idx][wat_vel_index][pvIdx] = eq_wat_vel.derivative(pvIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#define INSTANCE(Dim,...) \
|
#define INSTANCE(Dim,...) \
|
||||||
template class StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>; \
|
template class StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>; \
|
||||||
template void \
|
template void \
|
||||||
@ -155,7 +179,16 @@ StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA
|
|||||||
const double, \
|
const double, \
|
||||||
const int, \
|
const int, \
|
||||||
StandardWellEquations<double,__VA_ARGS__::numEq>&, \
|
StandardWellEquations<double,__VA_ARGS__::numEq>&, \
|
||||||
DeferredLogger&) const;
|
DeferredLogger&) const; \
|
||||||
|
template void \
|
||||||
|
StandardWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>:: \
|
||||||
|
assembleInjectivityEq(const DenseAd::Evaluation<double,-1,Dim>&, \
|
||||||
|
const DenseAd::Evaluation<double,-1,Dim>&, \
|
||||||
|
const int, \
|
||||||
|
const int, \
|
||||||
|
const int, \
|
||||||
|
const int, \
|
||||||
|
StandardWellEquations<double,__VA_ARGS__::numEq>&) const;
|
||||||
|
|
||||||
// One phase
|
// One phase
|
||||||
INSTANCE(4u, BlackOilOnePhaseIndices<0u,0u,0u,0u,false,false,0u,1u,0u>)
|
INSTANCE(4u, BlackOilOnePhaseIndices<0u,0u,0u,0u,false,false,0u,1u,0u>)
|
||||||
|
@ -61,6 +61,15 @@ public:
|
|||||||
StandardWellEquations<Scalar,Indices::numEq>& eqns,
|
StandardWellEquations<Scalar,Indices::numEq>& eqns,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
|
//! \brief Assemble injectivity equation.
|
||||||
|
template<class EvalWell>
|
||||||
|
void assembleInjectivityEq(const EvalWell& eq_pskin,
|
||||||
|
const EvalWell& eq_wat_vel,
|
||||||
|
const int pskin_index,
|
||||||
|
const int wat_vel_index,
|
||||||
|
const int cell_idx,
|
||||||
|
const int numWellEq,
|
||||||
|
StandardWellEquations<Scalar,Indices::numEq>& eqns) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const WellInterfaceFluidSystem<FluidSystem>& well_; //!< Reference to well
|
const WellInterfaceFluidSystem<FluidSystem>& well_; //!< Reference to well
|
||||||
|
@ -2325,7 +2325,6 @@ namespace Opm
|
|||||||
|
|
||||||
// equation for the water velocity
|
// equation for the water velocity
|
||||||
const EvalWell eq_wat_vel = this->primary_variables_evaluation_[wat_vel_index] - water_velocity;
|
const EvalWell eq_wat_vel = this->primary_variables_evaluation_[wat_vel_index] - water_velocity;
|
||||||
this->linSys_.resWell_[0][wat_vel_index] = eq_wat_vel.value();
|
|
||||||
|
|
||||||
const auto& ws = well_state.well(this->index_of_well_);
|
const auto& ws = well_state.well(this->index_of_well_);
|
||||||
const auto& perf_data = ws.perf_data;
|
const auto& perf_data = ws.perf_data;
|
||||||
@ -2340,16 +2339,14 @@ namespace Opm
|
|||||||
const EvalWell eq_pskin = this->primary_variables_evaluation_[pskin_index]
|
const EvalWell eq_pskin = this->primary_variables_evaluation_[pskin_index]
|
||||||
- pskin(throughput, this->primary_variables_evaluation_[wat_vel_index], poly_conc, deferred_logger);
|
- pskin(throughput, this->primary_variables_evaluation_[wat_vel_index], poly_conc, deferred_logger);
|
||||||
|
|
||||||
this->linSys_.resWell_[0][pskin_index] = eq_pskin.value();
|
StandardWellAssemble<FluidSystem,Indices,Scalar>(*this).
|
||||||
for (int pvIdx = 0; pvIdx < this->numWellEq_; ++pvIdx) {
|
assembleInjectivityEq(eq_pskin,
|
||||||
this->linSys_.duneD_[0][0][wat_vel_index][pvIdx] = eq_wat_vel.derivative(pvIdx+Indices::numEq);
|
eq_wat_vel,
|
||||||
this->linSys_.duneD_[0][0][pskin_index][pvIdx] = eq_pskin.derivative(pvIdx+Indices::numEq);
|
pskin_index,
|
||||||
}
|
wat_vel_index,
|
||||||
|
cell_idx,
|
||||||
// the water velocity is impacted by the reservoir primary varaibles. It needs to enter matrix B
|
this->numWellEq_,
|
||||||
for (int pvIdx = 0; pvIdx < Indices::numEq; ++pvIdx) {
|
this->linSys_);
|
||||||
this->linSys_.duneB_[0][cell_idx][wat_vel_index][pvIdx] = eq_wat_vel.derivative(pvIdx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user