Skip to content

Commit

Permalink
problems with how ideal gas constant R was defined on mac, David help…
Browse files Browse the repository at this point in the history
…ed me fix it
  • Loading branch information
Trine Mykkeltvedt committed Jun 8, 2022
1 parent b81a13d commit a837ab8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,6 @@ opm_add_test(test_2dtables)
opm_add_test(test_components)
opm_add_test(test_fluidsystems)
opm_add_test(test_immiscibleflash)
<<<<<<< HEAD

install(DIRECTORY doc/man1 DESTINATION ${CMAKE_INSTALL_MANDIR}
FILES_MATCHING PATTERN "*.1")
=======
opm_add_test(test_chiflash)
<<<<<<< HEAD
>>>>>>> bb846316 ([WIP] Add ChiFlash and test. Not compiling.)
=======
opm_add_test(test_chiflash_scalar)
<<<<<<< HEAD
>>>>>>> f08ec1f9 (added a scalar test)
=======
opm_add_test(test_chiflashspe5)
>>>>>>> d38cbcb0 (adding the spe5 using chiflash)
10 changes: 3 additions & 7 deletions opm/material/eos/PengRobinson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ namespace Opm {
template <class Scalar>
class PengRobinson
{
//! The ideal gas constant [Pa * m^3/mol/K]
static const Scalar R;

PengRobinson()
{ }
Expand Down Expand Up @@ -168,7 +166,7 @@ class PengRobinson
if (!std::isfinite(scalarValue(b)) || b <= 0)
return std::numeric_limits<Scalar>::quiet_NaN();

const Evaluation& RT= R*T;
const Evaluation& RT= Constants<Scalar>::R*T;
const Evaluation& Astar = a*p/(RT*RT);
const Evaluation& Bstar = b*p/RT;

Expand Down Expand Up @@ -253,7 +251,7 @@ class PengRobinson
const Evaluation& p = params.pressure();
const Evaluation& Vm = params.molarVolume();

const Evaluation& RT = R*T;
const Evaluation& RT = Constants<Scalar>::R*T;
const Evaluation& Z = p*Vm/RT;
const Evaluation& Bstar = p*params.b() / RT;

Expand Down Expand Up @@ -417,7 +415,7 @@ class PengRobinson
Scalar u = 2;
Scalar w = -1;

const Evaluation& RT = R*T;
const Evaluation& RT = Constants<Scalar>::R*T;

// calculate coefficients of the 4th order polynominal in
// monomial basis
Expand Down Expand Up @@ -541,8 +539,6 @@ class PengRobinson
*/
};

template <class Scalar>
const Scalar PengRobinson<Scalar>::R = Constants<Scalar>::R;

/*
template <class Scalar>
Expand Down
7 changes: 1 addition & 6 deletions opm/material/eos/PengRobinsonParamsMixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ class PengRobinsonParamsMixture

typedef MathToolbox<Scalar> Toolbox;

// the ideal gas constant
static const Scalar R;

public:
/*!
* \brief Update Peng-Robinson parameters for the pure components.
Expand Down Expand Up @@ -98,7 +95,7 @@ class PengRobinsonParamsMixture
Scalar pc = FluidSystem::criticalPressure(i);
Scalar omega = FluidSystem::acentricFactor(i);
Scalar Tr = temperature/FluidSystem::criticalTemperature(i);
Scalar RTc = R*FluidSystem::criticalTemperature(i);
Scalar RTc = Constants<Scalar>::R*FluidSystem::criticalTemperature(i);

Scalar f_omega;

Expand Down Expand Up @@ -246,8 +243,6 @@ class PengRobinsonParamsMixture
Scalar aCache_[numComponents][numComponents];
};

template <class Scalar, class FluidSystem, unsigned phaseIdx, bool useSpe5Relations>
const Scalar PengRobinsonParamsMixture<Scalar, FluidSystem, phaseIdx, useSpe5Relations>::R = Constants<Scalar>::R;

} // namespace Opm

Expand Down

0 comments on commit a837ab8

Please sign in to comment.