57 using TracerVectorSingle = Dune::BlockVector<Dune::FieldVector<Scalar, 1>>;
58 using TracerMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 2, 2>>;
59 using TracerVector = Dune::BlockVector<Dune::FieldVector<Scalar, 2>>;
61 static constexpr int dimWorld = Grid::dimensionworld;
70 const std::string&
name(
int tracerIdx)
const;
71 std::string fname(
int tracerIdx)
const;
72 std::string sname(
int tracerIdx)
const;
73 std::string wellfname(
int tracerIdx)
const;
74 std::string wellsname(
int tracerIdx)
const;
76 Phase phase(
int tracerIdx)
const;
77 const std::vector<bool>& enableSolTracers()
const;
83 Scalar solTracerConcentration(
int tracerIdx,
int globalDofIdx)
const;
84 void setFreeTracerConcentration(
int tracerIdx,
int globalDofIdx, Scalar value);
85 void setSolTracerConcentration(
int tracerIdx,
int globalDofIdx, Scalar value);
86 void setEnableSolTracers(
int tracerIdx,
bool enableSolTracer);
91 const std::map<std::pair<std::string, std::string>, Scalar>&
93 const std::map<std::pair<std::string, std::string>, Scalar>&
94 getWellFreeTracerRates()
const {
return wellFreeTracerRate_;}
95 const std::map<std::pair<std::string, std::string>, Scalar>&
96 getWellSolTracerRates()
const {
return wellSolTracerRate_;}
97 const std::map<std::tuple<std::string, std::string, std::size_t>, Scalar>&
98 getMswTracerRates()
const {
return mSwTracerRate_;}
100 template<
class Serializer>
101 void serializeOp(Serializer& serializer)
103 serializer(tracerConcentration_);
104 serializer(freeTracerConcentration_);
105 serializer(solTracerConcentration_);
106 serializer(wellTracerRate_);
107 serializer(wellFreeTracerRate_);
108 serializer(wellSolTracerRate_);
109 serializer(mSwTracerRate_);
113 GenericTracerModel(
const GridView& gridView,
114 const EclipseState& eclState,
115 const CartesianIndexMapper& cartMapper,
116 const DofMapper& dofMapper,
117 const std::function<std::array<double,dimWorld>(
int)> centroids);
123 std::size_t numGridDof,
124 std::size_t gasPhaseIdx,
125 std::size_t oilPhaseIdx,
126 std::size_t waterPhaseIdx);
128 bool linearSolve_(
const TracerMatrix& M, TracerVector& x, TracerVector& b);
130 bool linearSolveBatchwise_(
const TracerMatrix& M,
131 std::vector<TracerVector>& x,
132 std::vector<TracerVector>& b);
134 Scalar currentConcentration_(
const Well& eclWell,
const std::string&
name)
const;
136 const GridView& gridView_;
137 const EclipseState& eclState_;
138 const CartesianIndexMapper& cartMapper_;
139 const DofMapper& dofMapper_;
141 std::vector<int> tracerPhaseIdx_;
142 std::vector<bool> enableSolTracers_;
143 std::vector<TracerVector> tracerConcentration_;
144 std::unique_ptr<TracerMatrix> tracerMatrix_;
145 std::vector<TracerVectorSingle> freeTracerConcentration_;
146 std::vector<TracerVectorSingle> solTracerConcentration_;
149 std::map<std::pair<std::string, std::string>, Scalar> wellTracerRate_;
150 std::map<std::pair<std::string, std::string>, Scalar> wellFreeTracerRate_;
151 std::map<std::pair<std::string, std::string>, Scalar> wellSolTracerRate_;
154 std::map<std::tuple<std::string, std::string, std::size_t>, 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:222