TransFlow
0.1.0
A transient pipeline flow simulation library
|
6 #include "equationofstate/equationofstatebase.hpp"
47 virtual arma::vec
evaluate(
const double pressure,
const double temperature)
const override;
102 virtual bool setComposition(
const arma::vec& composition,
const bool force =
true)
override;
110 double findDensity(
const double pressure,
const double temperature)
const;
118 double findSpeedOfSound(
const double temperature,
const double density)
const;
152 const double pressure,
153 const double temperature,
157 double& aroideltadelta,
158 double& arijdeltadelta
173 const double tred_temperature,
174 const double start_rhored,
175 const double start_rhored_pow_minusOne,
176 const double start_rhored_pow_minusTwo,
179 double& aroideltadelta,
180 double& arijdeltadelta
201 const arma::uword
N = 10;
205 arma::vec
Tc = {190.56, 126.19, 304.13, 305.32, 369.83, 425.13, 407.82, 469.7, 460.35, 507.82};
207 arma::vec
rhoc = {10.14*16.04, 11.18*28.01, 10.62*44.01, 6.87*30.07, 5*44.1, 3.92*58.12, 3.86*58.12, 3.21*72.15, 3.27*72.15, 2.71*86.18};
static arma::mat doiexp
, from Table A3.3 in TM15, used in the second sum of alpha^r_{oi}
Definition: gerg04.hpp:249
static arma::cube nijpol_times_tijpol
(GERG04::nijpol x GERG04::tijpol)
Definition: gerg04.hpp:273
static arma::cube nijpol_times_dijpol_times_dijpol_minus_one
(GERG04::nijpol x GERG04::dijpol x (GERG04::dijpol - 1.0))
Definition: gerg04.hpp:279
arma::uvec m_firstIndices
The indices of the two first non-zero gas fractions (components).
Definition: gerg04.hpp:226
static arma::cube nijexp_times_tijexp
(GERG04::nijexp x GERG04::tijexp)
Definition: gerg04.hpp:275
static arma::mat noik
, from Table A3.1 in TM15, used in alpha^o_{oi}
Definition: gerg04.hpp:269
arma::vec Tc
Critical temperature [K] for components CH4, N2, CO2, C2H6, C3H8, nC4H10, iC4H10, nC5H12,...
Definition: gerg04.hpp:205
static arma::mat Fij
interaction coefficient
Definition: gerg04.hpp:253
static arma::mat doipol
, from Table A3.2 in TM15, used in the first sum of alpha^r_{oi}
Definition: gerg04.hpp:244
static arma::mat noiexp
, from Table A3.3 in TM15, used in the second sum of alpha^r_{oi}
Definition: gerg04.hpp:248
double findDensity(const double pressure, const double temperature) const
Find the density of the gas at a given pressure and temperature.
static arma::mat voik
, from Table A3.1 in TM15, used in alpha^o_{oi}
Definition: gerg04.hpp:270
static const Composition defaultComposition
Default composition.
Definition: composition.hpp:81
static arma::cube beijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:265
static arma::cube nijpol
, from Table A3.7 in TM15, used in the first sum of alpha^r_{ij}
Definition: gerg04.hpp:255
static arma::cube nuijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:263
static arma::mat toiexp
, from Table A3.3 in TM15, used in the second sum of alpha^r_{oi}
Definition: gerg04.hpp:251
static arma::mat coiexp
, from Table A3.3 in TM15, used in the second sum of alpha^r_{oi}
Definition: gerg04.hpp:250
static arma::mat betat
temperature coefficient, from table A3.8
Definition: gerg04.hpp:238
static arma::cube gaijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:266
void calculateCoefficients()
Set the pressure and temperature independent coefficients.
double rhored
Inverse reducing function for mixture density .
Definition: gerg04.hpp:281
static arma::cube tijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:261
static arma::mat toipol
, from Table A3.2 in TM15, used in the first sum of alpha^r_{oi}
Definition: gerg04.hpp:245
The GERG04 class implements the GERG 2004 equation of state.
Definition: gerg04.hpp:22
GERG04(const arma::vec &composition=Composition::defaultComposition)
GERG04 constructor.
arma::uvec m_indices
The indices of the non-zero gas fractions (components).
Definition: gerg04.hpp:217
virtual arma::vec evaluate(const double pressure, const double temperature) const override
Evaluate the GERG 2004 equation of state at the given pressure and temperature.
void evaluateAlpha_roi_deltas(const double tred_temperature, const double start_rhored, const double start_rhored_pow_minusOne, const double start_rhored_pow_minusTwo, double &aroidelta, double &arijdelta, double &aroideltadelta, double &arijdeltadelta) const
Internal (private) function used in the process of evaluating the GERG 2004 equations.
arma::uvec m_lastIndices
The indices of the two last non-zero gas fractions (components).
Definition: gerg04.hpp:235
void setNonZeroComponents()
Internal (private) function that updates the non-zero components.
The EquationOfStateBase is an abstract class, the base class for different equations of state.
Definition: equationofstatebase.hpp:20
static arma::cube dijpol
, from Table A3.7 in TM15, used in the first sum of alpha^r_{ij}
Definition: gerg04.hpp:256
virtual double calculateCompressibility(const double pressure, const double temperature) const override
Calculate compressibility Z at given pressure and temperature.
static arma::cube epijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:264
static arma::cube nijexp_times_tijexp_times_tijexp_minus_one
((GERG04::nijpol x GERG04::tijpol) x (GERG04::tijpol - 1.0))
Definition: gerg04.hpp:276
double Ra
Gas constant of mixture [J/mol K].
Definition: gerg04.hpp:284
static arma::cube nijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:259
const arma::uword N
Number of components.
Definition: gerg04.hpp:201
double tred
Reducing function for mixture temperature .
Definition: gerg04.hpp:282
arma::vec X
Composition in order CH4, N2, CO2, C2H6, C3H8, nC4H10, iC4H10, nC5H12, iC5H12, nC6H14.
Definition: gerg04.hpp:202
const arma::uvec & indicesOfNonZeroComponents() const
Get the indices of the non-zero components in the composition.
Definition: gerg04.hpp:133
arma::vec rhoc
Critical density [kg/m3] for components CH4, N2, CO2, C2H6, C3H8, nC4H10, iC4H10, nC5H12,...
Definition: gerg04.hpp:207
static arma::cube tijpol
, from Table A3.7 in TM15, used in the first sum of alpha^r_{ij}
Definition: gerg04.hpp:257
static arma::mat noipol
, from Table A3.2 in TM15, used in the first sum of alpha^r_{oi}
Definition: gerg04.hpp:243
static arma::cube nijpol_times_tijpol_times_tijpol_minus_one
((GERG04::nijpol x GERG04::tijpol) x (GERG04::tijpol - 1.0))
Definition: gerg04.hpp:274
static arma::mat betav
density interaction coefficient, from table A3.8
Definition: gerg04.hpp:237
double findSpeedOfSound(const double temperature, const double density) const
Find the soundspeed in the gas at a given temperature and density.
static arma::cube dijexp
, from Table A3.7 in TM15, used in the second sum of alpha^r_{ij}
Definition: gerg04.hpp:260
virtual bool setComposition(const arma::vec &composition, const bool force=true) override
Set the composition.
static arma::cube nijpol_times_dijpol_times_tijpol
(GERG04::nijpol x GERG04::dijpol x GERG04::tijpol)
Definition: gerg04.hpp:278
arma::vec evaluateAllProperties(const double pressure, const double temperature) const
Evaluate all available gas properties at a given pressure and temperature.
static arma::mat gammav
density interaction coefficient, from table A3.8
Definition: gerg04.hpp:239
static arma::mat gammat
temperature interaction coefficient, from table A3.8
Definition: gerg04.hpp:240
static arma::cube nijpol_times_dijpol
(GERG04::nijpol x GERG04::dijpol)
Definition: gerg04.hpp:277