https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADFluidProperties3EqnMaterial.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
12#include "Numerics.h"
13
15
18{
20
21 params.addRequiredCoupledVar("A", "Cross-sectional area");
22 params.addRequiredCoupledVar("rhoA", "Conserved density");
23 params.addRequiredCoupledVar("rhouA", "Conserved momentum");
24 params.addRequiredCoupledVar("rhoEA", "Conserved total energy");
25
26 params.addRequiredParam<UserObjectName>("fp", "The name of the user object for fluid properties");
28 "Defines material properties from fluid properties to serve in the 3-equation model");
29
30 return params;
31}
32
34 : Material(parameters),
35 _area(adCoupledValue("A")),
36 _rhoA(adCoupledValue("rhoA")),
37 _rhouA(adCoupledValue("rhouA")),
38 _rhoEA(adCoupledValue("rhoEA")),
39
40 _rho(declareADProperty<Real>("rho")),
41
42 _v(declareADProperty<Real>("v")),
43
44 _vel(declareADProperty<Real>("vel")),
45
46 _e(declareADProperty<Real>("e")),
47
48 _p(declareADProperty<Real>("p")),
49
50 _T(declareADProperty<Real>("T")),
51
52 _h(declareADProperty<Real>("h")),
53
54 _H(declareADProperty<Real>("H")),
55
56 _c(declareADProperty<Real>("c")),
57
58 _cp(declareADProperty<Real>("cp")),
59
60 _cv(declareADProperty<Real>("cv")),
61
62 _k(declareADProperty<Real>("k")),
63
64 _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
65{
66}
67
68void
70{
71 _rho[_qp] = _rhoA[_qp] / _area[_qp];
72
73 _v[_qp] = 1.0 / _rho[_qp];
74
75 _vel[_qp] = _rhouA[_qp] / _rhoA[_qp];
76
77 _e[_qp] = (_rhoEA[_qp] - 0.5 * _rhouA[_qp] * _rhouA[_qp] / _rhoA[_qp]) / _rhoA[_qp];
78
79 _p[_qp] = _fp.p_from_v_e(_v[_qp], _e[_qp]);
80
81 _T[_qp] = _fp.T_from_v_e(_v[_qp], _e[_qp]);
82
83 _h[_qp] = _e[_qp] + _p[_qp] / _rho[_qp];
84
85 _H[_qp] = _h[_qp] + 0.5 * _vel[_qp] * _vel[_qp];
86
87 _c[_qp] = _fp.c_from_v_e(_v[_qp], _e[_qp]);
88 _cp[_qp] = _fp.cp_from_v_e(_v[_qp], _e[_qp]);
89 _cv[_qp] = _fp.cv_from_v_e(_v[_qp], _e[_qp]);
90 _k[_qp] = _fp.k_from_v_e(_v[_qp], _e[_qp]);
91}
registerMooseObject("ThermalHydraulicsApp", ADFluidProperties3EqnMaterial)
Computes velocity and thermodynamic variables from solution variables for 1-phase flow.
ADMaterialProperty< Real > & _T
Temperature.
ADMaterialProperty< Real > & _H
Specific total (stagnation) enthalpy.
ADMaterialProperty< Real > & _h
Specific enthalpy.
ADFluidProperties3EqnMaterial(const InputParameters &parameters)
ADMaterialProperty< Real > & _e
Specific internal energy.
ADMaterialProperty< Real > & _v
Specific volume.
ADMaterialProperty< Real > & _cv
Constant-volume specific heat.
ADMaterialProperty< Real > & _k
Thermal conductivity.
ADMaterialProperty< Real > & _vel
Velocity.
const SinglePhaseFluidProperties & _fp
Fluid properties.
ADMaterialProperty< Real > & _cp
Constant-pressure specific heat.
const ADVariableValue & _area
Cross-sectional area.
ADMaterialProperty< Real > & _p
Pressure.
ADMaterialProperty< Real > & _c
Sound speed.
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
static InputParameters validParams()
Common class for single phase fluid properties.