opm-common
Toggle main menu visibility
Loading...
Searching...
No Matches
CO2Tables.hpp
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
*/
23
24
#ifndef OPM_CO2TABLES_HPP
25
#define OPM_CO2TABLES_HPP
26
27
#include <
opm/material/common/MathToolbox.hpp
>
28
#include <
opm/material/common/UniformTabulated2DFunction.hpp
>
29
#include <opm/common/utility/gpuDecorators.hpp>
30
#include <opm/common/utility/VectorWithDefaultAllocator.hpp>
31
#include <
opm/common/utility/gpuistl_if_available.hpp
>
32
33
namespace
Opm
{
34
35
struct
co2TabulatedDensityTraits
36
{
37
using
Scalar = double;
38
static
const
char
*name;
39
static
const
int
numX = 200;
40
static
const
Scalar xMin;
41
static
const
Scalar xMax;
42
static
const
int
numY = 500;
43
static
const
Scalar yMin;
44
static
const
Scalar yMax;
45
static
const
Scalar vals[200][500];
46
};
47
48
struct
co2TabulatedEnthalpyTraits
49
{
50
using
Scalar = double;
51
static
const
char
*name;
52
static
const
int
numX = 200;
53
static
const
Scalar xMin;
54
static
const
Scalar xMax;
55
static
const
int
numY = 500;
56
static
const
Scalar yMin;
57
static
const
Scalar yMax;
58
static
const
Scalar vals[200][500];
59
};
60
61
template
<
class
Scalar =
double
,
template
<
class
>
class
Storage = VectorWithDefaultAllocator>
62
class
CO2Tables
63
{
64
public
:
65
UniformTabulated2DFunction<Scalar, Storage>
tabulatedDensity;
66
UniformTabulated2DFunction<Scalar, Storage>
tabulatedEnthalpy;
67
static
constexpr
double
brineSalinity = 1.000000000000000e-01;
68
69
CO2Tables();
70
71
CO2Tables(
Opm::UniformTabulated2DFunction<Scalar, Storage>
&& enthalpy,
72
Opm::UniformTabulated2DFunction<Scalar, Storage>
&& density)
73
: tabulatedEnthalpy(std::move(enthalpy)), tabulatedDensity(std::move(density))
74
{
75
}
76
77
const
Opm::UniformTabulated2DFunction<Scalar, Storage>
& getTabulatedEnthalpy()
const
{
78
return
tabulatedEnthalpy;
79
}
80
81
const
Opm::UniformTabulated2DFunction<Scalar, Storage>
& getTabulatedDensity()
const
{
82
return
tabulatedDensity;
83
}
84
};
85
86
}
// namespace Opm
87
88
#if HAVE_CUDA
89
namespace
Opm::gpuistl {
90
template
<
class
Scalar>
91
CO2Tables<Scalar, GpuView>
92
make_view(CO2Tables<Scalar, GpuBuffer>& oldCO2Tables) {
93
return
CO2Tables<Scalar, GpuView>(
94
make_view(oldCO2Tables.tabulatedEnthalpy),
95
make_view(oldCO2Tables.tabulatedDensity)
96
);
97
}
98
99
template
<
class
Scalar>
100
CO2Tables<Scalar, GpuBuffer>
101
copy_to_gpu
(
const
CO2Tables<Scalar>& oldCO2Tables) {
102
return
CO2Tables<Scalar, GpuBuffer>(
103
copy_to_gpu
(oldCO2Tables.tabulatedEnthalpy),
104
copy_to_gpu
(oldCO2Tables.tabulatedDensity)
105
);
106
}
107
}
// namespace Opm::gpuistl
108
#endif
// HAVE_CUDA
109
#endif
// OPM_CO2TABLES_HPP
MathToolbox.hpp
A traits class which provides basic mathematical functions for arbitrary scalar floating point values...
Opm::gpuistl::copy_to_gpu
PiecewiseLinearTwoPhaseMaterialParams< TraitsT, GPUContainerType > copy_to_gpu(const PiecewiseLinearTwoPhaseMaterialParams< TraitsT > ¶ms)
Move a PiecewiseLinearTwoPhaseMaterialParams-object to the GPU.
Definition
PiecewiseLinearTwoPhaseMaterialParams.hpp:285
UniformTabulated2DFunction.hpp
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y gri...
Opm::UniformTabulated2DFunction
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y gri...
Definition
UniformTabulated2DFunction.hpp:68
gpuistl_if_available.hpp
Convience header to include the gpuistl headers if HAVE_CUDA is defined.
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition
Exceptions.hpp:30
Opm::co2TabulatedDensityTraits
Definition
CO2Tables.hpp:36
Opm::co2TabulatedEnthalpyTraits
Definition
CO2Tables.hpp:49
opm
material
components
CO2Tables.hpp
Generated by
1.17.0