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 "INSFVEnergyTimeDerivative.h" 11 : #include "INSFVEnergyVariable.h" 12 : 13 : #include "NS.h" 14 : 15 : registerMooseObject("NavierStokesApp", INSFVEnergyTimeDerivative); 16 : 17 : InputParameters 18 1005 : INSFVEnergyTimeDerivative::validParams() 19 : { 20 1005 : InputParameters params = FVFunctorTimeKernel::validParams(); 21 1005 : params.addClassDescription( 22 : "Adds the time derivative term to the incompressible Navier-Stokes energy equation."); 23 1005 : params.addRequiredParam<MooseFunctorName>(NS::density, "Density"); 24 3015 : params.addParam<MooseFunctorName>(NS::time_deriv(NS::specific_enthalpy), 25 1005 : NS::time_deriv(NS::specific_enthalpy), 26 : "The time derivative of the specific enthalpy"); 27 1005 : return params; 28 0 : } 29 : 30 553 : INSFVEnergyTimeDerivative::INSFVEnergyTimeDerivative(const InputParameters & params) 31 : : FVFunctorTimeKernel(params), 32 553 : _rho(getFunctor<ADReal>(NS::density)), 33 1106 : _h_dot(getFunctor<ADReal>(NS::time_deriv(NS::specific_enthalpy))) 34 : { 35 553 : if (!dynamic_cast<INSFVEnergyVariable *>(&_var)) 36 0 : paramError("variable", "The supplied variable should be of INSFVEnergyVariable type."); 37 553 : } 38 : 39 : ADReal 40 2910198 : INSFVEnergyTimeDerivative::computeQpResidual() 41 : { 42 2910198 : const auto elem_arg = makeElemArg(_current_elem); 43 2910198 : const auto state = determineState(); 44 2910198 : return _rho(elem_arg, state) * _h_dot(elem_arg, state); 45 : }