56class GenericTracerModel {
58 using TracerVectorSingle = Dune::BlockVector<Dune::FieldVector<Scalar, 1>>;
59 using TracerMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 2, 2>>;
60 using TracerVector = Dune::BlockVector<Dune::FieldVector<Scalar, 2>>;
62 static constexpr int dimWorld = Grid::dimensionworld;
71 const std::string&
name(
int tracerIdx)
const;
72 std::string fname(
int tracerIdx)
const;
73 std::string sname(
int tracerIdx)
const;
74 std::string wellfname(
int tracerIdx)
const;
75 std::string wellsname(
int tracerIdx)
const;
77 Phase phase(
int tracerIdx)
const;
78 const std::vector<bool>& enableSolTracers()
const;
84 Scalar solTracerConcentration(
int tracerIdx,
int globalDofIdx)
const;
85 void setFreeTracerConcentration(
int tracerIdx,
int globalDofIdx, Scalar value);
86 void setSolTracerConcentration(
int tracerIdx,
int globalDofIdx, Scalar value);
87 void setEnableSolTracers(
int tracerIdx,
bool enableSolTracer);
92 const std::unordered_map<int, std::vector<WellTracerRate<Scalar>>>&
94 {
return wellTracerRate_; }
96 const std::unordered_map<int, std::vector<WellTracerRate<Scalar>>>&
97 getWellFreeTracerRates()
const
98 {
return wellFreeTracerRate_; }
100 const std::unordered_map<int, std::vector<WellTracerRate<Scalar>>>&
101 getWellSolTracerRates()
const
102 {
return wellSolTracerRate_; }
104 const std::unordered_map<int, std::vector<MSWellTracerRate<Scalar>>>&
105 getMswTracerRates()
const {
return mSwTracerRate_;}
107 template<
class Serializer>
108 void serializeOp(Serializer& serializer)
110 serializer(tracerConcentration_);
111 serializer(freeTracerConcentration_);
112 serializer(solTracerConcentration_);
113 serializer(wellTracerRate_);
114 serializer(wellFreeTracerRate_);
115 serializer(wellSolTracerRate_);
116 serializer(mSwTracerRate_);
120 GenericTracerModel(
const GridView& gridView,
121 const EclipseState& eclState,
122 const CartesianIndexMapper& cartMapper,
123 const DofMapper& dofMapper,
124 const std::function<std::array<double,dimWorld>(
int)> centroids);
130 std::size_t numGridDof,
131 std::size_t gasPhaseIdx,
132 std::size_t oilPhaseIdx,
133 std::size_t waterPhaseIdx);
135 bool linearSolve_(
const TracerMatrix& M, TracerVector& x, TracerVector& b);
137 bool linearSolveBatchwise_(
const TracerMatrix& M,
138 std::vector<TracerVector>& x,
139 std::vector<TracerVector>& b);
141 Scalar currentConcentration_(
const Well& eclWell,
142 const std::string& trName,
143 const SummaryState& summaryState)
const;
151 const GridView& gridView_;
152 const EclipseState& eclState_;
153 const CartesianIndexMapper& cartMapper_;
154 const DofMapper& dofMapper_;
156 std::vector<int> tracerPhaseIdx_;
157 std::vector<bool> enableSolTracers_;
158 std::vector<TracerVector> tracerConcentration_;
159 std::unique_ptr<TracerMatrix> tracerMatrix_;
160 std::vector<TracerVectorSingle> freeTracerConcentration_;
161 std::vector<TracerVectorSingle> solTracerConcentration_;
164 std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> wellTracerRate_;
165 std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> wellFreeTracerRate_;
166 std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> wellSolTracerRate_;
168 std::unordered_map<int, std::vector<MSWellTracerRate<Scalar>>> mSwTracerRate_;
void doInit(bool rst, std::size_t numGridDof, std::size_t gasPhaseIdx, std::size_t oilPhaseIdx, std::size_t waterPhaseIdx)
Initialize all internal data structures needed by the tracer module.
Definition GenericTracerModel_impl.hpp:227