Merge pull request #4301 from akva2/msw_avoid_mutable

MultisegmentWell: avoid mutable matrices/vectors
This commit is contained in:
Atgeirr Flø Rasmussen 2022-12-01 08:03:01 +01:00 committed by GitHub
commit e23da0b6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View File

@ -72,7 +72,7 @@ MultisegmentWellEval(WellInterfaceIndices<FluidSystem,Indices,Scalar>& baseif)
template<typename FluidSystem, typename Indices, typename Scalar>
void
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
initMatrixAndVectors(const int num_cells) const
initMatrixAndVectors(const int num_cells)
{
duneB_.setBuildMode(OffDiagMatWell::row_wise);
duneC_.setBuildMode(OffDiagMatWell::row_wise);
@ -1299,7 +1299,7 @@ template<typename FluidSystem, typename Indices, typename Scalar>
void
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
handleAccelerationPressureLoss(const int seg,
WellState& well_state) const
WellState& well_state)
{
const double area = this->segmentSet()[seg].crossArea();
const EvalWell mass_rate = segment_mass_rates_[seg];
@ -1351,7 +1351,7 @@ template<typename FluidSystem, typename Indices, typename Scalar>
void
MultisegmentWellEval<FluidSystem,Indices,Scalar>::
assembleDefaultPressureEq(const int seg,
WellState& well_state) const
WellState& well_state)
{
assert(seg != 0); // not top segment
@ -1600,7 +1600,7 @@ MultisegmentWellEval<FluidSystem,Indices,Scalar>::
assembleICDPressureEq(const int seg,
const UnitSystem& unit_system,
WellState& well_state,
DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger)
{
// TODO: upwinding needs to be taken care of
// top segment can not be a spiral ICD device
@ -1670,7 +1670,7 @@ MultisegmentWellEval<FluidSystem,Indices,Scalar>::
assemblePressureEq(const int seg,
const UnitSystem& unit_system,
WellState& well_state,
DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger)
{
switch(this->segmentSet()[seg].segmentType()) {
case Segment::SegmentType::SICD :

View File

@ -118,7 +118,7 @@ protected:
MultisegmentWellEval(WellInterfaceIndices<FluidSystem,Indices,Scalar>& baseif);
void initMatrixAndVectors(const int num_cells) const;
void initMatrixAndVectors(const int num_cells);
void initPrimaryVariablesEvaluation() const;
void assembleControlEq(const WellState& well_state,
@ -131,20 +131,20 @@ protected:
DeferredLogger& deferred_logger);
void assembleDefaultPressureEq(const int seg,
WellState& well_state) const;
WellState& well_state);
// assemble pressure equation for ICD segments
void assembleICDPressureEq(const int seg,
const UnitSystem& unit_system,
WellState& well_state,
DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger);
void assemblePressureEq(const int seg,
const UnitSystem& unit_system,
WellState& well_state,
DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger);
/// check whether the well equations get converged for this well
ConvergenceReport getWellConvergence(const WellState& well_state,
@ -211,7 +211,7 @@ protected:
DeferredLogger& deferred_logger) const;
void handleAccelerationPressureLoss(const int seg,
WellState& well_state) const;
WellState& well_state);
// pressure drop for Autonomous ICD segment (WSEGAICD)
EvalWell pressureDropAutoICD(const int seg,
@ -247,10 +247,10 @@ protected:
// TODO, the following should go to a class for computing purpose
// two off-diagonal matrices
mutable OffDiagMatWell duneB_;
mutable OffDiagMatWell duneC_;
OffDiagMatWell duneB_;
OffDiagMatWell duneC_;
// "diagonal" matrix for the well. It has offdiagonal entries for inlets and outlets.
mutable DiagMatWell duneD_;
DiagMatWell duneD_;
/// \brief solver for diagonal matrix
///
@ -258,7 +258,7 @@ protected:
mutable std::shared_ptr<Dune::UMFPack<DiagMatWell> > duneDSolver_;
// residuals of the well equations
mutable BVectorWell resWell_;
BVectorWell resWell_;
// the values for the primary varibles
// based on different solutioin strategies, the wells can have different primary variables