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 "ADOneD3EqnMomentumAreaGradient.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnMomentumAreaGradient); 13 : 14 : InputParameters 15 8918 : ADOneD3EqnMomentumAreaGradient::validParams() 16 : { 17 8918 : InputParameters params = ADKernel::validParams(); 18 17836 : params.addRequiredCoupledVar("A", "Cross-sectional area"); 19 17836 : params.addRequiredParam<MaterialPropertyName>( 20 : "direction", "The direction of the flow channel material property"); 21 17836 : params.addRequiredParam<MaterialPropertyName>("p", "Pressure"); 22 8918 : params.addClassDescription( 23 : "Computes the area gradient term in the momentum equation for single phase flow."); 24 8918 : return params; 25 0 : } 26 : 27 4870 : ADOneD3EqnMomentumAreaGradient::ADOneD3EqnMomentumAreaGradient(const InputParameters & parameters) 28 : : ADKernel(parameters), 29 4870 : _area_grad(coupledGradient("A")), 30 9740 : _dir(getMaterialProperty<RealVectorValue>("direction")), 31 14610 : _pressure(getADMaterialProperty<Real>("p")) 32 : { 33 4870 : } 34 : 35 : ADReal 36 5233252 : ADOneD3EqnMomentumAreaGradient::computeQpResidual() 37 : { 38 15699756 : return -_pressure[_qp] * _area_grad[_qp] * _dir[_qp] * _test[_i][_qp]; 39 : }