GpuFlowProblem.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 Copyright 2026 Equinor ASA
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
30#ifndef OPM_GPU_FLOW_PROBLEM_HPP
31#define OPM_GPU_FLOW_PROBLEM_HPP
32
33#include <opm/common/utility/VectorWithDefaultAllocator.hpp>
34#include <opm/common/utility/gpuDecorators.hpp>
35#include <opm/common/ErrorMacros.hpp>
36
38
39#include <opm/material/fluidmatrixinteractions/GpuEclMaterialLawManager.hpp>
40#include <opm/material/thermal/GpuEclThermalLawManager.hpp>
41
42#include <concepts>
43#include <cstddef>
44#include <type_traits>
45#include <utility>
46#include <vector>
47
48namespace Opm::gpuistl
49{
50template <typename T>
52template <typename T>
53class GpuView;
54} // namespace Opm::gpuistl
55
56namespace Opm {
57
73{
74 using FluidSystem = void;
77
78 OPM_HOST_DEVICE SolidEnergyLawParams solidEnergyLawParams(unsigned /*elemIdx*/) const
79 {
80 return SolidEnergyLawParams{};
81 }
82 OPM_HOST_DEVICE ThermalConductionLawParams
83 thermalConductionLawParams(unsigned /*elemIdx*/) const
84 {
86 }
87};
88
89} // namespace Opm
90
91namespace Opm::gpuistl {
92
94inline ::Opm::NoThermalLawManager
95copy_to_gpu(const ::Opm::NoThermalLawManager& /*cpu*/)
96{
97 return ::Opm::NoThermalLawManager{};
98}
99
101inline ::Opm::NoThermalLawManager
103{
104 return ::Opm::NoThermalLawManager{};
105}
106
107} // namespace Opm::gpuistl
108
109namespace Opm {
110
132template <class ScalarT,
133 class MaterialLawManagerT,
134 template <class> class Storage = ::Opm::VectorWithDefaultAllocator,
135 class ThermalLawManagerT = ::Opm::NoThermalLawManager>
137{
138public:
139 using Scalar = ScalarT;
140 using EclMaterialLawManager = MaterialLawManagerT;
141 using MaterialLawParams = typename EclMaterialLawManager::MaterialLawParams;
142 using EclThermalLawManager = ThermalLawManagerT;
143 using SolidEnergyLawParams = typename EclThermalLawManager::SolidEnergyLawParams;
144 using ThermalConductionLawParams = typename EclThermalLawManager::ThermalConductionLawParams;
145
149 static constexpr bool hasThermal
150 = !std::is_same_v<typename EclThermalLawManager::FluidSystem, void>;
151
156 {
158 {
160 {
161 return LinearizationType{};
162 }
163 };
164
165 OPM_HOST_DEVICE LinearizerView linearizer() const
166 {
167 return LinearizerView{};
168 }
169 };
170
171 GpuFlowProblem() = default;
172
174 Storage<Scalar> porosity,
175 Storage<Scalar> rockCompressibility,
176 Storage<Scalar> rockReferencePressure,
177 Storage<Scalar> maxOilSaturation,
178 Storage<Scalar> maxOilVaporizationFactor,
179 Storage<Scalar> maxGasDissolutionFactor,
181 Storage<Scalar> rockFraction,
182 Storage<int> pvtRegionIndex,
183 bool usesDefaultRockCompaction)
184 : materialLawManager_(std::move(materialLawManager))
185 , porosity_(std::move(porosity))
186 , rockCompressibility_(std::move(rockCompressibility))
187 , rockReferencePressure_(std::move(rockReferencePressure))
188 , maxOilSaturation_(std::move(maxOilSaturation))
189 , maxOilVaporizationFactor_(std::move(maxOilVaporizationFactor))
190 , maxGasDissolutionFactor_(std::move(maxGasDissolutionFactor))
191 , thermalLawManager_(std::move(thermalLawManager))
192 , rockFraction_(std::move(rockFraction))
193 , pvtRegionIndex_(std::move(pvtRegionIndex))
194 {
195 if (!usesDefaultRockCompaction) {
196 OPM_THROW(std::logic_error,
197 "GPU FlowProblem does not support non-default rock compaction multipliers");
198 }
199 }
200
214 template <class CpuProblem>
215 requires std::same_as<Storage<Scalar>, ::Opm::VectorWithDefaultAllocator<Scalar>>
216 explicit GpuFlowProblem(const CpuProblem& cpu)
217 : materialLawManager_(cpu.materialLawManager(), cpu.model().numGridDof())
218 {
219 if (!cpu.usesDefaultRockCompaction()) {
220 OPM_THROW(std::logic_error,
221 "GPU FlowProblem does not support non-default rock compaction multipliers");
222 }
223 const std::size_t n = cpu.model().numGridDof();
224 porosity_.resize(n);
225 rockCompressibility_.resize(n);
226 rockReferencePressure_.resize(n);
227 maxOilSaturation_.resize(n);
228 maxOilVaporizationFactor_.resize(n);
229 maxGasDissolutionFactor_.resize(n);
230 for (std::size_t i = 0; i < n; ++i) {
231 const unsigned u = static_cast<unsigned>(i);
232 porosity_[i] = cpu.porosity(u, 0u);
233 rockCompressibility_[i] = cpu.rockCompressibility(u);
234 rockReferencePressure_[i] = cpu.rockReferencePressure(u);
235 maxOilSaturation_[i] = cpu.maxOilSaturation(u);
236 maxOilVaporizationFactor_[i] = cpu.maxOilVaporizationFactor(0u, u);
237 maxGasDissolutionFactor_[i] = cpu.maxGasDissolutionFactor(0u, u);
238 }
239 if constexpr (hasThermal) {
240 using FluidSystemTag = typename EclThermalLawManager::FluidSystem;
241 thermalLawManager_
242 = ::Opm::EclThermalLaw::buildCpuManagerFromFlowProblem<Scalar, FluidSystemTag>(
243 cpu, n);
244 rockFraction_.resize(n);
245 pvtRegionIndex_.resize(n);
246 for (std::size_t i = 0; i < n; ++i) {
247 const unsigned u = static_cast<unsigned>(i);
248 rockFraction_[i] = cpu.rockFraction(u, 0u);
249 pvtRegionIndex_[i] = static_cast<int>(cpu.pvtRegionIndex(u));
250 }
251 }
252 }
253
266 template <class CpuProblem>
267 requires std::same_as<Storage<Scalar>, ::Opm::gpuistl::GpuBuffer<Scalar>>
268 explicit GpuFlowProblem(const CpuProblem& cpu)
269 : materialLawManager_(cpu.materialLawManager(), cpu.model().numGridDof())
270 , porosity_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
271 return Scalar(p.porosity(u, 0u));
272 }))
273 , rockCompressibility_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
274 return Scalar(p.rockCompressibility(u));
275 }))
276 , rockReferencePressure_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
277 return Scalar(p.rockReferencePressure(u));
278 }))
279 , maxOilSaturation_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
280 return Scalar(p.maxOilSaturation(u));
281 }))
282 , maxOilVaporizationFactor_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
283 return Scalar(p.maxOilVaporizationFactor(0u, u));
284 }))
285 , maxGasDissolutionFactor_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
286 return Scalar(p.maxGasDissolutionFactor(0u, u));
287 }))
288 , thermalLawManager_(buildGpuThermalManager(cpu))
289 , rockFraction_(extractThermalScalarField(cpu, [](const CpuProblem& p, unsigned u) {
290 return Scalar(p.rockFraction(u, 0u));
291 }))
292 , pvtRegionIndex_(extractThermalIntField(cpu, [](const CpuProblem& p, unsigned u) {
293 return static_cast<int>(p.pvtRegionIndex(u));
294 }))
295 {
296 if (!cpu.usesDefaultRockCompaction()) {
297 OPM_THROW(std::logic_error,
298 "GPU FlowProblem does not support non-default rock compaction multipliers");
299 }
300 }
301
302 OPM_HOST_DEVICE ModelView model() const
303 {
304 return ModelView{};
305 }
306
307 OPM_HOST_DEVICE int satnumRegionIndex(std::size_t elemIdx) const
308 {
309 return materialLawManager_.satnumRegionIdx(static_cast<unsigned>(elemIdx));
310 }
311
312 OPM_HOST_DEVICE MaterialLawParams materialLawParams(std::size_t elemIdx) const
313 {
314 return materialLawManager_.materialLawParams(static_cast<unsigned>(elemIdx));
315 }
316
317 OPM_HOST_DEVICE Scalar rockCompressibility(std::size_t elemIdx) const
318 {
319 return rockCompressibility_.size() == 0 ? Scalar(0) : rockCompressibility_[elemIdx];
320 }
321
322 OPM_HOST_DEVICE Scalar rockReferencePressure(std::size_t elemIdx) const
323 {
324 return rockReferencePressure_.size() == 0 ? Scalar(0) : rockReferencePressure_[elemIdx];
325 }
326
327 OPM_HOST_DEVICE Scalar porosity(std::size_t elemIdx, unsigned /*timeIdx*/) const
328 {
329 return porosity_.size() == 0 ? Scalar(0) : porosity_[elemIdx];
330 }
331
332 OPM_HOST_DEVICE Scalar maxOilVaporizationFactor(unsigned /*timeIdx*/, std::size_t elemIdx) const
333 {
334 return maxOilVaporizationFactor_.size() == 0 ? Scalar(0) : maxOilVaporizationFactor_[elemIdx];
335 }
336
337 OPM_HOST_DEVICE Scalar maxGasDissolutionFactor(unsigned /*timeIdx*/, std::size_t elemIdx) const
338 {
339 return maxGasDissolutionFactor_.size() == 0 ? Scalar(0) : maxGasDissolutionFactor_[elemIdx];
340 }
341
342 OPM_HOST_DEVICE Scalar maxOilSaturation(std::size_t elemIdx) const
343 {
344 return maxOilSaturation_.size() == 0 ? Scalar(0) : maxOilSaturation_[elemIdx];
345 }
346
349 OPM_HOST_DEVICE unsigned pvtRegionIndex(std::size_t elemIdx) const
350 {
351 return pvtRegionIndex_.size() == 0
352 ? 0u
353 : static_cast<unsigned>(pvtRegionIndex_[elemIdx]);
354 }
355
359 OPM_HOST_DEVICE Scalar rockFraction(std::size_t elemIdx, unsigned /*timeIdx*/) const
360 {
361 return rockFraction_.size() == 0 ? Scalar(0) : rockFraction_[elemIdx];
362 }
363
366 OPM_HOST_DEVICE SolidEnergyLawParams
367 solidEnergyLawParams(std::size_t elemIdx, unsigned /*timeIdx*/) const
368 {
369 return thermalLawManager_.solidEnergyLawParams(static_cast<unsigned>(elemIdx));
370 }
371
374 OPM_HOST_DEVICE ThermalConductionLawParams
375 thermalConductionLawParams(std::size_t elemIdx, unsigned /*timeIdx*/) const
376 {
377 return thermalLawManager_.thermalConductionLawParams(static_cast<unsigned>(elemIdx));
378 }
379
381 template <class Evaluation>
382 OPM_HOST_DEVICE Evaluation rockCompPoroMultiplier(const auto& /*intQuants*/, std::size_t /*elemIdx*/) const
383 {
384 // Ctor guarantees no rock compaction, this is therefore always correct
385 return Evaluation(1.0);
386 }
387
389 template <class Evaluation>
390 OPM_HOST_DEVICE Evaluation rockCompTransMultiplier(const auto& /*intQuants*/, std::size_t /*elemIdx*/) const
391 {
392 // Ctor guarantees no rock compaction, this is therefore always correct
393 return Evaluation(1.0);
394 }
395
407 template <class FluidState, class... Args>
408 OPM_HOST_DEVICE void updateRelperms(auto& mobility,
409 auto& /*dirMob*/,
410 FluidState& fluidState,
411 unsigned globalSpaceIdx) const
412 {
413 using ContainerT = std::decay_t<decltype(mobility)>;
414 const auto materialParams = materialLawParams(globalSpaceIdx);
415 EclMaterialLawManager::MaterialLaw::template relativePermeabilities<
416 ContainerT, FluidState, Args...>(mobility, materialParams, fluidState);
417 }
418
422 { return materialLawManager_; }
423
425 { return materialLawManager_; }
426
427 const Storage<Scalar>& porosityStorage() const
428 { return porosity_; }
429
430 Storage<Scalar>& porosityStorage()
431 { return porosity_; }
432
433 const Storage<Scalar>& rockCompressibilityStorage() const
434 { return rockCompressibility_; }
435
436 Storage<Scalar>& rockCompressibilityStorage()
437 { return rockCompressibility_; }
438
439 const Storage<Scalar>& rockReferencePressureStorage() const
440 { return rockReferencePressure_; }
441
443 { return rockReferencePressure_; }
444
445 const Storage<Scalar>& maxOilSaturationStorage() const
446 { return maxOilSaturation_; }
447
448 Storage<Scalar>& maxOilSaturationStorage()
449 { return maxOilSaturation_; }
450
451 const Storage<Scalar>& maxOilVaporizationFactorStorage() const
452 { return maxOilVaporizationFactor_; }
453
455 { return maxOilVaporizationFactor_; }
456
457 const Storage<Scalar>& maxGasDissolutionFactorStorage() const
458 { return maxGasDissolutionFactor_; }
459
461 { return maxGasDissolutionFactor_; }
462
464 { return thermalLawManager_; }
465
467 { return thermalLawManager_; }
468
469 const Storage<Scalar>& rockFractionStorage() const
470 { return rockFraction_; }
471
472 Storage<Scalar>& rockFractionStorage()
473 { return rockFraction_; }
474
475 const Storage<int>& pvtRegionIndexStorage() const
476 { return pvtRegionIndex_; }
477
478 Storage<int>& pvtRegionIndexStorage()
479 { return pvtRegionIndex_; }
481
482private:
483 template <class CpuProblem, class F>
484 static Storage<Scalar> extractRockField(const CpuProblem& cpu, F f)
485 {
486 const std::size_t n = cpu.model().numGridDof();
487 std::vector<Scalar> v(n);
488 for (std::size_t i = 0; i < n; ++i) {
489 v[i] = f(cpu, static_cast<unsigned>(i));
490 }
491 if constexpr (std::is_same_v<Storage<Scalar>,
492 ::Opm::VectorWithDefaultAllocator<Scalar>>) {
493 return Storage<Scalar>(v.begin(), v.end());
494 } else {
495 return Storage<Scalar>(v);
496 }
497 }
498
501 template <class CpuProblem, class F>
502 static Storage<Scalar> extractThermalScalarField(const CpuProblem& cpu, F f)
503 {
504 if constexpr (!hasThermal) {
505 return Storage<Scalar>{};
506 } else {
507 return extractRockField(cpu, f);
508 }
509 }
510
513 template <class CpuProblem, class F>
514 static Storage<int> extractThermalIntField(const CpuProblem& cpu, F f)
515 {
516 if constexpr (!hasThermal) {
517 return Storage<int>{};
518 } else {
519 const std::size_t n = cpu.model().numGridDof();
520 std::vector<int> v(n);
521 for (std::size_t i = 0; i < n; ++i) {
522 v[i] = f(cpu, static_cast<unsigned>(i));
523 }
524 if constexpr (std::is_same_v<Storage<int>,
525 ::Opm::VectorWithDefaultAllocator<int>>) {
526 return Storage<int>(v.begin(), v.end());
527 } else {
528 return Storage<int>(v);
529 }
530 }
531 }
532
536 template <class CpuProblem>
537 static EclThermalLawManager buildGpuThermalManager(const CpuProblem& cpu)
538 {
539 if constexpr (!hasThermal) {
540 return EclThermalLawManager{};
541 } else {
542 using FluidSystemTag = typename EclThermalLawManager::FluidSystem;
543 auto cpuMgr
544 = ::Opm::EclThermalLaw::buildCpuManagerFromFlowProblem<Scalar, FluidSystemTag>(
545 cpu, cpu.model().numGridDof());
547 }
548 }
549
550 EclMaterialLawManager materialLawManager_{};
551 Storage<Scalar> porosity_{};
552 Storage<Scalar> rockCompressibility_{};
553 Storage<Scalar> rockReferencePressure_{};
554 Storage<Scalar> maxOilSaturation_{};
555 Storage<Scalar> maxOilVaporizationFactor_{};
556 Storage<Scalar> maxGasDissolutionFactor_{};
557 EclThermalLawManager thermalLawManager_{};
558 Storage<Scalar> rockFraction_{};
559 Storage<int> pvtRegionIndex_{};
560};
561
562} // namespace Opm
563
564namespace Opm::gpuistl {
565
571template <class ScalarT, class CpuMaterialLawManager, class CpuThermalLawManager>
573 const ::Opm::GpuFlowProblem<ScalarT,
574 CpuMaterialLawManager,
575 ::Opm::VectorWithDefaultAllocator,
576 CpuThermalLawManager>& cpu)
577{
578 using GpuMaterialLawManagerBuffer
579 = decltype(::Opm::gpuistl::copy_to_gpu(cpu.materialLawManager()));
580 using GpuThermalLawManagerBuffer
581 = decltype(::Opm::gpuistl::copy_to_gpu(cpu.thermalLawManager()));
582 using GpuProblemType = ::Opm::GpuFlowProblem<ScalarT,
583 GpuMaterialLawManagerBuffer,
584 GpuBuffer,
585 GpuThermalLawManagerBuffer>;
586
587 return GpuProblemType(::Opm::gpuistl::copy_to_gpu(cpu.materialLawManager()),
588 GpuBuffer<ScalarT>(cpu.porosityStorage()),
589 GpuBuffer<ScalarT>(cpu.rockCompressibilityStorage()),
590 GpuBuffer<ScalarT>(cpu.rockReferencePressureStorage()),
591 GpuBuffer<ScalarT>(cpu.maxOilSaturationStorage()),
592 GpuBuffer<ScalarT>(cpu.maxOilVaporizationFactorStorage()),
593 GpuBuffer<ScalarT>(cpu.maxGasDissolutionFactorStorage()),
594 ::Opm::gpuistl::copy_to_gpu(cpu.thermalLawManager()),
595 GpuBuffer<ScalarT>(cpu.rockFractionStorage()),
596 GpuBuffer<int>(cpu.pvtRegionIndexStorage()),
597 true);
598}
599
604template <class ScalarT, class GpuBufferMaterialLawManager, class GpuBufferThermalLawManager>
606 GpuBufferMaterialLawManager,
607 GpuBuffer,
608 GpuBufferThermalLawManager>& buf)
609{
610 using GpuMaterialLawManagerView
611 = decltype(::Opm::gpuistl::make_view(buf.materialLawManager()));
612 using GpuThermalLawManagerView
613 = decltype(::Opm::gpuistl::make_view(buf.thermalLawManager()));
614 using GpuProblemView = ::Opm::GpuFlowProblem<ScalarT,
615 GpuMaterialLawManagerView,
616 GpuView,
617 GpuThermalLawManagerView>;
618
619 auto toView = [](auto& storage) {
620 using T = typename std::decay_t<decltype(storage)>::value_type;
621 return GpuView<T>(storage.data(), storage.size());
622 };
623
624 return GpuProblemView(::Opm::gpuistl::make_view(buf.materialLawManager()),
625 toView(buf.porosityStorage()),
626 toView(buf.rockCompressibilityStorage()),
627 toView(buf.rockReferencePressureStorage()),
628 toView(buf.maxOilSaturationStorage()),
629 toView(buf.maxOilVaporizationFactorStorage()),
630 toView(buf.maxGasDissolutionFactorStorage()),
631 ::Opm::gpuistl::make_view(buf.thermalLawManager()),
632 toView(buf.rockFractionStorage()),
633 toView(buf.pvtRegionIndexStorage()),
634 true);
635}
636
637} // namespace Opm::gpuistl
638
639#endif // OPM_GPU_FLOW_PROBLEM_HPP
Minimal, GPU-compatible problem class.
Definition: GpuFlowProblem.hpp:137
Storage< Scalar > & maxOilVaporizationFactorStorage()
Definition: GpuFlowProblem.hpp:454
GpuFlowProblem(const CpuProblem &cpu)
Construct directly into device-resident GpuBuffer storage from any CPU FlowProblem (or FlowProblemBla...
Definition: GpuFlowProblem.hpp:268
Storage< Scalar > & porosityStorage()
Definition: GpuFlowProblem.hpp:430
OPM_HOST_DEVICE Scalar rockReferencePressure(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:322
const EclMaterialLawManager & materialLawManager() const
Definition: GpuFlowProblem.hpp:421
Storage< Scalar > & rockFractionStorage()
Definition: GpuFlowProblem.hpp:472
Storage< Scalar > & maxGasDissolutionFactorStorage()
Definition: GpuFlowProblem.hpp:460
Storage< Scalar > & rockReferencePressureStorage()
Definition: GpuFlowProblem.hpp:442
OPM_HOST_DEVICE Scalar rockCompressibility(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:317
static constexpr bool hasThermal
True iff the thermal-law manager carries a real fluid-system tag (anything other than void) and there...
Definition: GpuFlowProblem.hpp:150
OPM_HOST_DEVICE Scalar maxOilVaporizationFactor(unsigned, std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:332
OPM_HOST_DEVICE Evaluation rockCompPoroMultiplier(const auto &, std::size_t) const
Default rock-pore-volume multiplier (1 if no compressibility).
Definition: GpuFlowProblem.hpp:382
OPM_HOST_DEVICE unsigned pvtRegionIndex(std::size_t elemIdx) const
Per-cell PVT region index. Returns 0 when the GpuFlowProblem instantiation has no thermal support.
Definition: GpuFlowProblem.hpp:349
typename EclMaterialLawManager::MaterialLawParams MaterialLawParams
Definition: GpuFlowProblem.hpp:141
Storage< Scalar > & maxOilSaturationStorage()
Definition: GpuFlowProblem.hpp:448
typename EclThermalLawManager::ThermalConductionLawParams ThermalConductionLawParams
Definition: GpuFlowProblem.hpp:144
EclMaterialLawManager & materialLawManager()
Definition: GpuFlowProblem.hpp:424
OPM_HOST_DEVICE Scalar porosity(std::size_t elemIdx, unsigned) const
Definition: GpuFlowProblem.hpp:327
OPM_HOST_DEVICE ModelView model() const
Definition: GpuFlowProblem.hpp:302
GpuFlowProblem()=default
GpuFlowProblem(EclMaterialLawManager materialLawManager, Storage< Scalar > porosity, Storage< Scalar > rockCompressibility, Storage< Scalar > rockReferencePressure, Storage< Scalar > maxOilSaturation, Storage< Scalar > maxOilVaporizationFactor, Storage< Scalar > maxGasDissolutionFactor, EclThermalLawManager thermalLawManager, Storage< Scalar > rockFraction, Storage< int > pvtRegionIndex, bool usesDefaultRockCompaction)
Definition: GpuFlowProblem.hpp:173
Storage< Scalar > & rockCompressibilityStorage()
Definition: GpuFlowProblem.hpp:436
const Storage< Scalar > & rockFractionStorage() const
Definition: GpuFlowProblem.hpp:469
Storage< int > & pvtRegionIndexStorage()
Definition: GpuFlowProblem.hpp:478
GpuFlowProblem(const CpuProblem &cpu)
Construct from any CPU FlowProblem (or FlowProblemBlackoil).
Definition: GpuFlowProblem.hpp:216
MaterialLawManagerT EclMaterialLawManager
Definition: GpuFlowProblem.hpp:140
const Storage< int > & pvtRegionIndexStorage() const
Definition: GpuFlowProblem.hpp:475
ScalarT Scalar
Definition: GpuFlowProblem.hpp:139
OPM_HOST_DEVICE ThermalConductionLawParams thermalConductionLawParams(std::size_t elemIdx, unsigned) const
Thermal-conduction law parameters for a single cell. Forwards to the embedded thermal-law manager.
Definition: GpuFlowProblem.hpp:375
const Storage< Scalar > & maxGasDissolutionFactorStorage() const
Definition: GpuFlowProblem.hpp:457
OPM_HOST_DEVICE Scalar maxGasDissolutionFactor(unsigned, std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:337
OPM_HOST_DEVICE void updateRelperms(auto &mobility, auto &, FluidState &fluidState, unsigned globalSpaceIdx) const
Update the relative permeabilities of all phases for a single cell, in the same way as the CPU FlowPr...
Definition: GpuFlowProblem.hpp:408
const Storage< Scalar > & porosityStorage() const
Definition: GpuFlowProblem.hpp:427
typename EclThermalLawManager::SolidEnergyLawParams SolidEnergyLawParams
Definition: GpuFlowProblem.hpp:143
const Storage< Scalar > & rockCompressibilityStorage() const
Definition: GpuFlowProblem.hpp:433
OPM_HOST_DEVICE Scalar maxOilSaturation(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:342
ThermalLawManagerT EclThermalLawManager
Definition: GpuFlowProblem.hpp:142
OPM_HOST_DEVICE int satnumRegionIndex(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:307
const Storage< Scalar > & rockReferencePressureStorage() const
Definition: GpuFlowProblem.hpp:439
OPM_HOST_DEVICE Scalar rockFraction(std::size_t elemIdx, unsigned) const
Per-cell rock fraction (1 - effective porosity). Returns 0 when the GpuFlowProblem instantiation has ...
Definition: GpuFlowProblem.hpp:359
OPM_HOST_DEVICE SolidEnergyLawParams solidEnergyLawParams(std::size_t elemIdx, unsigned) const
Solid-energy law parameters for a single cell. Forwards to the embedded thermal-law manager.
Definition: GpuFlowProblem.hpp:367
const Storage< Scalar > & maxOilSaturationStorage() const
Definition: GpuFlowProblem.hpp:445
EclThermalLawManager & thermalLawManager()
Definition: GpuFlowProblem.hpp:466
const EclThermalLawManager & thermalLawManager() const
Definition: GpuFlowProblem.hpp:463
const Storage< Scalar > & maxOilVaporizationFactorStorage() const
Definition: GpuFlowProblem.hpp:451
OPM_HOST_DEVICE MaterialLawParams materialLawParams(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:312
OPM_HOST_DEVICE Evaluation rockCompTransMultiplier(const auto &, std::size_t) const
Default rock-trans multiplier (1 if no compressibility).
Definition: GpuFlowProblem.hpp:390
Definition: GpuFlowProblem.hpp:51
The GpuView class is provides a view of some data allocated on the GPU Essenstially is only stores a ...
Definition: GpuView.hpp:53
A small, fixed‑dimension MiniVector class backed by std::array that can be used in both host and CUDA...
Definition: GpuFlowProblem.hpp:49
inline ::Opm::NoThermalLawManager make_view(::Opm::NoThermalLawManager &)
make_view overload for the no-op thermal manager.
Definition: GpuFlowProblem.hpp:102
auto copy_to_gpu(const ::Opm::GpuFlowProblem< ScalarT, CpuMaterialLawManager, ::Opm::VectorWithDefaultAllocator, CpuThermalLawManager > &cpu)
Copy a CPU GpuFlowProblem to GPU-resident GpuBuffer storage.
Definition: GpuFlowProblem.hpp:572
auto make_view(::Opm::GpuFlowProblem< ScalarT, GpuBufferMaterialLawManager, GpuBuffer, GpuBufferThermalLawManager > &buf)
Make a non-owning GpuView based GpuFlowProblem from an owning GpuBuffer based GpuFlowProblem.
Definition: GpuFlowProblem.hpp:605
inline ::Opm::NoThermalLawManager copy_to_gpu(const ::Opm::NoThermalLawManager &)
copy_to_gpu overload for the no-op thermal manager.
Definition: GpuFlowProblem.hpp:95
Definition: blackoilbioeffectsmodules.hh:45
Definition: GpuFlowProblem.hpp:158
OPM_HOST_DEVICE LinearizationType getLinearizationType() const
Definition: GpuFlowProblem.hpp:159
Trivial nested model() helper that satisfies the problem.model().linearizer().getLinearizationType() ...
Definition: GpuFlowProblem.hpp:156
OPM_HOST_DEVICE LinearizerView linearizer() const
Definition: GpuFlowProblem.hpp:165
Definition: linearizationtype.hh:34
Definition: GpuFlowProblem.hpp:75
No-op thermal-law manager used as the default 4th template arg of GpuFlowProblem.
Definition: GpuFlowProblem.hpp:73
OPM_HOST_DEVICE SolidEnergyLawParams solidEnergyLawParams(unsigned) const
Definition: GpuFlowProblem.hpp:78
OPM_HOST_DEVICE ThermalConductionLawParams thermalConductionLawParams(unsigned) const
Definition: GpuFlowProblem.hpp:83
void FluidSystem
Definition: GpuFlowProblem.hpp:74