https://mooseframework.inl.gov
OneD3EqnMomentumAreaGradient.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 
12 registerMooseObject("ThermalHydraulicsApp", OneD3EqnMomentumAreaGradient);
13 
16 {
18  params.addRequiredCoupledVar("arhoA", "The density of the kth phase");
19  params.addRequiredCoupledVar("arhouA", "The momentum of the kth phase");
20  params.addRequiredCoupledVar("arhoEA", "The total energy of the kth phase");
21  params.addRequiredCoupledVar("A", "Cross-sectional area");
22  params.addRequiredParam<MaterialPropertyName>(
23  "direction", "The direction of the flow channel material property");
24  params.addRequiredParam<MaterialPropertyName>("p", "Pressure");
25  params.addClassDescription(
26  "Computes the area gradient term in the momentum equation for single phase flow.");
27  return params;
28 }
29 
32  _area_grad(coupledGradient("A")),
33  _dir(getMaterialProperty<RealVectorValue>("direction")),
34  _pressure(getMaterialProperty<Real>("p")),
35  _dp_darhoA(getMaterialPropertyDerivativeTHM<Real>("p", "arhoA")),
36  _dp_darhouA(getMaterialPropertyDerivativeTHM<Real>("p", "arhouA")),
37  _dp_darhoEA(getMaterialPropertyDerivativeTHM<Real>("p", "arhoEA")),
38  _arhoA_var_number(coupled("arhoA")),
39  _arhoE_var_number(coupled("arhoEA"))
40 {
41 }
42 
43 Real
45 {
46  return -_pressure[_qp] * _area_grad[_qp] * _dir[_qp] * _test[_i][_qp];
47 }
48 
49 Real
51 {
52  return -_dp_darhouA[_qp] * _area_grad[_qp] * _dir[_qp] * _phi[_j][_qp] * _test[_i][_qp];
53 }
54 
55 Real
57 {
58  if (jvar == _arhoA_var_number)
59  {
60  return -_dp_darhoA[_qp] * _area_grad[_qp] * _dir[_qp] * _phi[_j][_qp] * _test[_i][_qp];
61  }
62  else if (jvar == _arhoE_var_number)
63  {
64  return -_dp_darhoEA[_qp] * _area_grad[_qp] * _dir[_qp] * _phi[_j][_qp] * _test[_i][_qp];
65  }
66  else
67  return 0;
68 }
static InputParameters validParams()
Computes the area gradient term in the momentum equation.
const MaterialProperty< Real > & _pressure
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
void addRequiredParam(const std::string &name, const std::string &doc_string)
OneD3EqnMomentumAreaGradient(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _dp_darhouA
registerMooseObject("ThermalHydraulicsApp", OneD3EqnMomentumAreaGradient)
const MaterialProperty< Real > & _dp_darhoA
void addClassDescription(const std::string &doc_string)
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
const MaterialProperty< Real > & _dp_darhoEA