https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADOneD3EqnMomentumFormLoss.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#include "Function.h"
12
14
17{
19 params.addRequiredCoupledVar("A", "Cross-sectional area");
20 params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
21 params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
23 "Computes a volumetric form loss for the momentum equation for 1-phase flow");
24
25 return params;
26}
27
29 : ADKernel(parameters),
30 _A(adCoupledValue("A")),
31 _rho(getADMaterialProperty<Real>("rho")),
32 _vel(getADMaterialProperty<Real>("vel")),
33 _K_prime(getADMaterialProperty<Real>("K_prime"))
34{
35}
36
39{
40 using std::abs;
41 return _K_prime[_qp] * 0.5 * _rho[_qp] * _vel[_qp] * abs(_vel[_qp]) * _A[_qp] * _test[_i][_qp];
42}
registerMooseObject("ThermalHydraulicsApp", ADOneD3EqnMomentumFormLoss)
DualNumber< Real, DNDerivativeType, true > ADReal
const ADTemplateVariableTestValue< T > & _test
static InputParameters validParams()
Computes the force per unit length due to form loss, provided a form loss coefficient per unit length...
static InputParameters validParams()
const ADMaterialProperty< Real > & _rho
density
const ADMaterialProperty< Real > & _K_prime
form loss coefficient per unit length function
virtual ADReal computeQpResidual() override
ADOneD3EqnMomentumFormLoss(const InputParameters &parameters)
const ADVariableValue & _A
area
const ADMaterialProperty< Real > & _vel
velocity
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