https://mooseframework.inl.gov
OneD3EqnEnergyGravity.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 
10 #include "OneD3EqnEnergyGravity.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", OneD3EqnEnergyGravity);
13 
16 {
18  params.addRequiredCoupledVar("A", "Cross-sectional area");
19  params.addRequiredCoupledVar("arhoA", "alpha*rho*A");
20  params.addRequiredCoupledVar("arhouA", "alpha*rho*u*A");
21  params.addRequiredParam<MaterialPropertyName>(
22  "direction", "The direction of the flow channel material property");
23  params.addRequiredParam<MaterialPropertyName>("rho", "Density property");
24  params.addRequiredParam<MaterialPropertyName>("vel", "Velocity property");
25  params.addRequiredParam<RealVectorValue>("gravity_vector", "Gravitational acceleration vector");
26  params.addClassDescription("Computes a gravity term for the energy equation in 1-phase flow");
27  return params;
28 }
29 
32  _A(coupledValue("A")),
33  _rho(getMaterialProperty<Real>("rho")),
34  _drho_darhoA(getMaterialPropertyDerivativeTHM<Real>("rho", "arhoA")),
35  _vel(getMaterialProperty<Real>("vel")),
36  _dvel_darhoA(getMaterialPropertyDerivativeTHM<Real>("vel", "arhoA")),
37  _dvel_darhouA(getMaterialPropertyDerivativeTHM<Real>("vel", "arhouA")),
38  _dir(getMaterialProperty<RealVectorValue>("direction")),
39  _gravity_vector(getParam<RealVectorValue>("gravity_vector")),
40  _arhoA_var_number(coupled("arhoA")),
41  _arhouA_var_number(coupled("arhouA"))
42 {
43 }
44 
45 Real
47 {
48  return -_rho[_qp] * _vel[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _test[_i][_qp];
49 }
50 
51 Real
53 {
54  return 0;
55 }
56 
57 Real
59 {
60  if (jvar == _arhoA_var_number)
61  {
62  return -(_drho_darhoA[_qp] * _vel[_qp] + _rho[_qp] * _dvel_darhoA[_qp]) * _A[_qp] *
63  _gravity_vector * _dir[_qp] * _phi[_j][_qp] * _test[_i][_qp];
64  }
65  else if (jvar == _arhouA_var_number)
66  {
67  return -_rho[_qp] * _dvel_darhouA[_qp] * _A[_qp] * _gravity_vector * _dir[_qp] * _phi[_j][_qp] *
68  _test[_i][_qp];
69  }
70  else
71  return 0;
72 }
const MaterialProperty< RealVectorValue > & _dir
The direction of the flow channel.
static InputParameters validParams()
const VariableValue & _A
const MaterialProperty< Real > & _dvel_darhouA
Computes gravity term for the energy equation in 1-phase flow.
const RealVectorValue & _gravity_vector
Gravitational acceleration vector.
OneD3EqnEnergyGravity(const InputParameters &parameters)
virtual Real computeQpJacobian()
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
virtual Real computeQpResidual()
const MaterialProperty< Real > & _drho_darhoA
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const MaterialProperty< Real > & _rho
const MaterialProperty< Real > & _vel
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("ThermalHydraulicsApp", OneD3EqnEnergyGravity)
const MaterialProperty< Real > & _dvel_darhoA
const unsigned int _arhoA_var_number
void addClassDescription(const std::string &doc_string)
const unsigned int _arhouA_var_number
static InputParameters validParams()