From ee8d454310dcda89d80985e9e0c9803254abd02a Mon Sep 17 00:00:00 2001 From: Peter German Date: Thu, 12 Dec 2024 11:11:17 -0700 Subject: [PATCH] Address Guillaume's comments. (#29531) --- .../LinearFVEnthalpyFunctorMaterial.h | 12 ++++++++---- .../LinearFVEnthalpyFunctorMaterial.C | 11 +++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/modules/navier_stokes/include/functormaterials/LinearFVEnthalpyFunctorMaterial.h b/modules/navier_stokes/include/functormaterials/LinearFVEnthalpyFunctorMaterial.h index e8e50b01708b..670bfe4766af 100644 --- a/modules/navier_stokes/include/functormaterials/LinearFVEnthalpyFunctorMaterial.h +++ b/modules/navier_stokes/include/functormaterials/LinearFVEnthalpyFunctorMaterial.h @@ -10,13 +10,13 @@ #pragma once #include "FunctorMaterial.h" -#include "Function.h" class SinglePhaseFluidProperties; -class Function; /**e - * Computes fluid properties in (P, T) formulation using functor material properties + * Converts temperature to enthalpy or enthalpy to temperature using + * functor material properties. The derivatives are discarded, so can't + * be used with AD. */ class LinearFVEnthalpyFunctorMaterial : public FunctorMaterial { @@ -25,12 +25,16 @@ class LinearFVEnthalpyFunctorMaterial : public FunctorMaterial LinearFVEnthalpyFunctorMaterial(const InputParameters & parameters); protected: - /// variables + /// Variables, treated as functors, needs to be AD because + /// Materials inherit from ADFunctorInterface const Moose::Functor & _pressure; const Moose::Functor & _T_fluid; const Moose::Functor & _h; + /// The fluid properties that containt the h from Tconversion routines const SinglePhaseFluidProperties * _fluid; + + /// Pointers to the the conversion functors (in case the fluid property is not provided) const Moose::Functor * _h_from_p_T_functor; const Moose::Functor * _T_from_p_h_functor; diff --git a/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C b/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C index 5d9d8dd51eda..5a3564d27dca 100644 --- a/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C +++ b/modules/navier_stokes/src/functormaterials/LinearFVEnthalpyFunctorMaterial.C @@ -45,12 +45,11 @@ LinearFVEnthalpyFunctorMaterial::LinearFVEnthalpyFunctorMaterial(const InputPara // Check parameters if (!( (_fluid && !_h_from_p_T_functor && !_T_from_p_h_functor) || (!_fluid && _h_from_p_T_functor && _T_from_p_h_functor))) - { - mooseError(false, - "For `LinearFVEnthalpyFunctorMaterial` , an unsupported combination of input parameters was given. Current" - "supported combinations are either i) fp and no _h_from_p_T_functor and _T_from_p_h_functor, or ii) " - "no fp and _h_from_p_T_functor and _T_from_p_h_functor."); - } + { + mooseError("An unsupported combination of input parameters was given. Current" + "supported combinations are either i) `fp` and neither `h_from_p_T_functor` nor `T_from_p_h_functor`, or ii) " + "no `fp` and `h_from_p_T_functor` and `T_from_p_h_functor`."); + } // // Set material properties functors