MultisegmentWellAssemble: remove unnecessary Scalar template parameter

use the Scalar type from the FluidSystem
This commit is contained in:
Arne Morten Kvarving 2024-02-22 15:17:09 +01:00
parent b2139d2cdf
commit 9ab6ab27a0
2 changed files with 23 additions and 22 deletions

View File

@ -81,8 +81,8 @@ private:
MultisegmentWellEquations<Scalar,numWellEq,numEq>& eqns_; //!< Reference to equation system MultisegmentWellEquations<Scalar,numWellEq,numEq>& eqns_; //!< Reference to equation system
}; };
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleControlEq(const WellState& well_state, assembleControlEq(const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const Schedule& schedule, const Schedule& schedule,
@ -197,8 +197,8 @@ assembleControlEq(const WellState& well_state,
} }
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleAccelerationTerm(const int seg_target, assembleAccelerationTerm(const int seg_target,
const int seg, const int seg,
const int seg_upwind, const int seg_upwind,
@ -222,8 +222,8 @@ assembleAccelerationTerm(const int seg_target,
} }
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleHydroPressureLoss(const int seg, assembleHydroPressureLoss(const int seg,
const int seg_density, const int seg_density,
const EvalWell& hydro_pressure_drop_seg, const EvalWell& hydro_pressure_drop_seg,
@ -237,8 +237,8 @@ assembleHydroPressureLoss(const int seg,
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assemblePressureEqExtraDerivatives(const int seg, assemblePressureEqExtraDerivatives(const int seg,
const int seg_upwind, const int seg_upwind,
const EvalWell& extra_derivatives, const EvalWell& extra_derivatives,
@ -252,8 +252,8 @@ assemblePressureEqExtraDerivatives(const int seg,
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assemblePressureEq(const int seg, assemblePressureEq(const int seg,
const int seg_upwind, const int seg_upwind,
const int outlet_segment_index, const int outlet_segment_index,
@ -281,8 +281,8 @@ assemblePressureEq(const int seg,
} }
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleTrivialEq(const int seg, assembleTrivialEq(const int seg,
const Scalar value, const Scalar value,
Equations& eqns1) const Equations& eqns1) const
@ -292,8 +292,8 @@ assembleTrivialEq(const int seg,
eqns.D()[seg][seg][SPres][WQTotal] = 1.; eqns.D()[seg][seg][SPres][WQTotal] = 1.;
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleAccumulationTerm(const int seg, assembleAccumulationTerm(const int seg,
const int comp_idx, const int comp_idx,
const EvalWell& accumulation_term, const EvalWell& accumulation_term,
@ -306,8 +306,8 @@ assembleAccumulationTerm(const int seg,
} }
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleOutflowTerm(const int seg, assembleOutflowTerm(const int seg,
const int seg_upwind, const int seg_upwind,
const int comp_idx, const int comp_idx,
@ -326,8 +326,8 @@ assembleOutflowTerm(const int seg,
// pressure derivative should be zero // pressure derivative should be zero
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assembleInflowTerm(const int seg, assembleInflowTerm(const int seg,
const int inlet, const int inlet,
const int inlet_upwind, const int inlet_upwind,
@ -347,8 +347,8 @@ assembleInflowTerm(const int seg,
// pressure derivative should be zero // pressure derivative should be zero
} }
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
void MultisegmentWellAssemble<FluidSystem,Indices,Scalar>:: void MultisegmentWellAssemble<FluidSystem,Indices>::
assemblePerforationEq(const int seg, assemblePerforationEq(const int seg,
const int cell_idx, const int cell_idx,
const int comp_idx, const int comp_idx,
@ -375,7 +375,7 @@ assemblePerforationEq(const int seg,
} }
#define INSTANCE(...) \ #define INSTANCE(...) \
template class MultisegmentWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__,double>; template class MultisegmentWellAssemble<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,__VA_ARGS__>;
// One phase // One phase
INSTANCE(BlackOilOnePhaseIndices<0u,0u,0u,0u,false,false,0u,1u,0u>) INSTANCE(BlackOilOnePhaseIndices<0u,0u,0u,0u,false,false,0u,1u,0u>)

View File

@ -39,7 +39,7 @@ template<class FluidSystem, class Indices, class Scalar> class WellInterfaceIndi
class WellState; class WellState;
//! \brief Class handling assemble of the equation system for MultisegmentWell. //! \brief Class handling assemble of the equation system for MultisegmentWell.
template<class FluidSystem, class Indices, class Scalar> template<class FluidSystem, class Indices>
class MultisegmentWellAssemble class MultisegmentWellAssemble
{ {
static constexpr bool has_water = (Indices::waterSwitchIdx >= 0); static constexpr bool has_water = (Indices::waterSwitchIdx >= 0);
@ -59,6 +59,7 @@ class MultisegmentWellAssemble
public: public:
static constexpr int numWellEq = Indices::numPhases+1; static constexpr int numWellEq = Indices::numPhases+1;
using Scalar = typename FluidSystem::Scalar;
using Equations = MultisegmentWellEquations<Scalar,numWellEq,Indices::numEq>; using Equations = MultisegmentWellEquations<Scalar,numWellEq,Indices::numEq>;
using PrimaryVariables = MultisegmentWellPrimaryVariables<FluidSystem,Indices,Scalar>; using PrimaryVariables = MultisegmentWellPrimaryVariables<FluidSystem,Indices,Scalar>;
using EvalWell = DenseAd::Evaluation<Scalar, numWellEq+Indices::numEq>; using EvalWell = DenseAd::Evaluation<Scalar, numWellEq+Indices::numEq>;