Skip to content

Commit

Permalink
Merge pull request #4309 from akva2/janitoring_sca_use_init_list
Browse files Browse the repository at this point in the history
CO2Tables: use initializer list
  • Loading branch information
bska authored Nov 5, 2024
2 parents a4ba536 + 0ad98b7 commit ab0b302
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
34 changes: 16 additions & 18 deletions opm/material/components/CO2Tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,31 @@
copyright holders.
*/
#include <config.h>
#include <opm/material/components/CO2Tables.hpp>

#include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/UniformTabulated2DFunction.hpp>
#include <opm/material/components/CO2Tables.hpp>
#include <opm/material/components/co2tables.inc>
#include <vector>

namespace Opm
{

CO2Tables::CO2Tables()
: tabulatedDensity {co2TabulatedDensityTraits::xMin,
co2TabulatedDensityTraits::xMax,
co2TabulatedDensityTraits::numX,
co2TabulatedDensityTraits::yMin,
co2TabulatedDensityTraits::yMax,
co2TabulatedDensityTraits::numY,
co2TabulatedDensityTraits::vals}
, tabulatedEnthalpy{co2TabulatedEnthalpyTraits::xMin,
co2TabulatedEnthalpyTraits::xMax,
co2TabulatedEnthalpyTraits::numX,
co2TabulatedEnthalpyTraits::yMin,
co2TabulatedEnthalpyTraits::yMax,
co2TabulatedEnthalpyTraits::numY,
co2TabulatedEnthalpyTraits::vals}
{
// Opm::TabulatedEnthalpyTraits tabulatedEnthalpyStruct;
tabulatedEnthalpy = Opm::UniformTabulated2DFunction<double> {co2TabulatedEnthalpyTraits::xMin,
co2TabulatedEnthalpyTraits::xMax,
(unsigned int)co2TabulatedEnthalpyTraits::numX,
co2TabulatedEnthalpyTraits::yMin,
co2TabulatedEnthalpyTraits::yMax,
(unsigned int)co2TabulatedEnthalpyTraits::numY,
co2TabulatedEnthalpyTraits::vals};
// TabulatedDensityTraits tabulatedDensityStruct;
tabulatedDensity = UniformTabulated2DFunction<double> {co2TabulatedDensityTraits::xMin,
co2TabulatedDensityTraits::xMax,
(unsigned int)co2TabulatedDensityTraits::numX,
co2TabulatedDensityTraits::yMin,
co2TabulatedDensityTraits::yMax,
(unsigned int)co2TabulatedDensityTraits::numY,
co2TabulatedDensityTraits::vals};
}

} // namespace Opm
4 changes: 2 additions & 2 deletions opm/material/components/CO2Tables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct co2TabulatedEnthalpyTraits
class CO2Tables
{
public:
Opm::UniformTabulated2DFunction<double> tabulatedEnthalpy;
Opm::UniformTabulated2DFunction<double> tabulatedDensity;
UniformTabulated2DFunction<double> tabulatedDensity;
UniformTabulated2DFunction<double> tabulatedEnthalpy;
static constexpr double brineSalinity = 1.000000000000000e-01;

CO2Tables();
Expand Down

0 comments on commit ab0b302

Please sign in to comment.