Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "FVSpecificEnthalpyFromPressureTemperatureDirichletBC.h" 11 : #include "SinglePhaseFluidProperties.h" 12 : #include "NS.h" 13 : 14 : registerMooseObject("NavierStokesApp", FVSpecificEnthalpyFromPressureTemperatureDirichletBC); 15 : 16 : InputParameters 17 205 : FVSpecificEnthalpyFromPressureTemperatureDirichletBC::validParams() 18 : { 19 205 : InputParameters params = FVDirichletBCBase::validParams(); 20 410 : params.addRequiredParam<UserObjectName>("fp", "The name of fluid properties object."); 21 205 : params.addRequiredParam<MooseFunctorName>( 22 : NS::pressure, "The pressure (units should be based on fluid properties object)"); 23 205 : params.addRequiredParam<MooseFunctorName>( 24 : NS::T_fluid, "The temperature (units should be based on fluid properties object)"); 25 205 : params.addClassDescription( 26 : "Computes the specific enthalpy at the boundary from the pressure and temperature."); 27 205 : return params; 28 0 : } 29 : 30 110 : FVSpecificEnthalpyFromPressureTemperatureDirichletBC:: 31 110 : FVSpecificEnthalpyFromPressureTemperatureDirichletBC(const InputParameters & parameters) 32 : : FVDirichletBCBase(parameters), 33 110 : _fp(getUserObject<SinglePhaseFluidProperties>("fp")), 34 110 : _pressure(getFunctor<ADReal>(NS::pressure)), 35 110 : _temperature(getFunctor<ADReal>(NS::T_fluid)) 36 : { 37 110 : } 38 : 39 : ADReal 40 57799 : FVSpecificEnthalpyFromPressureTemperatureDirichletBC::boundaryValue( 41 : const FaceInfo & fi, const Moose::StateArg & state) const 42 : { 43 57799 : auto sfa = singleSidedFaceArg(&fi); 44 57799 : return _fp.h_from_p_T(_pressure(sfa, state), _temperature(sfa, state)); 45 : }