https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADOneD3EqnMomentumFriction.C
Go to the documentation of this file.
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
11
13
16{
18 params.addRequiredCoupledVar("A", "Cross-sectional area");
19 params.addRequiredParam<MaterialPropertyName>("D_h", "Hydraulic diameter");
20 params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
21 params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
22 params.addRequiredParam<MaterialPropertyName>("f_D",
23 "Darcy friction factor coefficient property");
24 params.addClassDescription("Computes wall friction term for single phase flow.");
25 return params;
26}
27
29 : ADKernel(parameters),
30 _A(adCoupledValue("A")),
31 _D_h(getADMaterialProperty<Real>("D_h")),
32 _rho(getADMaterialProperty<Real>("rho")),
33 _vel(getADMaterialProperty<Real>("vel")),
34 _f_D(getADMaterialProperty<Real>("f_D"))
35{
36}
37
40{
41 using std::abs;
42 return 0.5 * _f_D[_qp] * _rho[_qp] * _vel[_qp] * abs(_vel[_qp]) * _A[_qp] / _D_h[_qp] *
43 _test[_i][_qp];
44}
registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnMomentumFriction)
DualNumber< Real, DNDerivativeType, true > ADReal
const ADTemplateVariableTestValue< T > & _test
static InputParameters validParams()
Computes wall friction term for single phase flow.
const ADMaterialProperty< Real > & _vel
velocity
const ADVariableValue & _A
area
virtual ADReal computeQpResidual() override
static InputParameters validParams()
ADOneD3EqnMomentumFriction(const InputParameters &parameters)
const ADMaterialProperty< Real > & _f_D
Darcy friction factor.
const ADMaterialProperty< Real > & _D_h
Hydraulic diameter.
const ADMaterialProperty< Real > & _rho
Density.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _i