https://mooseframework.inl.gov
OneD3EqnMomentumGravity.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", OneD3EqnMomentumGravity);
13 
16 {
18  params.addRequiredCoupledVar("A", "Cross-sectional area");
19  params.addRequiredCoupledVar("arhoA", "alpha*rho*A");
20  params.addRequiredParam<MaterialPropertyName>(
21  "direction", "The direction of the flow channel material property");
22  params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
23  params.addRequiredParam<RealVectorValue>("gravity_vector", "Gravitational acceleration vector");
24  params.addClassDescription("Computes gravity term for the momentum equation for 1-phase flow");
25  return params;
26 }
27 
30  _A(coupledValue("A")),
31  _rho(getMaterialProperty<Real>("rho")),
32  _drho_darhoA(getMaterialPropertyDerivativeTHM<Real>("rho", "arhoA")),
33  _dir(getMaterialProperty<RealVectorValue>("direction")),
34  _gravity_vector(getParam<RealVectorValue>("gravity_vector")),
35  _arhoA_var_number(coupled("arhoA"))
36 {
37 }
38 
39 Real
41 {
42  return -_rho[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _test[_i][_qp];
43 }
44 
45 Real
47 {
48  return 0;
49 }
50 
51 Real
53 {
54  if (jvar == _arhoA_var_number)
55  {
56  return -_drho_darhoA[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _phi[_j][_qp] *
57  _test[_i][_qp];
58  }
59  else
60  return 0;
61 }
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", OneD3EqnMomentumGravity)
const MaterialProperty< Real > & _drho_darhoA
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
OneD3EqnMomentumGravity(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
const RealVectorValue & _gravity_vector
Gravitational acceleration vector.
const MaterialProperty< Real > & _rho
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Computes gravity term for the momentum equation for 1-phase flow.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const unsigned int _arhoA_var_number
virtual Real computeQpOffDiagJacobian(unsigned int jvar)