https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RhoEAFromPressureTemperatureVelocityIC.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
14
17{
19 params.addRequiredParam<UserObjectName>("fp", "The name of fluid properties object to use.");
20 params.addRequiredCoupledVar("p", "The pressure");
21 params.addRequiredCoupledVar("T", "The temperature");
22 params.addRequiredCoupledVar("vel", "The velocity");
23 params.addRequiredCoupledVar("A", "Cross-sectional area");
25 "Set the initial condition for rho*E*A from pressure, temperature and a scalar"
26 "field velocity variable");
27 return params;
28}
29
31 const InputParameters & parameters)
32 : InitialCondition(parameters),
33 _fp(getUserObject<SinglePhaseFluidProperties>("fp")),
34 _p(coupledValue("p")),
35 _T(coupledValue("T")),
36 _vel(coupledValue("vel")),
37 _area(coupledValue("A"))
38{
39}
40
41Real
43{
44 const Real rho = _fp.rho_from_p_T(_p[_qp], _T[_qp]);
45 const Real e = _fp.e_from_p_rho(_p[_qp], rho);
46 return rho * (e + 0.5 * _vel[_qp] * _vel[_qp]) * _area[_qp];
47}
const double rho
registerMooseObject("ThermalHydraulicsApp", RhoEAFromPressureTemperatureVelocityIC)
static InputParameters validParams()
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)
The RhoEAFromPressureTemperatureVelocityIC returns:
const VariableValue & _area
Cross-sectional area.
RhoEAFromPressureTemperatureVelocityIC(const InputParameters &parameters)
Common class for single phase fluid properties.