Loading [MathJax]/extensions/tex2jax.js
TransFlow
0.1.0
A transient pipeline flow simulation library
|
6 #include "equationofstate/equationofstatebase.hpp"
54 const std::string& parameterSet =
"Calsep"
73 const std::string& ABparameterFile = std::string(TRANSFLOW_RESOURCE_PATH) +
"/equationofstate/bwrs/calsepABparameters.csv",
74 const std::string& binaryInteractionTableFile = std::string(TRANSFLOW_RESOURCE_PATH) +
"/equationofstate/bwrs/calsepBinaryInteraction.csv",
75 const std::string& criticalProperties =
"Starling"
85 const double pressure,
86 const double temperature)
const override;
105 const double pressure,
106 const double temperature)
const override;
120 virtual bool setComposition(
const arma::vec& composition,
const bool force =
true)
override;
200 const std::string& ABparameterFile,
201 const std::string& binaryInteractionTableFile);
218 const double pressure,
219 const double temperature,
220 const double tolerance = 1e-4)
const;
238 arma::vec
m_Tc = arma::vec({ 190.69, 305.39, 369.89, 408.13, 425.19, 460.37, 469.49, 507.29, 126.15, 304.15});
240 arma::vec
m_rhoc = arma::vec({ 1.00500e+4, 6.75659e+3, 4.99936e+3, 3.80118e+3, 3.92132e+3, 3.24694e+3, 3.21491e+3, 2.71673e+3, 1.10992e+4, 1.06379e+4});
242 arma::vec
m_w = arma::vec({ 0.013, 0.1018, 0.157, 0.183, 0.197, 0.226, 0.252, 0.302, 0.035, 0.21});
244 arma::vec
m_pc = arma::vec({ 45.96, 48.839, 42.5, 36.48, 37.96, 33.81, 33.69, 27.34, 33.99, 73.825})*1e5;
246 arma::vec
m_molarMass = arma::vec({ 16.042, 30.068, 44.094, 58.12, 58.12, 72.146, 72.146, 86.172, 28.016, 44.01});
348 const double pressure,
349 const double temperature,
350 const double tolerance = 1e-4)
const;
double m_D0
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:290
arma::uvec m_indices
The indices of the non-zero gas fractions (components).
Definition: bwrs.hpp:328
double getMixtureCriticalPressure() const
Get the critical pressure of the gas mixture [Pa].
Definition: bwrs.hpp:227
void loadJFHCriticalProperties()
Load the critical properties from Helgaker.
virtual bool setComposition(const arma::vec &composition, const bool force=true) override
Set the composition of the EOS.
arma::mat m_binaryInteractionParameterTable
Binary interaction coefficients .
Definition: bwrs.hpp:271
arma::vec m_rhoc
Critical density [kg/m3].
Definition: bwrs.hpp:240
static const Composition defaultComposition
Default composition.
Definition: composition.hpp:81
arma::vec m_pc
Critical pressure [Pa].
Definition: bwrs.hpp:244
double m_GAMMA
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:297
void loadCalsepParameters()
virtual double calculateCompressibility(const double pressure, const double temperature) const override
Calculate the compressibility factor (Z) of the gas at a given pressure and temperature.
arma::vec m_molarMass
Molar mass of the different gas components [g/mol].
Definition: bwrs.hpp:246
static BWRS fromFilePaths(const arma::vec &composition=Composition::defaultComposition, const std::string &ABparameterFile=std::string(TRANSFLOW_RESOURCE_PATH)+"/equationofstate/bwrs/calsepABparameters.csv", const std::string &binaryInteractionTableFile=std::string(TRANSFLOW_RESOURCE_PATH)+"/equationofstate/bwrs/calsepBinaryInteraction.csv", const std::string &criticalProperties="Starling")
Explicit BWRS constructor which allows specifying which files to load mixture parameters and and bi...
arma::vec m_expW
Exponential of the accentric factor.
Definition: bwrs.hpp:248
double m_d
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:295
void loadStarlingCriticalProperties()
Load the critical properties from Starling.
void calculateCoefficients()
Calculates all the coefficients used for evaluating BWRS that are independent of pressure and tempera...
double m_B0
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:288
double m_C0
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:289
double m_b
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:293
double m_R
The gas constant [J/(K mol)].
Definition: bwrs.hpp:258
The EquationOfStateBase is an abstract class, the base class for different equations of state.
Definition: equationofstatebase.hpp:20
double m_ALPHA
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:296
void loadParameterFiles(const std::string &ABparameterFile, const std::string &binaryInteractionTableFile)
Load mixture parameters and , and binary interaction coefficients coefficients from specific files.
void enableConstantHeatCapacities()
Enable constant heat capacity and .
double m_A0
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:287
void loadCalsepCriticalProperties()
Load the critical properties from the Calsep report.
void loadGasscoParameters()
double m_criticalPressureOfMixture
Critical pressure of the gas mixture.
Definition: bwrs.hpp:299
double m_a
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:292
bool m_useConstantHeatCapacities
Flag to set if we want to use constant heat capacity and .
Definition: bwrs.hpp:302
void loadParametersAndCriticalProperties(const std::string parameterSet)
loadParametersAndCriticalProperties Load parameters and critical properties.
void findNonZeroComponents()
Set up BWRS::m_indices to reflect which gas fractions are non-zero.
void loadStarlingParameters()
arma::vec m_Bi
Pure component parameters Bi.
Definition: bwrs.hpp:278
void loadCriticalProperties(const std::string name)
loadCriticalProperties Load a set of critical properties. Either "Calsep", "JFH" or "Starling".
double findDensity(const double pressure, const double temperature, const double tolerance=1e-4) const
Find the gas density at a given pressure and temperature.
Implements the Benedict-Webb-Rubin-Starling (BWRS) equation of state.
Definition: bwrs.hpp:26
double getGasConstant() const
Get the gas constant R.
Definition: bwrs.hpp:224
double m_c
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:294
arma::vec m_w
Accentric factor [-].
Definition: bwrs.hpp:242
virtual arma::vec evaluate(const double pressure, const double temperature) const override
Evaluate the BWRS equation of state at the given pressure and temperature.
double getMixtureCriticalTemperature() const
Get the critical temperature of the gas mixture [K].
Definition: bwrs.hpp:230
double m_E0
A coefficient used when evaluating the BWRS-equation. Independent of pressure and temperature.
Definition: bwrs.hpp:291
double m_criticalTemperatureOfMixture
Critical temperature of the gas mixture.
Definition: bwrs.hpp:300
arma::vec m_Ai
Pure component parameters Ai.
Definition: bwrs.hpp:285
BWRS(const arma::vec &composition=Composition::defaultComposition, const std::string ¶meterSet="Calsep")
Constructor that uses a string to select which mixture parameters and , binary interaction coefficie...
double findMolarDensity(const double pressure, const double temperature, const double tolerance=1e-4) const
Find the molar density of the gas at a given pressure and temperature.
arma::vec m_Tc
Critical temperature [K].
Definition: bwrs.hpp:238