GenericTracerModel_impl.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef OPM_GENERIC_TRACER_MODEL_IMPL_HPP
29#define OPM_GENERIC_TRACER_MODEL_IMPL_HPP
30
31#include <dune/istl/operators.hh>
32#include <dune/istl/solvers.hh>
33#include <dune/istl/schwarz.hh>
34#include <dune/istl/preconditioners.hh>
35#include <dune/istl/schwarz.hh>
36
37#include <opm/common/OpmLog/OpmLog.hpp>
38#include <opm/common/TimingMacros.hpp>
39
40#include <opm/grid/CpGrid.hpp>
41
42#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
43#include <opm/input/eclipse/EclipseState/Tables/TracerVdTable.hpp>
44#include <opm/input/eclipse/Schedule/Well/Well.hpp>
45#include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
46
48
55
56#include <fmt/format.h>
57
58#include <array>
59#include <functional>
60#include <memory>
61#include <set>
62#include <stdexcept>
63#include <string>
64
65namespace Opm {
67#if HAVE_MPI
68template<class M, class V>
70{
71 using Comm = Dune::OwnerOverlapCopyCommunication<int, int>;
72 using TracerOperator = Dune::OverlappingSchwarzOperator<M, V, V, Comm>;
74};
76template<class Vector, class Grid, class Matrix>
77std::tuple<std::unique_ptr<Dune::OverlappingSchwarzOperator<Matrix,Vector,Vector,
78 Dune::OwnerOverlapCopyCommunication<int,int>>>,
79 std::unique_ptr<typename TracerSolverSelector<Matrix,Vector>::type>>
80createParallelFlexibleSolver(const Grid&, const Matrix&, const PropertyTree&)
81{
82 OPM_THROW(std::logic_error, "Grid not supported for parallel Tracers.");
83 return {nullptr, nullptr};
86template<class Vector, class Matrix>
87std::tuple<std::unique_ptr<Dune::OverlappingSchwarzOperator<Matrix,Vector,Vector,
88 Dune::OwnerOverlapCopyCommunication<int,int>>>,
89 std::unique_ptr<typename TracerSolverSelector<Matrix,Vector>::type>>
90createParallelFlexibleSolver(const Dune::CpGrid& grid, const Matrix& M, const PropertyTree& prm)
91{
92 using TracerOperator = Dune::OverlappingSchwarzOperator<Matrix,Vector,Vector,
93 Dune::OwnerOverlapCopyCommunication<int,int>>;
94 using TracerSolver = Dune::FlexibleSolver<TracerOperator>;
95 const auto& cellComm = grid.cellCommunication();
96 auto op = std::make_unique<TracerOperator>(M, cellComm);
97 auto dummyWeights = [](){ return Vector();};
98 return {std::move(op), std::make_unique<TracerSolver>(*op, cellComm, prm, dummyWeights, 0)};
99}
100#endif
101
102template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
104GenericTracerModel(const GridView& gridView,
105 const EclipseState& eclState,
106 const CartesianIndexMapper& cartMapper,
107 const DofMapper& dofMapper,
108 const std::function<std::array<double,dimWorld>(int)> centroids)
109 : gridView_(gridView)
110 , eclState_(eclState)
111 , cartMapper_(cartMapper)
112 , dofMapper_(dofMapper)
113 , centroids_(centroids)
114{
115}
116
117template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
119freeTracerConcentration(int tracerIdx, int globalDofIdx) const
121 if (freeTracerConcentration_.empty()) {
122 return 0.0;
123 }
124
125 return freeTracerConcentration_[tracerIdx][globalDofIdx][0];
126}
127
128template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
130solTracerConcentration(int tracerIdx, int globalDofIdx) const
131{
132 if (solTracerConcentration_.empty()) {
133 return 0.0;
134 }
136 return solTracerConcentration_[tracerIdx][globalDofIdx][0];
138
139template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
141setFreeTracerConcentration(int tracerIdx, int globalDofIdx, Scalar value)
142{
143 this->freeTracerConcentration_[tracerIdx][globalDofIdx][0] = value;
144 this->tracerConcentration_[tracerIdx][globalDofIdx][0] = value;
145}
146
147template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
149setSolTracerConcentration(int tracerIdx, int globalDofIdx, Scalar value)
150{
151 this->solTracerConcentration_[tracerIdx][globalDofIdx][0] = value;
152 this->tracerConcentration_[tracerIdx][globalDofIdx][1] = value;
153}
154
155template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
157setEnableSolTracers(int tracerIdx, bool enableSolTracer)
158{
159 this->enableSolTracers_[tracerIdx] = enableSolTracer;
160}
161
162template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
164numTracers() const
165{
166 return this->eclState_.tracer().size();
167}
168
169template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
171fname(int tracerIdx) const
172{
173 return this->eclState_.tracer()[tracerIdx].fname();
174}
175
176template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
178sname(int tracerIdx) const
179{
180 return this->eclState_.tracer()[tracerIdx].sname();
181}
182
183template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
185wellfname(int tracerIdx) const
186{
187 return this->eclState_.tracer()[tracerIdx].wellfname();
188}
189
190template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
192wellsname(int tracerIdx) const
193{
194 return this->eclState_.tracer()[tracerIdx].wellsname();
195}
196
197template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
199phase(int tracerIdx) const
200{
201 return this->eclState_.tracer()[tracerIdx].phase;
202}
203
204template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
206enableSolTracers() const
207{
208 return this->enableSolTracers_;
209}
210
211template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
213currentConcentration_(const Well& eclWell, const std::string& trName, const SummaryState& summaryState) const
214{
215 return eclWell.getTracerProperties().getConcentration(WellTracerProperties::Well { eclWell.name() },
216 WellTracerProperties::Tracer { trName },
217 summaryState);
218}
219
220template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
222name(int tracerIdx) const
223{
224 return this->eclState_.tracer()[tracerIdx].name;
225}
226
227template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
229doInit(bool rst, std::size_t numGridDof,
230 std::size_t gasPhaseIdx, std::size_t oilPhaseIdx, std::size_t waterPhaseIdx)
231{
232 const auto& tracers = eclState_.tracer();
233
234 if (tracers.size() == 0) {
235 return; // tracer treatment is supposed to be disabled
236 }
237
238 // retrieve the number of tracers from the deck
239 const std::size_t numTracers = tracers.size();
240 enableSolTracers_.resize(numTracers);
241 tracerConcentration_.resize(numTracers);
242 freeTracerConcentration_.resize(numTracers);
243 solTracerConcentration_.resize(numTracers);
244
245 // the phase where the tracer is
246 tracerPhaseIdx_.resize(numTracers);
247 for (std::size_t tracerIdx = 0; tracerIdx < numTracers; tracerIdx++) {
248 const auto& tracer = tracers[tracerIdx];
249
250 if (tracer.phase == Phase::WATER)
251 tracerPhaseIdx_[tracerIdx] = waterPhaseIdx;
252 else if (tracer.phase == Phase::OIL)
253 tracerPhaseIdx_[tracerIdx] = oilPhaseIdx;
254 else if (tracer.phase == Phase::GAS)
255 tracerPhaseIdx_[tracerIdx] = gasPhaseIdx;
256
257 tracerConcentration_[tracerIdx].resize(numGridDof);
258 freeTracerConcentration_[tracerIdx].resize(numGridDof);
259 solTracerConcentration_[tracerIdx].resize(numGridDof);
260
261 if (rst)
262 continue;
263
264
265 // TBLKF keyword
266 if (tracer.free_concentration.has_value()){
267 const auto& free_concentration = tracer.free_concentration.value();
268 int tblkDatasize = free_concentration.size();
269 if (tblkDatasize < cartMapper_.cartesianSize()){
270 throw std::runtime_error("Wrong size of TBLKF for" + tracer.name);
271 }
272 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
273 int cartDofIdx = cartMapper_.cartesianIndex(globalDofIdx);
274 tracerConcentration_[tracerIdx][globalDofIdx][0] = free_concentration[cartDofIdx];
275 freeTracerConcentration_[tracerIdx][globalDofIdx] = free_concentration[cartDofIdx];
276 }
277 }
278 // TVDPF keyword
279 else if (tracer.free_tvdp.has_value()) {
280 const auto& free_tvdp = tracer.free_tvdp.value();
281 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
282 tracerConcentration_[tracerIdx][globalDofIdx][0] =
283 free_tvdp.evaluate("TRACER_CONCENTRATION",
284 centroids_(globalDofIdx)[2]);
285 freeTracerConcentration_[tracerIdx][globalDofIdx] =
286 free_tvdp.evaluate("TRACER_CONCENTRATION",
287 centroids_(globalDofIdx)[2]);
288 }
289 }
290 else {
291 OpmLog::warning(fmt::format("No TBLKF or TVDPF given for free tracer {}. "
292 "Initial values set to zero. ", tracer.name));
293 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
294 tracerConcentration_[tracerIdx][globalDofIdx][0] = 0.0;
295 freeTracerConcentration_[tracerIdx][globalDofIdx] = 0.0;
296 }
297 }
298
299 // Solution tracer initialization only needed for gas/oil tracers with DISGAS/VAPOIL active
300 if (tracer.phase != Phase::WATER &&
301 ((tracer.phase == Phase::GAS && FluidSystem::enableDissolvedGas()) ||
302 (tracer.phase == Phase::OIL && FluidSystem::enableVaporizedOil()))) {
303 // TBLKS keyword
304 if (tracer.solution_concentration.has_value()){
305 enableSolTracers_[tracerIdx] = true;
306 const auto& solution_concentration = tracer.solution_concentration.value();
307 int tblkDatasize = solution_concentration.size();
308 if (tblkDatasize < cartMapper_.cartesianSize()){
309 throw std::runtime_error("Wrong size of TBLKS for" + tracer.name);
310 }
311 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
312 int cartDofIdx = cartMapper_.cartesianIndex(globalDofIdx);
313 tracerConcentration_[tracerIdx][globalDofIdx][1] = solution_concentration[cartDofIdx];
314 solTracerConcentration_[tracerIdx][globalDofIdx] = solution_concentration[cartDofIdx];
315 }
316 }
317 // TVDPS keyword
318 else if (tracer.solution_tvdp.has_value()) {
319 enableSolTracers_[tracerIdx] = true;
320 const auto& solution_tvdp = tracer.solution_tvdp.value();
321 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
322 tracerConcentration_[tracerIdx][globalDofIdx][1] =
323 solution_tvdp.evaluate("TRACER_CONCENTRATION",
324 centroids_(globalDofIdx)[2]);
325 solTracerConcentration_[tracerIdx][globalDofIdx] =
326 solution_tvdp.evaluate("TRACER_CONCENTRATION",
327 centroids_(globalDofIdx)[2]);
328 }
329 }
330 else {
331 // No solution tracers, default to zero
332 enableSolTracers_[tracerIdx] = false;
333 OpmLog::warning(fmt::format("No TBLKS or TVDPS given for solution tracer {}. "
334 "Initial values set to zero. ", tracer.name));
335 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
336 tracerConcentration_[tracerIdx][globalDofIdx][1] = 0.0;
337 solTracerConcentration_[tracerIdx][globalDofIdx] = 0.0;
338 }
339 }
340 }
341 else {
342 // No solution tracers, default to zero
343 enableSolTracers_[tracerIdx] = false;
344 for (std::size_t globalDofIdx = 0; globalDofIdx < numGridDof; ++globalDofIdx) {
345 tracerConcentration_[tracerIdx][globalDofIdx][1] = 0.0;
346 solTracerConcentration_[tracerIdx][globalDofIdx] = 0.0;
347 }
348 }
349 }
350
351 // allocate matrix for storing the Jacobian of the tracer residual
352 tracerMatrix_ = std::make_unique<TracerMatrix>(numGridDof, numGridDof, TracerMatrix::random);
353
354 // find the sparsity pattern of the tracer matrix
355 using NeighborSet = std::set<unsigned>;
356 std::vector<NeighborSet> neighbors(numGridDof);
357
358 Stencil stencil(gridView_, dofMapper_);
359 for (const auto& elem : elements(gridView_)) {
360 stencil.update(elem);
361
362 for (unsigned primaryDofIdx = 0; primaryDofIdx < stencil.numPrimaryDof(); ++primaryDofIdx) {
363 unsigned myIdx = stencil.globalSpaceIndex(primaryDofIdx);
364
365 for (unsigned dofIdx = 0; dofIdx < stencil.numDof(); ++dofIdx) {
366 unsigned neighborIdx = stencil.globalSpaceIndex(dofIdx);
367 neighbors[myIdx].insert(neighborIdx);
368 }
369 }
370 }
371
372 // allocate space for the rows of the matrix
373 for (unsigned dofIdx = 0; dofIdx < numGridDof; ++ dofIdx) {
374 tracerMatrix_->setrowsize(dofIdx, neighbors[dofIdx].size());
375 }
376 tracerMatrix_->endrowsizes();
377
378 // fill the rows with indices. each degree of freedom talks to
379 // all of its neighbors. (it also talks to itself since
380 // degrees of freedom are sometimes quite egocentric.)
381 for (unsigned dofIdx = 0; dofIdx < numGridDof; ++ dofIdx) {
382 for (const auto& index : neighbors[dofIdx]) {
383 tracerMatrix_->addindex(dofIdx, index);
384 }
385 }
386 tracerMatrix_->endindices();
387}
388
389template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
392{
393 x = 0.0;
394 Scalar tolerance = 1e-2;
395 int maxIter = 100;
396
397 int verbosity = 0;
398 PropertyTree prm;
399 prm.put("maxiter", maxIter);
400 prm.put("tol", tolerance);
401 prm.put("verbosity", verbosity);
402 prm.put("solver", std::string("bicgstab"));
403 prm.put("preconditioner.type", std::string("paroverilu0"));
404
405#if HAVE_MPI
406 if(gridView_.grid().comm().size() > 1)
407 {
408 auto [tracerOperator, solver] =
409 createParallelFlexibleSolver<TracerVector>(gridView_.grid(), M, prm);
410 (void) tracerOperator;
411
413 solver->apply(x, b, result);
414
415 // return the result of the solver
416 return result.converged;
417 }
418 else
419 {
420#endif
421 using TracerSolver = Dune::BiCGSTABSolver<TracerVector>;
422 using TracerOperator = Dune::MatrixAdapter<TracerMatrix,TracerVector,TracerVector>;
423 using TracerScalarProduct = Dune::SeqScalarProduct<TracerVector>;
424 using TracerPreconditioner = Dune::SeqILU< TracerMatrix,TracerVector,TracerVector>;
425
426 TracerOperator tracerOperator(M);
427 TracerScalarProduct tracerScalarProduct;
428 TracerPreconditioner tracerPreconditioner(M, 0, 1); // results in ILU0
429
430 TracerSolver solver (tracerOperator, tracerScalarProduct,
431 tracerPreconditioner, tolerance, maxIter,
432 verbosity);
433
435 solver.apply(x, b, result);
436
437 // return the result of the solver
438 return result.converged;
439#if HAVE_MPI
440 }
441#endif
442}
443
444template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
446linearSolveBatchwise_(const TracerMatrix& M, std::vector<TracerVector>& x, std::vector<TracerVector>& b)
447{
448 OPM_TIMEBLOCK(tracerSolve);
449 const Scalar tolerance = 1e-2;
450 const int maxIter = 100;
451 const int verbosity = 0;
452
453#if HAVE_MPI
454 if (gridView_.grid().comm().size() > 1)
455 {
456 PropertyTree prm;
457 prm.put("maxiter", maxIter);
458 prm.put("tol", tolerance);
459 prm.put("verbosity", verbosity);
460 prm.put("solver", std::string("bicgstab"));
461 prm.put("preconditioner.type", std::string("paroverilu0"));
462 auto [tracerOperator, solver] =
463 createParallelFlexibleSolver<TracerVector>(gridView_.grid(), M, prm);
464 (void) tracerOperator;
465 bool converged = true;
466 for (std::size_t nrhs = 0; nrhs < b.size(); ++nrhs) {
467 x[nrhs] = 0.0;
469 solver->apply(x[nrhs], b[nrhs], result);
470 converged = (converged && result.converged);
471 }
472 return converged;
473 }
474 else
475#endif
476 {
477 using TracerSolver = Dune::BiCGSTABSolver<TracerVector>;
478 using TracerOperator = Dune::MatrixAdapter<TracerMatrix,TracerVector,TracerVector>;
479 using TracerScalarProduct = Dune::SeqScalarProduct<TracerVector>;
480 using TracerPreconditioner = Dune::SeqILU<TracerMatrix,TracerVector,TracerVector>;
481
482 if (std::ranges::all_of(b, [](const auto& v) { return v.infinity_norm() == 0.0; }))
483 {
484 return true;
485 }
486
487 TracerOperator tracerOperator(M);
488 TracerScalarProduct tracerScalarProduct;
489 TracerPreconditioner tracerPreconditioner(M, 0, 1); // results in ILU0
490
491 TracerSolver solver (tracerOperator, tracerScalarProduct,
492 tracerPreconditioner, tolerance, maxIter,
493 verbosity);
494
495 bool converged = true;
496 for (std::size_t nrhs = 0; nrhs < b.size(); ++nrhs) {
497 x[nrhs] = 0.0;
499 solver.apply(x[nrhs], b[nrhs], result);
500 converged = (converged && result.converged);
501 }
502
503 // return the result of the solver
504 return converged;
505 }
506}
507
508template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
510linearSolveReorder_(const TracerMatrix& M, std::vector<TracerVector>& x, std::vector<TracerVector>& b)
511{
512 OPM_TIMEBLOCK(tracerSolveReorder);
513 for (auto& v : x) {
514 v = 0.0;
515 }
516
517 // A fallback to the ISTL solver communicates, so all ranks must agree on the result
518 bool solved = true;
519 try {
520 const auto statistics = solveReordered(M, b, x);
521 OpmLog::debug(fmt::format("Tracer reorder solver: {} components, {} loops, "
522 "largest component {} cells, {} Gauss-Seidel sweeps",
523 statistics.numComponents,
524 statistics.numLoops,
525 statistics.largestComponent,
526 statistics.maxIterations));
527 }
528 catch (const std::runtime_error& e) {
529 OpmLog::warning(fmt::format("Tracer reorder solver failed: {}", e.what()));
530 solved = false;
531 }
532 const auto& comm = gridView_.comm();
533 if (comm.min(static_cast<int>(solved)) == 0) {
534 return false;
535 }
536
537 // The overlap cells get the solution of the rank that owns them
538 if (comm.size() > 1) {
540 gridView_.communicate(handle, Dune::InteriorBorder_All_Interface,
541 Dune::ForwardCommunication);
542 }
543 return true;
544}
545
546} // namespace Opm
547
548#endif // OPM_GENERIC_TRACER_MODEL_IMPL_HPP
A datahandle sending data located in multiple vectors.
Definition: CollectDataOnIORank.hpp:50
Definition: FlexibleSolver.hpp:45
void setEnableSolTracers(int tracerIdx, bool enableSolTracer)
Definition: GenericTracerModel_impl.hpp:157
Opm::BlockVector< Dune::FieldVector< Scalar, 2 > > TracerVector
Definition: GenericTracerModel.hpp:60
int numTracers() const
Return the number of tracers considered by the tracerModel.
Definition: GenericTracerModel_impl.hpp:164
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:229
std::string sname(int tracerIdx) const
Definition: GenericTracerModel_impl.hpp:178
void setSolTracerConcentration(int tracerIdx, int globalDofIdx, Scalar value)
Definition: GenericTracerModel_impl.hpp:149
std::string wellfname(int tracerIdx) const
Definition: GenericTracerModel_impl.hpp:185
GenericTracerModel(const GridView &gridView, const EclipseState &eclState, const CartesianIndexMapper &cartMapper, const DofMapper &dofMapper, const std::function< std::array< double, dimWorld >(int)> centroids)
Definition: GenericTracerModel_impl.hpp:104
const std::string & name(int tracerIdx) const
Return the tracer name.
Definition: GenericTracerModel_impl.hpp:222
const std::vector< bool > & enableSolTracers() const
Definition: GenericTracerModel_impl.hpp:206
Phase phase(int tracerIdx) const
Definition: GenericTracerModel_impl.hpp:199
std::string wellsname(int tracerIdx) const
Definition: GenericTracerModel_impl.hpp:192
std::string fname(int tracerIdx) const
Definition: GenericTracerModel_impl.hpp:171
bool linearSolveReorder_(const TracerMatrix &M, std::vector< TracerVector > &x, std::vector< TracerVector > &b)
Solve the tracer equations cell by cell in the order of the flow.
Definition: GenericTracerModel_impl.hpp:510
bool linearSolve_(const TracerMatrix &M, TracerVector &x, TracerVector &b)
Definition: GenericTracerModel_impl.hpp:391
Opm::BCRSMatrix< Opm::MatrixBlock< Scalar, 2, 2 > > TracerMatrix
Definition: GenericTracerModel.hpp:59
void setFreeTracerConcentration(int tracerIdx, int globalDofIdx, Scalar value)
Definition: GenericTracerModel_impl.hpp:141
Scalar solTracerConcentration(int tracerIdx, int globalDofIdx) const
Definition: GenericTracerModel_impl.hpp:130
bool linearSolveBatchwise_(const TracerMatrix &M, std::vector< TracerVector > &x, std::vector< TracerVector > &b)
Definition: GenericTracerModel_impl.hpp:446
Scalar freeTracerConcentration(int tracerIdx, int globalDofIdx) const
Return the tracer concentration for tracer index and global DofIdx.
Definition: GenericTracerModel_impl.hpp:119
Scalar currentConcentration_(const Well &eclWell, const std::string &trName, const SummaryState &summaryState) const
Definition: GenericTracerModel_impl.hpp:213
Hierarchical collection of key/value pairs.
Definition: PropertyTree.hpp:39
void put(const std::string &key, const T &data)
A data handle sending multiple data store in vectors attached to cells.
Definition: VectorVectorDataHandle.hpp:52
Phase
Phase indices for reservoir coupling, we currently only support black-oil phases (oil,...
Definition: ReservoirCoupling.hpp:184
Definition: blackoilbioeffectsmodules.hh:45
Dune::InverseOperatorResult InverseOperatorResult
Definition: GpuBridge.hpp:32
UpwindTransportStatistics solveReordered(const Matrix &matrix, const Vectors &rhs, Vectors &x, const UpwindTransportSettings &settings={})
Solve the block system A x_q = b_q described in the file comment.
Definition: UpwindTransportSolver.hpp:716
std::tuple< std::unique_ptr< Dune::OverlappingSchwarzOperator< Matrix, Vector, Vector, Dune::OwnerOverlapCopyCommunication< int, int > > >, std::unique_ptr< typename EnergySolverSelector< Matrix, Vector >::type > > createParallelFlexibleSolver(const Grid &, const Matrix &, const PropertyTree &)
Definition: GenericTemperatureModel_impl.hpp:78
Definition: GenericTracerModel_impl.hpp:70
Dune::FlexibleSolver< TracerOperator > type
Definition: GenericTracerModel_impl.hpp:73
Dune::OverlappingSchwarzOperator< M, V, V, Comm > TracerOperator
Definition: GenericTracerModel_impl.hpp:72
Dune::OwnerOverlapCopyCommunication< int, int > Comm
Definition: GenericTracerModel_impl.hpp:71