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:
@@ -72,6 +72,9 @@ class WellInterface : public WellInterfaceIndices<GetPropType<TypeTag, Propertie
|
|||||||
GetPropType<TypeTag, Properties::Indices>,
|
GetPropType<TypeTag, Properties::Indices>,
|
||||||
GetPropType<TypeTag, Properties::Scalar>>
|
GetPropType<TypeTag, Properties::Scalar>>
|
||||||
{
|
{
|
||||||
|
using Base = WellInterfaceIndices<GetPropType<TypeTag, Properties::FluidSystem>,
|
||||||
|
GetPropType<TypeTag, Properties::Indices>,
|
||||||
|
GetPropType<TypeTag, Properties::Scalar>>;
|
||||||
public:
|
public:
|
||||||
using ModelParameters = BlackoilModelParametersEbos<TypeTag>;
|
using ModelParameters = BlackoilModelParametersEbos<TypeTag>;
|
||||||
|
|
||||||
@@ -94,8 +97,8 @@ public:
|
|||||||
|
|
||||||
using VectorBlockType = Dune::FieldVector<Scalar, Indices::numEq>;
|
using VectorBlockType = Dune::FieldVector<Scalar, Indices::numEq>;
|
||||||
using MatrixBlockType = Dune::FieldMatrix<Scalar, Indices::numEq, Indices::numEq>;
|
using MatrixBlockType = Dune::FieldMatrix<Scalar, Indices::numEq, Indices::numEq>;
|
||||||
|
using Eval = typename Base::Eval;
|
||||||
using BVector = Dune::BlockVector<VectorBlockType>;
|
using BVector = Dune::BlockVector<VectorBlockType>;
|
||||||
using Eval = DenseAd::Evaluation<Scalar, /*size=*/Indices::numEq>;
|
|
||||||
using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<double, 1, 1>>;
|
using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<double, 1, 1>>;
|
||||||
|
|
||||||
using RateConverterType =
|
using RateConverterType =
|
||||||
@@ -270,17 +273,6 @@ public:
|
|||||||
|
|
||||||
Scalar volumetricSurfaceRateForConnection(int cellIdx, int phaseIdx) const;
|
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
|
// TODO: theoretically, it should be a const function
|
||||||
// Simulator is not const is because that assembleWellEq is non-const Simulator
|
// Simulator is not const is because that assembleWellEq is non-const Simulator
|
||||||
void wellTesting(const Simulator& simulator,
|
void wellTesting(const Simulator& simulator,
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
#ifndef OPM_WELLINTERFACE_INDICES_HEADER_INCLUDED
|
#ifndef OPM_WELLINTERFACE_INDICES_HEADER_INCLUDED
|
||||||
#define OPM_WELLINTERFACE_INDICES_HEADER_INCLUDED
|
#define OPM_WELLINTERFACE_INDICES_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <opm/material/densead/Evaluation.hpp>
|
||||||
|
|
||||||
#include <opm/simulators/wells/WellInterfaceFluidSystem.hpp>
|
#include <opm/simulators/wells/WellInterfaceFluidSystem.hpp>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@@ -35,11 +37,23 @@ public:
|
|||||||
using WellInterfaceFluidSystem<FluidSystem>::Gas;
|
using WellInterfaceFluidSystem<FluidSystem>::Gas;
|
||||||
using WellInterfaceFluidSystem<FluidSystem>::Oil;
|
using WellInterfaceFluidSystem<FluidSystem>::Oil;
|
||||||
using WellInterfaceFluidSystem<FluidSystem>::Water;
|
using WellInterfaceFluidSystem<FluidSystem>::Water;
|
||||||
|
using Eval = DenseAd::Evaluation<Scalar, /*size=*/Indices::numEq>;
|
||||||
|
|
||||||
int flowPhaseToEbosCompIdx(const int phaseIdx) const;
|
int flowPhaseToEbosCompIdx(const int phaseIdx) const;
|
||||||
int ebosCompIdxToFlowCompIdx(const unsigned compIdx) const;
|
int ebosCompIdxToFlowCompIdx(const unsigned compIdx) const;
|
||||||
double scalingFactor(const int phaseIdx) 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:
|
protected:
|
||||||
WellInterfaceIndices(const Well& well,
|
WellInterfaceIndices(const Well& well,
|
||||||
const ParallelWellInfo& parallel_well_info,
|
const ParallelWellInfo& parallel_well_info,
|
||||||
|
|||||||
Reference in New Issue
Block a user