mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move Eval and restrictEval to WellInterfaceIndices
This commit is contained in:
parent
a31f1cefd5
commit
d1a2d27acb
@ -72,6 +72,9 @@ class WellInterface : public WellInterfaceIndices<GetPropType<TypeTag, Propertie
|
||||
GetPropType<TypeTag, Properties::Indices>,
|
||||
GetPropType<TypeTag, Properties::Scalar>>
|
||||
{
|
||||
using Base = WellInterfaceIndices<GetPropType<TypeTag, Properties::FluidSystem>,
|
||||
GetPropType<TypeTag, Properties::Indices>,
|
||||
GetPropType<TypeTag, Properties::Scalar>>;
|
||||
public:
|
||||
using ModelParameters = BlackoilModelParametersEbos<TypeTag>;
|
||||
|
||||
@ -94,8 +97,8 @@ public:
|
||||
|
||||
using VectorBlockType = Dune::FieldVector<Scalar, Indices::numEq>;
|
||||
using MatrixBlockType = Dune::FieldMatrix<Scalar, Indices::numEq, Indices::numEq>;
|
||||
using Eval = typename Base::Eval;
|
||||
using BVector = Dune::BlockVector<VectorBlockType>;
|
||||
using Eval = DenseAd::Evaluation<Scalar, /*size=*/Indices::numEq>;
|
||||
using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<double, 1, 1>>;
|
||||
|
||||
using RateConverterType =
|
||||
@ -270,17 +273,6 @@ public:
|
||||
|
||||
Scalar volumetricSurfaceRateForConnection(int cellIdx, int phaseIdx) const;
|
||||
|
||||
template <class EvalWell>
|
||||
Eval restrictEval(const EvalWell& in) const
|
||||
{
|
||||
Eval out = 0.0;
|
||||
out.setValue(in.value());
|
||||
for (int eqIdx = 0; eqIdx < Indices::numEq; ++eqIdx) {
|
||||
out.setDerivative(eqIdx, in.derivative(eqIdx));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// TODO: theoretically, it should be a const function
|
||||
// Simulator is not const is because that assembleWellEq is non-const Simulator
|
||||
void wellTesting(const Simulator& simulator,
|
||||
|
@ -23,6 +23,8 @@
|
||||
#ifndef OPM_WELLINTERFACE_INDICES_HEADER_INCLUDED
|
||||
#define OPM_WELLINTERFACE_INDICES_HEADER_INCLUDED
|
||||
|
||||
#include <opm/material/densead/Evaluation.hpp>
|
||||
|
||||
#include <opm/simulators/wells/WellInterfaceFluidSystem.hpp>
|
||||
|
||||
namespace Opm
|
||||
@ -35,11 +37,23 @@ public:
|
||||
using WellInterfaceFluidSystem<FluidSystem>::Gas;
|
||||
using WellInterfaceFluidSystem<FluidSystem>::Oil;
|
||||
using WellInterfaceFluidSystem<FluidSystem>::Water;
|
||||
using Eval = DenseAd::Evaluation<Scalar, /*size=*/Indices::numEq>;
|
||||
|
||||
int flowPhaseToEbosCompIdx(const int phaseIdx) const;
|
||||
int ebosCompIdxToFlowCompIdx(const unsigned compIdx) const;
|
||||
double scalingFactor(const int phaseIdx) const;
|
||||
|
||||
template <class EvalWell>
|
||||
Eval restrictEval(const EvalWell& in) const
|
||||
{
|
||||
Eval out = 0.0;
|
||||
out.setValue(in.value());
|
||||
for (int eqIdx = 0; eqIdx < Indices::numEq; ++eqIdx) {
|
||||
out.setDerivative(eqIdx, in.derivative(eqIdx));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
protected:
|
||||
WellInterfaceIndices(const Well& well,
|
||||
const ParallelWellInfo& parallel_well_info,
|
||||
|
Loading…
Reference in New Issue
Block a user