[Input] Create PureFluid objects from YAML definitions
This commit is contained in:
parent
9e98aef969
commit
ecc1cf0db2
4 changed files with 28 additions and 0 deletions
|
|
@ -31,6 +31,10 @@ PureFluidPhase::PureFluidPhase() :
|
|||
|
||||
void PureFluidPhase::initThermo()
|
||||
{
|
||||
if (m_input.hasKey("pure-fluid-name")) {
|
||||
setSubstance(m_input["pure-fluid-name"].asString());
|
||||
}
|
||||
|
||||
if (m_tpx_name != "") {
|
||||
m_sub.reset(tpx::newSubstance(m_tpx_name));
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ ThermoFactory::ThermoFactory()
|
|||
reg("StoichSubstance", []() { return new StoichSubstance(); });
|
||||
m_synonyms["fixed-stoichiometry"] = "StoichSubstance";
|
||||
reg("PureFluid", []() { return new PureFluidPhase(); });
|
||||
m_synonyms["pure-fluid"] = "PureFluid";
|
||||
reg("LatticeSolid", []() { return new LatticeSolidPhase(); });
|
||||
reg("Lattice", []() { return new LatticePhase(); });
|
||||
reg("HMW", []() { return new HMWSoln(); });
|
||||
|
|
|
|||
|
|
@ -174,6 +174,10 @@ phases:
|
|||
thermo: Redlich-Kwong
|
||||
state: {T: 300, P: 200 atm, mole-fractions: {CO2: 0.9998, H2O: 0.0002}}
|
||||
|
||||
- name: nitrogen
|
||||
species: [N2]
|
||||
thermo: pure-fluid
|
||||
pure-fluid-name: nitrogen
|
||||
|
||||
species:
|
||||
- name: NaCl(s)
|
||||
|
|
@ -276,6 +280,17 @@ species:
|
|||
model: constant-volume
|
||||
molar-volume: 0.01 m^3/kmol
|
||||
|
||||
- name: N2
|
||||
composition: {N: 2}
|
||||
thermo:
|
||||
model: NASA7
|
||||
temperature-ranges: [300.0, 1000.0, 5000.0]
|
||||
data:
|
||||
- [3.298677, 0.0014082404, -3.963222e-06, 5.641515e-09, -2.444854e-12,
|
||||
-1020.8999, 3.950372]
|
||||
- [2.92664, 0.0014879768, -5.68476e-07, 1.0097038e-10, -6.753351e-15,
|
||||
-922.7977, 5.980528]
|
||||
|
||||
|
||||
ideal-molal-fake-species:
|
||||
# Fake thermo data (GRI 3.0 coefficients for H2)
|
||||
|
|
|
|||
|
|
@ -324,3 +324,11 @@ TEST(ThermoFromYaml, RedlichKwong_CO2)
|
|||
EXPECT_NEAR(thermo->enthalpy_mass(), -8872890.9496462, 1e-6);
|
||||
EXPECT_NEAR(thermo->cp_mass(), 3358.439021094, 1e-8);
|
||||
}
|
||||
|
||||
TEST(ThermoFromYaml, PureFluid_nitrogen)
|
||||
{
|
||||
auto thermo = newThermo("thermo-models.yaml", "nitrogen");
|
||||
thermo->setState_TP(70, 2*OneAtm);
|
||||
EXPECT_NEAR(thermo->density(), 841.0420151, 1e-6);
|
||||
EXPECT_NEAR(thermo->gibbs_mole(), -17654452.8821914, 1e-6);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue