Skip to content

Commit

Permalink
[Test] Move testIAPWSTripP into the gtest suite
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Nov 24, 2015
1 parent 1cc0d42 commit 61a4571
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 124 deletions.
35 changes: 35 additions & 0 deletions test/thermo/water_iapws.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "gtest/gtest.h"
#include "cantera/thermo/WaterPropsIAPWSphi.h"
#include "cantera/thermo/WaterPropsIAPWS.h"

using namespace Cantera;

Expand Down Expand Up @@ -46,3 +47,37 @@ TEST_F(WaterPropsIAPWSphi_Test, check2) {
EXPECT_NEAR(phi0_dt(), 0.000000000000e+00, 1e-11);
EXPECT_NEAR(phiR_dt(), -1.332147204361e+00, 1e-11);
}

class WaterPropsIAPWS_Test : public testing::Test
{
public:
WaterPropsIAPWS water;
};

// See values on p. 395 of Wagner & Pruss.
TEST_F(WaterPropsIAPWS_Test, triple_point_liquid)
{
double T = 273.16;
double pres = water.psat(T);
EXPECT_NEAR(pres, 611.655, 2e-3);
EXPECT_NEAR(water.density(T, pres, WATER_LIQUID), 999.793, 2e-3);
EXPECT_NEAR(water.intEnergy(), 0.0, 5e-7);
EXPECT_NEAR(water.entropy(), 0.0, 5e-9);
EXPECT_NEAR(water.enthalpy(), 11.0214, 2e-4);
EXPECT_NEAR(water.Gibbs(), 11.0214, 2e-4);
EXPECT_NEAR(water.cv(), 75978.2, 2e-1);
EXPECT_NEAR(water.cp(), 76022.8, 2e-1);
}

TEST_F(WaterPropsIAPWS_Test, triple_point_gas)
{
double T = 273.16;
double pres = water.psat(T);
EXPECT_NEAR(water.density(T, pres, WATER_GAS), 4.85458e-3, 2e-8);
EXPECT_NEAR(water.intEnergy(), 4.27848e7, 2e2);
EXPECT_NEAR(water.entropy(), 164939., 2e0);
EXPECT_NEAR(water.enthalpy(), 4.50547e7, 2e2);
EXPECT_NEAR(water.Gibbs(), 11.0214, 2e-4);
EXPECT_NEAR(water.cv(), 25552.6, 2e-1);
EXPECT_NEAR(water.cp(), 33947.1, 2e-1);
}
2 changes: 0 additions & 2 deletions test_problems/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ CompileAndTest('stoichSub', 'cathermo/stoichSub',
'stoichSub', 'output_blessed.txt')
CompileAndTest('IAPWSPres', 'cathermo/testIAPWSPres',
'testIAPWSPres', 'output_blessed.txt')
CompileAndTest('IAPWSTripP', 'cathermo/testIAPWSTripP',
'testIAPWSTripP', 'output_blessed.txt')
CompileAndTest('WaterPDSS', 'cathermo/testWaterPDSS',
'testWaterPDSS', 'output_blessed.txt')
CompileAndTest('WaterSSTP', 'cathermo/testWaterTP',
Expand Down
11 changes: 0 additions & 11 deletions test_problems/cathermo/testIAPWSTripP/README

This file was deleted.

19 changes: 0 additions & 19 deletions test_problems/cathermo/testIAPWSTripP/output_blessed.txt

This file was deleted.

92 changes: 0 additions & 92 deletions test_problems/cathermo/testIAPWSTripP/testTripleP.cpp

This file was deleted.

0 comments on commit 61a4571

Please sign in to comment.