From f73eb16e0f19eefe62e3639911ab3a116e4d0fc8 Mon Sep 17 00:00:00 2001 From: Guillaume Giudicelli Date: Sat, 11 Jan 2025 20:16:26 -0700 Subject: [PATCH] WIP Address Mauricio's review - rename a boolean - rename a postprocessor Co-authored-by: Mauricio Tano --- .../functormaterials/INSFVEnthalpyFunctorMaterial.h | 2 +- .../src/functormaterials/INSFVEnthalpyFunctorMaterial.C | 8 ++++---- .../tests/finite_volume/wcns/materials/1d_test_cpT.i | 9 +++++---- .../wcns/materials/2d-steady-wall-balance.i | 2 +- .../wcns/materials/gold/1d_test_cpT_out.csv | 2 +- .../test/tests/finite_volume/wcns/materials/tests | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/modules/navier_stokes/include/functormaterials/INSFVEnthalpyFunctorMaterial.h b/modules/navier_stokes/include/functormaterials/INSFVEnthalpyFunctorMaterial.h index 8a19dbd7744a..d99c6d8ed54a 100644 --- a/modules/navier_stokes/include/functormaterials/INSFVEnthalpyFunctorMaterial.h +++ b/modules/navier_stokes/include/functormaterials/INSFVEnthalpyFunctorMaterial.h @@ -26,7 +26,7 @@ class INSFVEnthalpyFunctorMaterial : public FunctorMaterial protected: /// whether we can use a constant cp as a shortcut to compute enthalpy - bool _assume_constant_cp; + bool _assumed_constant_cp; /// A fluid properties user object to compute enthalpy const SinglePhaseFluidProperties * _fp; diff --git a/modules/navier_stokes/src/functormaterials/INSFVEnthalpyFunctorMaterial.C b/modules/navier_stokes/src/functormaterials/INSFVEnthalpyFunctorMaterial.C index 191954ffa945..fc5a474f0620 100644 --- a/modules/navier_stokes/src/functormaterials/INSFVEnthalpyFunctorMaterial.C +++ b/modules/navier_stokes/src/functormaterials/INSFVEnthalpyFunctorMaterial.C @@ -35,7 +35,7 @@ INSFVEnthalpyFunctorMaterial::validParams() NS::specific_enthalpy, NS::specific_enthalpy, "the name of the specific enthalpy"); // To handle non constant cp - params.addParam("assume_constant_cp", true, "Whether to assume cp is constant"); + params.addParam("assumed_constant_cp", true, "Whether to assume cp is constant"); params.addParam( NS::fluid, "Fluid properties, to be used when cp is not constant to compute enthalpy"); params.addParam( @@ -50,7 +50,7 @@ INSFVEnthalpyFunctorMaterial::validParams() INSFVEnthalpyFunctorMaterial::INSFVEnthalpyFunctorMaterial(const InputParameters & parameters) : FunctorMaterial(parameters), - _assume_constant_cp(getParam("assume_constant_cp")), + _assumed_constant_cp(getParam("assumed_constant_cp")), _fp(isParamValid(NS::fluid) ? &UserObjectInterface::getUserObject(NS::fluid) : nullptr), @@ -63,7 +63,7 @@ INSFVEnthalpyFunctorMaterial::INSFVEnthalpyFunctorMaterial(const InputParameters : nullptr) { // We have to use a warning because fp is often in the global parameters - if (_assume_constant_cp && _fp) + if (_assumed_constant_cp && _fp) paramWarning( "fp", "No need to specify fluid properties if assuming the specific enthalpy is constant"); if (!_assume_constant_cp && ((!_fp || !_pressure) && !_h)) @@ -71,7 +71,7 @@ INSFVEnthalpyFunctorMaterial::INSFVEnthalpyFunctorMaterial(const InputParameters "Must specify both fluid properties and pressure or an enthalpy functor if not " "assuming the specific enthalpy is constant"); - if (_assume_constant_cp) + if (_assumed_constant_cp) { const auto & rho_h = addFunctorProperty(NS::enthalpy_density, diff --git a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/1d_test_cpT.i b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/1d_test_cpT.i index 9f2259c8540a..5f050164e330 100644 --- a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/1d_test_cpT.i +++ b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/1d_test_cpT.i @@ -135,8 +135,9 @@ advected_interp_method = 'upwind' rho = 'rho' cp = 'cp' - assume_constant_cp = false + assumed_constant_cp = false h_in = 'h' + # Alternative to providing 'h': set the fluid property and the pressure parameter # fp = 'fp' # pressure = 'pressure' [] @@ -215,14 +216,14 @@ advected_interp_method = 'upwind' variable = T boundary = 'right' [] - [T_analytical] + [T_analytical_outlet] type = Receiver default = ${fparse (-A_cp+sqrt(A_cp^2-2*B_cp*(-q_source/rho/bulk_u*L-A_cp*T_in-B_cp/2*T_in*T_in)))/B_cp} [] [error_T] type = ParsedPostprocessor - expression = 'T_out - T_analytical' - pp_names = 'T_out T_analytical' + expression = 'T_out - T_analytical_outlet' + pp_names = 'T_out T_analytical_outlet' [] [] diff --git a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-steady-wall-balance.i b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-steady-wall-balance.i index d0d5499fc130..bce756fa786c 100644 --- a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-steady-wall-balance.i +++ b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/2d-steady-wall-balance.i @@ -175,7 +175,7 @@ advected_interp_method = 'upwind' rho = 'rho' cp = 'cp' - assume_constant_cp = false + assumed_constant_cp = false h_in = 'h' # fp = 'fp' # pressure = 'pressure' diff --git a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/gold/1d_test_cpT_out.csv b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/gold/1d_test_cpT_out.csv index 3e302e7a961d..0c61c0ff6d98 100644 --- a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/gold/1d_test_cpT_out.csv +++ b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/gold/1d_test_cpT_out.csv @@ -1,3 +1,3 @@ -time,H_in,H_out,Q,T_analytical,T_out,balance_in_percent,error_T +time,H_in,H_out,Q,T_analytical_outlet,T_out,balance_in_percent,error_T 0,0,0,1500000,899.2226858156,0,0,0 1,-24665522.4,26165522.540111,1500000,899.2226858156,899.22268943977,-5.6804577370916e-07,3.6241718817109e-06 diff --git a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/tests b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/tests index 718bfaa8283a..609e3ee7aa78 100644 --- a/modules/navier_stokes/test/tests/finite_volume/wcns/materials/tests +++ b/modules/navier_stokes/test/tests/finite_volume/wcns/materials/tests @@ -66,7 +66,7 @@ cli_args = "Outputs/file_base=enthalpy_computation_non_constant_cp_out FunctorMaterials/compute_cp/fp=fp FunctorMaterials/compute_cp/pressure=pressure - FunctorMaterials/compute_cp/assume_constant_cp=false" + FunctorMaterials/compute_cp/assumed_constant_cp=false" requirement = 'The system shall be able to compute the specific enthalpy and the enthalpy with a non constant specific heat.' recover = false [] @@ -97,7 +97,7 @@ [missing_fp] type = RunException input = '2d-transient.i' - cli_args = "FunctorMaterials/ins_fv/assume_constant_cp=false" + cli_args = "FunctorMaterials/ins_fv/assumed_constant_cp=false" expect_err = "Must specify both fluid properties and pressure or an enthalpy functor " detail = "not enough parameters are specified when defining the enthalpy functor." []