opm-common
NullOilPvt.hpp
1 /*
2  Copyright 2025 Equinor ASA
3  This file is part of the Open Porous Media project (OPM).
4  OPM is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8  OPM is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12  You should have received a copy of the GNU General Public License
13  along with OPM. If not, see <http://www.gnu.org/licenses/>.
14 */
15 #ifndef OPM_NULL_OIL_PVT_HPP
16 #define OPM_NULL_OIL_PVT_HPP
17 
18 #include <opm/common/ErrorMacros.hpp>
19 #include <opm/common/utility/gpuDecorators.hpp>
20 
22 
23 namespace Opm
24 {
25 
33 template <class Scalar>
35 {
36 public:
37  // Approach method
38  OPM_HOST_DEVICE static constexpr auto approach()
39  {
40  return OilPvtApproach::NoOil;
41  } // NoOil approach
42 
43  OPM_HOST_DEVICE static constexpr bool isActive()
44  {
45  return false;
46  }
47 
48  // Formation volume factor methods
49  template <class Evaluation>
50  OPM_HOST_DEVICE Evaluation inverseFormationVolumeFactor(unsigned /*regionIdx*/,
51  const Evaluation& /*temperature*/,
52  const Evaluation& /*pressure*/,
53  const Evaluation& /*Rs*/) const
54  {
55  return 1.0;
56  }
57 
58  template <class Evaluation>
59  OPM_HOST_DEVICE Evaluation saturatedInverseFormationVolumeFactor(unsigned /*regionIdx*/,
60  const Evaluation& /*temperature*/,
61  const Evaluation& /*pressure*/) const
62  {
63  return 1.0;
64  }
65 
66  // Dissolution factor methods
67  template <class Evaluation>
68  OPM_HOST_DEVICE Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
69  const Evaluation& /*temperature*/,
70  const Evaluation& /*pressure*/) const
71  {
72  return 0.0;
73  }
74 
75  template <class Evaluation>
76  OPM_HOST_DEVICE Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
77  const Evaluation& /*temperature*/,
78  const Evaluation& /*pressure*/,
79  const Evaluation& /*oilSaturation*/,
80  const Evaluation& /*maxOilSaturation*/) const
81  {
82  return 0.0;
83  }
84 
85  // Saturation pressure method
86  template <class Evaluation>
87  OPM_HOST_DEVICE Evaluation saturationPressure(unsigned /*regionIdx*/,
88  const Evaluation& /*temperature*/,
89  const Evaluation& /*Rs*/) const
90  {
91  return 0.0;
92  }
93 
94  // Viscosity methods
95  template <class Evaluation>
96  OPM_HOST_DEVICE Evaluation viscosity(unsigned /*regionIdx*/,
97  const Evaluation& /*temperature*/,
98  const Evaluation& /*pressure*/,
99  const Evaluation& /*Rs*/) const
100  {
101  return 0.0;
102  }
103 
104  // Combined formation volume factor and viscosity
105  template <class FluidState, class LhsEval = typename FluidState::ValueType>
106  OPM_HOST_DEVICE std::pair<LhsEval, LhsEval>
107  inverseFormationVolumeFactorAndViscosity(const FluidState& /*fluidState*/, unsigned /*regionIdx*/) const
108  {
109  return { LhsEval(1.0), LhsEval(0.0) };
110  }
111 
112  template <class Evaluation>
113  OPM_HOST_DEVICE Evaluation saturatedViscosity(unsigned /*regionIdx*/,
114  const Evaluation& /*temperature*/,
115  const Evaluation& /*pressure*/) const
116  {
117  return 0.0;
118  }
119 
120  // Internal energy methods
121  template <class Evaluation>
122  OPM_HOST_DEVICE Evaluation internalEnergy(unsigned /*regionIdx*/,
123  const Evaluation& /*temperature*/,
124  const Evaluation& /*pressure*/,
125  const Evaluation& /*Rs*/) const
126  {
127  return 0.0;
128  }
129 
130  // Vaporization parameter methods
131  OPM_HOST_DEVICE void setVapPars(const Scalar /*par1*/, const Scalar /*par2*/) const
132  {
133  }
134 
135  // Heat of vaporization
136  OPM_HOST_DEVICE Scalar hVap(unsigned /*regionIdx*/) const
137  {
138  return 0.0;
139  }
140 
141  // Mixing energy flag
142  OPM_HOST_DEVICE static constexpr bool mixingEnergy()
143  {
144  return false;
145  }
146 
147  // Diffusion coefficient
148  template <class Evaluation>
149  OPM_HOST_DEVICE Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
150  const Evaluation& /*pressure*/,
151  unsigned /*compIdx*/) const
152  {
153  return 0.0;
154  }
155 
156  OPM_HOST_DEVICE Scalar oilReferenceDensity(unsigned /*regionIdx*/) const
157  {
158  OPM_THROW(std::logic_error, "NullOilPvt does not support oil reference density.");
159  }
160 };
161 
162 } // namespace Opm
163 
164 #endif // OPM_NULL_OIL_PVT_HPP
Null object for oil PVT calculations.
Definition: NullOilPvt.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
This class represents the Pressure-Volume-Temperature relations of the oil phase in the black-oil mod...