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 <cstddef>
43#include <type_traits>
44#include <utility>
45#include <vector>
46
47namespace Opm::gpuistl
48{
49template <typename T>
51template <typename T>
52class GpuView;
53} // namespace Opm::gpuistl
54
55namespace Opm {
56
72{
73 using FluidSystem = void;
76
77 OPM_HOST_DEVICE SolidEnergyLawParams solidEnergyLawParams(unsigned /*elemIdx*/) const
78 {
79 return SolidEnergyLawParams{};
80 }
81 OPM_HOST_DEVICE ThermalConductionLawParams
82 thermalConductionLawParams(unsigned /*elemIdx*/) const
83 {
85 }
86};
87
88} // namespace Opm
89
90namespace Opm::gpuistl {
91
93inline ::Opm::NoThermalLawManager
94copy_to_gpu(const ::Opm::NoThermalLawManager& /*cpu*/)
95{
96 return ::Opm::NoThermalLawManager{};
97}
98
100inline ::Opm::NoThermalLawManager
102{
103 return ::Opm::NoThermalLawManager{};
104}
105
106} // namespace Opm::gpuistl
107
108namespace Opm {
109
131template <class ScalarT,
132 class MaterialLawManagerT,
133 template <class> class Storage = ::Opm::VectorWithDefaultAllocator,
134 class ThermalLawManagerT = ::Opm::NoThermalLawManager>
136{
137public:
138 using Scalar = ScalarT;
139 using EclMaterialLawManager = MaterialLawManagerT;
140 using MaterialLawParams = typename EclMaterialLawManager::MaterialLawParams;
141 using EclThermalLawManager = ThermalLawManagerT;
142 using SolidEnergyLawParams = typename EclThermalLawManager::SolidEnergyLawParams;
143 using ThermalConductionLawParams = typename EclThermalLawManager::ThermalConductionLawParams;
144
148 static constexpr bool hasThermal
149 = !std::is_same_v<typename EclThermalLawManager::FluidSystem, void>;
150
155 {
157 {
159 {
160 return LinearizationType{};
161 }
162 };
163
164 OPM_HOST_DEVICE LinearizerView linearizer() const
165 {
166 return LinearizerView{};
167 }
168 };
169
170 GpuFlowProblem() = default;
171
173 Storage<Scalar> porosity,
174 Storage<Scalar> rockCompressibility,
175 Storage<Scalar> rockReferencePressure,
176 Storage<Scalar> maxOilSaturation,
177 Storage<Scalar> maxOilVaporizationFactor,
178 Storage<Scalar> maxGasDissolutionFactor,
180 Storage<Scalar> rockFraction,
181 Storage<int> pvtRegionIndex,
182 bool usesDefaultRockCompaction)
183 : materialLawManager_(std::move(materialLawManager))
184 , porosity_(std::move(porosity))
185 , rockCompressibility_(std::move(rockCompressibility))
186 , rockReferencePressure_(std::move(rockReferencePressure))
187 , maxOilSaturation_(std::move(maxOilSaturation))
188 , maxOilVaporizationFactor_(std::move(maxOilVaporizationFactor))
189 , maxGasDissolutionFactor_(std::move(maxGasDissolutionFactor))
190 , thermalLawManager_(std::move(thermalLawManager))
191 , rockFraction_(std::move(rockFraction))
192 , pvtRegionIndex_(std::move(pvtRegionIndex))
193 {
194 if (!usesDefaultRockCompaction) {
195 OPM_THROW(std::logic_error,
196 "GPU FlowProblem does not support non-default rock compaction multipliers");
197 }
198 }
199
213 template <class CpuProblem,
214 class StS = Storage<Scalar>,
215 std::enable_if_t<
216 std::is_same_v<StS, ::Opm::VectorWithDefaultAllocator<Scalar>>,
217 int> = 0>
218 explicit GpuFlowProblem(const CpuProblem& cpu)
219 : materialLawManager_(*cpu.materialLawManager(), cpu.model().numGridDof())
220 {
221 if (!cpu.usesDefaultRockCompaction()) {
222 OPM_THROW(std::logic_error,
223 "GPU FlowProblem does not support non-default rock compaction multipliers");
224 }
225 const std::size_t n = cpu.model().numGridDof();
226 porosity_.resize(n);
227 rockCompressibility_.resize(n);
228 rockReferencePressure_.resize(n);
229 maxOilSaturation_.resize(n);
230 maxOilVaporizationFactor_.resize(n);
231 maxGasDissolutionFactor_.resize(n);
232 for (std::size_t i = 0; i < n; ++i) {
233 const unsigned u = static_cast<unsigned>(i);
234 porosity_[i] = cpu.porosity(u, 0u);
235 rockCompressibility_[i] = cpu.rockCompressibility(u);
236 rockReferencePressure_[i] = cpu.rockReferencePressure(u);
237 maxOilSaturation_[i] = cpu.maxOilSaturation(u);
238 maxOilVaporizationFactor_[i] = cpu.maxOilVaporizationFactor(0u, u);
239 maxGasDissolutionFactor_[i] = cpu.maxGasDissolutionFactor(0u, u);
240 }
241 if constexpr (hasThermal) {
242 using FluidSystemTag = typename EclThermalLawManager::FluidSystem;
243 thermalLawManager_
244 = ::Opm::EclThermalLaw::buildCpuManagerFromFlowProblem<Scalar, FluidSystemTag>(
245 cpu, n);
246 rockFraction_.resize(n);
247 pvtRegionIndex_.resize(n);
248 for (std::size_t i = 0; i < n; ++i) {
249 const unsigned u = static_cast<unsigned>(i);
250 rockFraction_[i] = cpu.rockFraction(u, 0u);
251 pvtRegionIndex_[i] = static_cast<int>(cpu.pvtRegionIndex(u));
252 }
253 }
254 }
255
268 template <class CpuProblem,
269 class StS = Storage<Scalar>,
270 std::enable_if_t<
271 std::is_same_v<StS, ::Opm::gpuistl::GpuBuffer<Scalar>>,
272 int> = 0>
273 explicit GpuFlowProblem(const CpuProblem& cpu)
274 : materialLawManager_(*cpu.materialLawManager(), cpu.model().numGridDof())
275 , porosity_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
276 return Scalar(p.porosity(u, 0u));
277 }))
278 , rockCompressibility_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
279 return Scalar(p.rockCompressibility(u));
280 }))
281 , rockReferencePressure_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
282 return Scalar(p.rockReferencePressure(u));
283 }))
284 , maxOilSaturation_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
285 return Scalar(p.maxOilSaturation(u));
286 }))
287 , maxOilVaporizationFactor_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
288 return Scalar(p.maxOilVaporizationFactor(0u, u));
289 }))
290 , maxGasDissolutionFactor_(extractRockField(cpu, [](const CpuProblem& p, unsigned u) {
291 return Scalar(p.maxGasDissolutionFactor(0u, u));
292 }))
293 , thermalLawManager_(buildGpuThermalManager(cpu))
294 , rockFraction_(extractThermalScalarField(cpu, [](const CpuProblem& p, unsigned u) {
295 return Scalar(p.rockFraction(u, 0u));
296 }))
297 , pvtRegionIndex_(extractThermalIntField(cpu, [](const CpuProblem& p, unsigned u) {
298 return static_cast<int>(p.pvtRegionIndex(u));
299 }))
300 {
301 if (!cpu.usesDefaultRockCompaction()) {
302 OPM_THROW(std::logic_error,
303 "GPU FlowProblem does not support non-default rock compaction multipliers");
304 }
305 }
306
307 OPM_HOST_DEVICE ModelView model() const
308 {
309 return ModelView{};
310 }
311
312 OPM_HOST_DEVICE int satnumRegionIndex(std::size_t elemIdx) const
313 {
314 return materialLawManager_.satnumRegionIdx(static_cast<unsigned>(elemIdx));
315 }
316
317 OPM_HOST_DEVICE MaterialLawParams materialLawParams(std::size_t elemIdx) const
318 {
319 return materialLawManager_.materialLawParams(static_cast<unsigned>(elemIdx));
320 }
321
322 OPM_HOST_DEVICE Scalar rockCompressibility(std::size_t elemIdx) const
323 {
324 return rockCompressibility_.size() == 0 ? Scalar(0) : rockCompressibility_[elemIdx];
325 }
326
327 OPM_HOST_DEVICE Scalar rockReferencePressure(std::size_t elemIdx) const
328 {
329 return rockReferencePressure_.size() == 0 ? Scalar(0) : rockReferencePressure_[elemIdx];
330 }
331
332 OPM_HOST_DEVICE Scalar porosity(std::size_t elemIdx, unsigned /*timeIdx*/) const
333 {
334 return porosity_.size() == 0 ? Scalar(0) : porosity_[elemIdx];
335 }
336
337 OPM_HOST_DEVICE Scalar maxOilVaporizationFactor(unsigned /*timeIdx*/, std::size_t elemIdx) const
338 {
339 return maxOilVaporizationFactor_.size() == 0 ? Scalar(0) : maxOilVaporizationFactor_[elemIdx];
340 }
341
342 OPM_HOST_DEVICE Scalar maxGasDissolutionFactor(unsigned /*timeIdx*/, std::size_t elemIdx) const
343 {
344 return maxGasDissolutionFactor_.size() == 0 ? Scalar(0) : maxGasDissolutionFactor_[elemIdx];
345 }
346
347 OPM_HOST_DEVICE Scalar maxOilSaturation(std::size_t elemIdx) const
348 {
349 return maxOilSaturation_.size() == 0 ? Scalar(0) : maxOilSaturation_[elemIdx];
350 }
351
354 OPM_HOST_DEVICE unsigned pvtRegionIndex(std::size_t elemIdx) const
355 {
356 return pvtRegionIndex_.size() == 0
357 ? 0u
358 : static_cast<unsigned>(pvtRegionIndex_[elemIdx]);
359 }
360
364 OPM_HOST_DEVICE Scalar rockFraction(std::size_t elemIdx, unsigned /*timeIdx*/) const
365 {
366 return rockFraction_.size() == 0 ? Scalar(0) : rockFraction_[elemIdx];
367 }
368
371 OPM_HOST_DEVICE SolidEnergyLawParams
372 solidEnergyLawParams(std::size_t elemIdx, unsigned /*timeIdx*/) const
373 {
374 return thermalLawManager_.solidEnergyLawParams(static_cast<unsigned>(elemIdx));
375 }
376
379 OPM_HOST_DEVICE ThermalConductionLawParams
380 thermalConductionLawParams(std::size_t elemIdx, unsigned /*timeIdx*/) const
381 {
382 return thermalLawManager_.thermalConductionLawParams(static_cast<unsigned>(elemIdx));
383 }
384
386 template <class Evaluation>
387 OPM_HOST_DEVICE Evaluation rockCompPoroMultiplier(const auto& /*intQuants*/, std::size_t /*elemIdx*/) const
388 {
389 // Ctor guarantees no rock compaction, this is therefore always correct
390 return Evaluation(1.0);
391 }
392
394 template <class Evaluation>
395 OPM_HOST_DEVICE Evaluation rockCompTransMultiplier(const auto& /*intQuants*/, std::size_t /*elemIdx*/) const
396 {
397 // Ctor guarantees no rock compaction, this is therefore always correct
398 return Evaluation(1.0);
399 }
400
412 template <class FluidState, class... Args>
413 OPM_HOST_DEVICE void updateRelperms(auto& mobility,
414 auto& /*dirMob*/,
415 FluidState& fluidState,
416 unsigned globalSpaceIdx) const
417 {
418 using ContainerT = std::decay_t<decltype(mobility)>;
419 const auto materialParams = materialLawParams(globalSpaceIdx);
420 EclMaterialLawManager::MaterialLaw::template relativePermeabilities<
421 ContainerT, FluidState, Args...>(mobility, materialParams, fluidState);
422 }
423
427 { return materialLawManager_; }
428
430 { return materialLawManager_; }
431
432 const Storage<Scalar>& porosityStorage() const
433 { return porosity_; }
434
435 Storage<Scalar>& porosityStorage()
436 { return porosity_; }
437
438 const Storage<Scalar>& rockCompressibilityStorage() const
439 { return rockCompressibility_; }
440
441 Storage<Scalar>& rockCompressibilityStorage()
442 { return rockCompressibility_; }
443
444 const Storage<Scalar>& rockReferencePressureStorage() const
445 { return rockReferencePressure_; }
446
448 { return rockReferencePressure_; }
449
450 const Storage<Scalar>& maxOilSaturationStorage() const
451 { return maxOilSaturation_; }
452
453 Storage<Scalar>& maxOilSaturationStorage()
454 { return maxOilSaturation_; }
455
456 const Storage<Scalar>& maxOilVaporizationFactorStorage() const
457 { return maxOilVaporizationFactor_; }
458
460 { return maxOilVaporizationFactor_; }
461
462 const Storage<Scalar>& maxGasDissolutionFactorStorage() const
463 { return maxGasDissolutionFactor_; }
464
466 { return maxGasDissolutionFactor_; }
467
469 { return thermalLawManager_; }
470
472 { return thermalLawManager_; }
473
474 const Storage<Scalar>& rockFractionStorage() const
475 { return rockFraction_; }
476
477 Storage<Scalar>& rockFractionStorage()
478 { return rockFraction_; }
479
480 const Storage<int>& pvtRegionIndexStorage() const
481 { return pvtRegionIndex_; }
482
483 Storage<int>& pvtRegionIndexStorage()
484 { return pvtRegionIndex_; }
486
487private:
488 template <class CpuProblem, class F>
489 static Storage<Scalar> extractRockField(const CpuProblem& cpu, F f)
490 {
491 const std::size_t n = cpu.model().numGridDof();
492 std::vector<Scalar> v(n);
493 for (std::size_t i = 0; i < n; ++i) {
494 v[i] = f(cpu, static_cast<unsigned>(i));
495 }
496 if constexpr (std::is_same_v<Storage<Scalar>,
497 ::Opm::VectorWithDefaultAllocator<Scalar>>) {
498 return Storage<Scalar>(v.begin(), v.end());
499 } else {
500 return Storage<Scalar>(v);
501 }
502 }
503
506 template <class CpuProblem, class F>
507 static Storage<Scalar> extractThermalScalarField(const CpuProblem& cpu, F f)
508 {
509 if constexpr (!hasThermal) {
510 return Storage<Scalar>{};
511 } else {
512 return extractRockField(cpu, f);
513 }
514 }
515
518 template <class CpuProblem, class F>
519 static Storage<int> extractThermalIntField(const CpuProblem& cpu, F f)
520 {
521 if constexpr (!hasThermal) {
522 return Storage<int>{};
523 } else {
524 const std::size_t n = cpu.model().numGridDof();
525 std::vector<int> v(n);
526 for (std::size_t i = 0; i < n; ++i) {
527 v[i] = f(cpu, static_cast<unsigned>(i));
528 }
529 if constexpr (std::is_same_v<Storage<int>,
530 ::Opm::VectorWithDefaultAllocator<int>>) {
531 return Storage<int>(v.begin(), v.end());
532 } else {
533 return Storage<int>(v);
534 }
535 }
536 }
537
541 template <class CpuProblem>
542 static EclThermalLawManager buildGpuThermalManager(const CpuProblem& cpu)
543 {
544 if constexpr (!hasThermal) {
545 return EclThermalLawManager{};
546 } else {
547 using FluidSystemTag = typename EclThermalLawManager::FluidSystem;
548 auto cpuMgr
549 = ::Opm::EclThermalLaw::buildCpuManagerFromFlowProblem<Scalar, FluidSystemTag>(
550 cpu, cpu.model().numGridDof());
552 }
553 }
554
555 EclMaterialLawManager materialLawManager_{};
556 Storage<Scalar> porosity_{};
557 Storage<Scalar> rockCompressibility_{};
558 Storage<Scalar> rockReferencePressure_{};
559 Storage<Scalar> maxOilSaturation_{};
560 Storage<Scalar> maxOilVaporizationFactor_{};
561 Storage<Scalar> maxGasDissolutionFactor_{};
562 EclThermalLawManager thermalLawManager_{};
563 Storage<Scalar> rockFraction_{};
564 Storage<int> pvtRegionIndex_{};
565};
566
567} // namespace Opm
568
569namespace Opm::gpuistl {
570
576template <class ScalarT, class CpuMaterialLawManager, class CpuThermalLawManager>
578 const ::Opm::GpuFlowProblem<ScalarT,
579 CpuMaterialLawManager,
580 ::Opm::VectorWithDefaultAllocator,
581 CpuThermalLawManager>& cpu)
582{
583 using GpuMaterialLawManagerBuffer
584 = decltype(::Opm::gpuistl::copy_to_gpu(cpu.materialLawManager()));
585 using GpuThermalLawManagerBuffer
586 = decltype(::Opm::gpuistl::copy_to_gpu(cpu.thermalLawManager()));
587 using GpuProblemType = ::Opm::GpuFlowProblem<ScalarT,
588 GpuMaterialLawManagerBuffer,
589 GpuBuffer,
590 GpuThermalLawManagerBuffer>;
591
592 return GpuProblemType(::Opm::gpuistl::copy_to_gpu(cpu.materialLawManager()),
593 GpuBuffer<ScalarT>(cpu.porosityStorage()),
594 GpuBuffer<ScalarT>(cpu.rockCompressibilityStorage()),
595 GpuBuffer<ScalarT>(cpu.rockReferencePressureStorage()),
596 GpuBuffer<ScalarT>(cpu.maxOilSaturationStorage()),
597 GpuBuffer<ScalarT>(cpu.maxOilVaporizationFactorStorage()),
598 GpuBuffer<ScalarT>(cpu.maxGasDissolutionFactorStorage()),
599 ::Opm::gpuistl::copy_to_gpu(cpu.thermalLawManager()),
600 GpuBuffer<ScalarT>(cpu.rockFractionStorage()),
601 GpuBuffer<int>(cpu.pvtRegionIndexStorage()),
602 true);
603}
604
609template <class ScalarT, class GpuBufferMaterialLawManager, class GpuBufferThermalLawManager>
611 GpuBufferMaterialLawManager,
612 GpuBuffer,
613 GpuBufferThermalLawManager>& buf)
614{
615 using GpuMaterialLawManagerView
616 = decltype(::Opm::gpuistl::make_view(buf.materialLawManager()));
617 using GpuThermalLawManagerView
618 = decltype(::Opm::gpuistl::make_view(buf.thermalLawManager()));
619 using GpuProblemView = ::Opm::GpuFlowProblem<ScalarT,
620 GpuMaterialLawManagerView,
621 GpuView,
622 GpuThermalLawManagerView>;
623
624 auto toView = [](auto& storage) {
625 using T = typename std::decay_t<decltype(storage)>::value_type;
626 return GpuView<T>(storage.data(), storage.size());
627 };
628
629 return GpuProblemView(::Opm::gpuistl::make_view(buf.materialLawManager()),
630 toView(buf.porosityStorage()),
631 toView(buf.rockCompressibilityStorage()),
632 toView(buf.rockReferencePressureStorage()),
633 toView(buf.maxOilSaturationStorage()),
634 toView(buf.maxOilVaporizationFactorStorage()),
635 toView(buf.maxGasDissolutionFactorStorage()),
636 ::Opm::gpuistl::make_view(buf.thermalLawManager()),
637 toView(buf.rockFractionStorage()),
638 toView(buf.pvtRegionIndexStorage()),
639 true);
640}
641
642} // namespace Opm::gpuistl
643
644#endif // OPM_GPU_FLOW_PROBLEM_HPP
Minimal, GPU-compatible problem class.
Definition: GpuFlowProblem.hpp:136
Storage< Scalar > & maxOilVaporizationFactorStorage()
Definition: GpuFlowProblem.hpp:459
Storage< Scalar > & porosityStorage()
Definition: GpuFlowProblem.hpp:435
OPM_HOST_DEVICE Scalar rockReferencePressure(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:327
const EclMaterialLawManager & materialLawManager() const
Definition: GpuFlowProblem.hpp:426
Storage< Scalar > & rockFractionStorage()
Definition: GpuFlowProblem.hpp:477
Storage< Scalar > & maxGasDissolutionFactorStorage()
Definition: GpuFlowProblem.hpp:465
Storage< Scalar > & rockReferencePressureStorage()
Definition: GpuFlowProblem.hpp:447
OPM_HOST_DEVICE Scalar rockCompressibility(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:322
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:149
OPM_HOST_DEVICE Scalar maxOilVaporizationFactor(unsigned, std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:337
OPM_HOST_DEVICE Evaluation rockCompPoroMultiplier(const auto &, std::size_t) const
Default rock-pore-volume multiplier (1 if no compressibility).
Definition: GpuFlowProblem.hpp:387
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:354
typename EclMaterialLawManager::MaterialLawParams MaterialLawParams
Definition: GpuFlowProblem.hpp:140
Storage< Scalar > & maxOilSaturationStorage()
Definition: GpuFlowProblem.hpp:453
typename EclThermalLawManager::ThermalConductionLawParams ThermalConductionLawParams
Definition: GpuFlowProblem.hpp:143
EclMaterialLawManager & materialLawManager()
Definition: GpuFlowProblem.hpp:429
OPM_HOST_DEVICE Scalar porosity(std::size_t elemIdx, unsigned) const
Definition: GpuFlowProblem.hpp:332
OPM_HOST_DEVICE ModelView model() const
Definition: GpuFlowProblem.hpp:307
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:172
Storage< Scalar > & rockCompressibilityStorage()
Definition: GpuFlowProblem.hpp:441
const Storage< Scalar > & rockFractionStorage() const
Definition: GpuFlowProblem.hpp:474
Storage< int > & pvtRegionIndexStorage()
Definition: GpuFlowProblem.hpp:483
MaterialLawManagerT EclMaterialLawManager
Definition: GpuFlowProblem.hpp:139
const Storage< int > & pvtRegionIndexStorage() const
Definition: GpuFlowProblem.hpp:480
ScalarT Scalar
Definition: GpuFlowProblem.hpp:138
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:380
const Storage< Scalar > & maxGasDissolutionFactorStorage() const
Definition: GpuFlowProblem.hpp:462
OPM_HOST_DEVICE Scalar maxGasDissolutionFactor(unsigned, std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:342
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:413
const Storage< Scalar > & porosityStorage() const
Definition: GpuFlowProblem.hpp:432
typename EclThermalLawManager::SolidEnergyLawParams SolidEnergyLawParams
Definition: GpuFlowProblem.hpp:142
const Storage< Scalar > & rockCompressibilityStorage() const
Definition: GpuFlowProblem.hpp:438
OPM_HOST_DEVICE Scalar maxOilSaturation(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:347
ThermalLawManagerT EclThermalLawManager
Definition: GpuFlowProblem.hpp:141
OPM_HOST_DEVICE int satnumRegionIndex(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:312
const Storage< Scalar > & rockReferencePressureStorage() const
Definition: GpuFlowProblem.hpp:444
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:364
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:372
const Storage< Scalar > & maxOilSaturationStorage() const
Definition: GpuFlowProblem.hpp:450
EclThermalLawManager & thermalLawManager()
Definition: GpuFlowProblem.hpp:471
const EclThermalLawManager & thermalLawManager() const
Definition: GpuFlowProblem.hpp:468
const Storage< Scalar > & maxOilVaporizationFactorStorage() const
Definition: GpuFlowProblem.hpp:456
GpuFlowProblem(const CpuProblem &cpu)
Construct from any CPU FlowProblem (or FlowProblemBlackoil).
Definition: GpuFlowProblem.hpp:218
OPM_HOST_DEVICE MaterialLawParams materialLawParams(std::size_t elemIdx) const
Definition: GpuFlowProblem.hpp:317
OPM_HOST_DEVICE Evaluation rockCompTransMultiplier(const auto &, std::size_t) const
Default rock-trans multiplier (1 if no compressibility).
Definition: GpuFlowProblem.hpp:395
Definition: GpuFlowProblem.hpp:50
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:48
inline ::Opm::NoThermalLawManager make_view(::Opm::NoThermalLawManager &)
make_view overload for the no-op thermal manager.
Definition: GpuFlowProblem.hpp:101
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:577
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:610
inline ::Opm::NoThermalLawManager copy_to_gpu(const ::Opm::NoThermalLawManager &)
copy_to_gpu overload for the no-op thermal manager.
Definition: GpuFlowProblem.hpp:94
Definition: blackoilbioeffectsmodules.hh:45
Definition: GpuFlowProblem.hpp:157
OPM_HOST_DEVICE LinearizationType getLinearizationType() const
Definition: GpuFlowProblem.hpp:158
Trivial nested model() helper that satisfies the problem.model().linearizer().getLinearizationType() ...
Definition: GpuFlowProblem.hpp:155
OPM_HOST_DEVICE LinearizerView linearizer() const
Definition: GpuFlowProblem.hpp:164
Definition: linearizationtype.hh:34
Definition: GpuFlowProblem.hpp:74
No-op thermal-law manager used as the default 4th template arg of GpuFlowProblem.
Definition: GpuFlowProblem.hpp:72
OPM_HOST_DEVICE SolidEnergyLawParams solidEnergyLawParams(unsigned) const
Definition: GpuFlowProblem.hpp:77
OPM_HOST_DEVICE ThermalConductionLawParams thermalConductionLawParams(unsigned) const
Definition: GpuFlowProblem.hpp:82
void FluidSystem
Definition: GpuFlowProblem.hpp:73