Skip to content

Commit a03a926

Browse files
committed
More clarifying what fluid properties object is built how in unit tests
1 parent c8481ac commit a03a926

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

modules/fluid_properties/unit/include/TabulatedBicubicFluidPropertiesTest.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class TabulatedBicubicFluidPropertiesTest : public MooseObjectUnitTest
5353
_fe_problem->addUserObject("TabulatedBicubicFluidProperties", "tab_fp_ve", tab_uo_ve_params);
5454
_tab_ve_from_pT = &_fe_problem->getUserObject<TabulatedBicubicFluidProperties>("tab_fp_ve");
5555

56-
// Tabulation in (p, T) built from another FluidProperties, specifically for testing generation
56+
// Tabulation in (p, T) built from another FluidProperties, specifically for testing generation
5757
InputParameters tab_gen_uo_params = _factory.getValidParams("TabulatedBicubicFluidProperties");
5858
tab_gen_uo_params.set<UserObjectName>("fp") = "co2_fp";
5959
tab_gen_uo_params.set<Real>("temperature_min") = 400;
@@ -63,8 +63,8 @@ class TabulatedBicubicFluidPropertiesTest : public MooseObjectUnitTest
6363
tab_gen_uo_params.set<unsigned int>("num_T") = 6;
6464
tab_gen_uo_params.set<unsigned int>("num_p") = 6;
6565
tab_gen_uo_params.set<MultiMooseEnum>("interpolated_properties") = properties;
66-
_fe_problem->addUserObject("TabulatedBicubicFluidProperties", "tab_gen_fp", tab_gen_uo_params);
67-
_tab_gen_fp = &_fe_problem->getUserObject<TabulatedBicubicFluidProperties>("tab_gen_fp");
66+
_fe_problem->addUserObject("TabulatedBicubicFluidProperties", "tab_pT_from_fp_gen", tab_gen_uo_params);
67+
_tab_pT_from_fp_gen = &_fe_problem->getUserObject<TabulatedBicubicFluidProperties>("tab_pT_from_fp_gen");
6868

6969
// Tabulation in (v, e) built from another FluidProperties
7070
InputParameters tab_direct_ve_params =
@@ -81,8 +81,6 @@ class TabulatedBicubicFluidPropertiesTest : public MooseObjectUnitTest
8181
// set newton parameters for inversion
8282
tab_direct_ve_params.set<Real>("T_initial_guess") = 450;
8383
tab_direct_ve_params.set<Real>("p_initial_guess") = 1.5e6;
84-
// tab_direct_ve_params.set<Real>("tolerance") = 1e-6;
85-
tab_direct_ve_params.set<unsigned int>("max_newton_its") = 300;
8684
MultiMooseEnum properties_ve(
8785
"density enthalpy viscosity k c cv cp entropy pressure temperature",
8886
"density enthalpy viscosity k c cv cp entropy pressure temperature");
@@ -138,7 +136,7 @@ class TabulatedBicubicFluidPropertiesTest : public MooseObjectUnitTest
138136
// For testing values
139137
const TabulatedBicubicFluidProperties * _tab_pT_from_fp;
140138
const TabulatedBicubicFluidProperties * _tab_ve_from_pT;
141-
const TabulatedBicubicFluidProperties * _tab_gen_fp;
139+
const TabulatedBicubicFluidProperties * _tab_pT_from_fp_gen;
142140
const TabulatedBicubicFluidProperties * _tab_ve_from_fp;
143141

144142
// These properties are for testing errors and warnings

modules/fluid_properties/unit/src/TabulatedBicubicFluidPropertiesTest.C

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -887,17 +887,17 @@ TEST_F(TabulatedBicubicFluidPropertiesTest, generateTabulatedData)
887887
Real p = 1.5e6;
888888
Real T = 450.0;
889889

890-
// Generate the tabulated data
891-
const_cast<TabulatedBicubicFluidProperties *>(_tab_gen_fp)->initialSetup();
892-
893-
REL_TEST(_tab_gen_fp->rho_from_p_T(p, T), _co2_fp->rho_from_p_T(p, T), 1.0e-4);
894-
REL_TEST(_tab_gen_fp->h_from_p_T(p, T), _co2_fp->h_from_p_T(p, T), 1.0e-4);
895-
REL_TEST(_tab_gen_fp->e_from_p_T(p, T), _co2_fp->e_from_p_T(p, T), 1.0e-4);
896-
REL_TEST(_tab_gen_fp->mu_from_p_T(p, T), _co2_fp->mu_from_p_T(p, T), 1.0e-4);
897-
REL_TEST(_tab_gen_fp->k_from_p_T(p, T), _co2_fp->k_from_p_T(p, T), 1.0e-4);
898-
REL_TEST(_tab_gen_fp->cp_from_p_T(p, T), _co2_fp->cp_from_p_T(p, T), 1.0e-4);
899-
REL_TEST(_tab_gen_fp->cv_from_p_T(p, T), _co2_fp->cv_from_p_T(p, T), 1.0e-4);
900-
REL_TEST(_tab_gen_fp->s_from_p_T(p, T), _co2_fp->s_from_p_T(p, T), 1.0e-4);
890+
// Generate the tabulated data from the CO2 fluid properties
891+
const_cast<TabulatedBicubicFluidProperties *>(_tab_pT_from_fp_gen)->initialSetup();
892+
893+
REL_TEST(_tab_pT_from_fp_gen->rho_from_p_T(p, T), _co2_fp->rho_from_p_T(p, T), 1.0e-4);
894+
REL_TEST(_tab_pT_from_fp_gen->h_from_p_T(p, T), _co2_fp->h_from_p_T(p, T), 1.0e-4);
895+
REL_TEST(_tab_pT_from_fp_gen->e_from_p_T(p, T), _co2_fp->e_from_p_T(p, T), 1.0e-4);
896+
REL_TEST(_tab_pT_from_fp_gen->mu_from_p_T(p, T), _co2_fp->mu_from_p_T(p, T), 1.0e-4);
897+
REL_TEST(_tab_pT_from_fp_gen->k_from_p_T(p, T), _co2_fp->k_from_p_T(p, T), 1.0e-4);
898+
REL_TEST(_tab_pT_from_fp_gen->cp_from_p_T(p, T), _co2_fp->cp_from_p_T(p, T), 1.0e-4);
899+
REL_TEST(_tab_pT_from_fp_gen->cv_from_p_T(p, T), _co2_fp->cv_from_p_T(p, T), 1.0e-4);
900+
REL_TEST(_tab_pT_from_fp_gen->s_from_p_T(p, T), _co2_fp->s_from_p_T(p, T), 1.0e-4);
901901
}
902902

903903
// Test that all fluid properties are properly passed back to the given user object

0 commit comments

Comments
 (0)