Adding test suite coverage for critcal property lookups in RedlichKwongMFTP
This commit is contained in:
parent
68a89d0322
commit
0257c4868e
2 changed files with 46 additions and 0 deletions
23
test/data/co2_RK_lookup.cti
Normal file
23
test/data/co2_RK_lookup.cti
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
units(length = "cm", time = "s", quantity = "mol", act_energy = "cal/mol")
|
||||
|
||||
# Create an instance of the phase where one or more pureFluidParamters inputs are missing.
|
||||
# This tests the ability to lookup critical properties in the database critProperties.xml:
|
||||
|
||||
RedlichKwongMFTP(name = "carbondioxide",
|
||||
elements = " C O H N ",
|
||||
species = """ gri30: CO2 H2O H2 CO CH4 O2 N2 """,
|
||||
activity_coefficients = (
|
||||
pureFluidParameters(species="H2O", a_coeff = [1.7458E13, -8.0E9], b_coeff = 18.18),
|
||||
pureFluidParameters(species="H2" , a_coeff = [1.37191E11, 0], b_coeff = 17.64),
|
||||
pureFluidParameters(species="CO", a_coeff = [1.7226E12, 0], b_coeff = 27.42),
|
||||
pureFluidParameters(species="CH4", a_coeff = [3.22224E12, 0], b_coeff = 29.848),
|
||||
pureFluidParameters(species="O2", a_coeff = [1.741E12, 0], b_coeff = 22.081),
|
||||
crossFluidParameters(species="CO2 H2O", a_coeff = [7.897e12, 0])
|
||||
),
|
||||
transport = "Multi",
|
||||
initial_state = state(
|
||||
temperature = 300.0,
|
||||
pressure = OneAtm,
|
||||
mole_fractions = 'CO2:0.99, H2:0.01'
|
||||
)
|
||||
)
|
||||
|
|
@ -165,4 +165,27 @@ TEST_F(RedlichKwongMFTP_Test, setTP)
|
|||
EXPECT_NEAR(test_phase->density(),p3[i],1.e-8);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(RedlichKwongMFTP_Test, critPropLookup)
|
||||
{
|
||||
// Check to make sure that RedlichKwongMFTP is able to properly calculate a and b
|
||||
// pureFluidParameters based on tabulated critical properties
|
||||
test_phase.reset(newPhase("../data/co2_RK_lookup.cti"));
|
||||
|
||||
// Check that the critical properties (temperature and pressure) are calculated correctly for
|
||||
// pure fluids, both for those with pureFluidParameters provided in the cti file (i.e., h2) and
|
||||
// those where the pureFluidParameters are calculated based on the tabulated critical properties
|
||||
// (i.e. co2):
|
||||
|
||||
// CO2 - should match tabulated values in critProperties.xml
|
||||
set_r(1.0);
|
||||
EXPECT_DOUBLE_EQ(test_phase->critTemperature(), 304.2);
|
||||
EXPECT_DOUBLE_EQ(test_phase->critPressure(), 7390000);
|
||||
|
||||
// H2
|
||||
set_r(0.0);
|
||||
EXPECT_NEAR(test_phase->critTemperature(), 33.001, 1.e-3);
|
||||
EXPECT_NEAR(test_phase->critPressure(), 1347700, 100);
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue