https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RhoEAFromPressureTemperatureFunctionVelocityIC.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 "Function.h"
13
15
18{
20 params.addRequiredParam<UserObjectName>("fp", "The name of fluid properties object to use.");
21 params.addRequiredCoupledVar("p", "The pressure");
22 params.addRequiredCoupledVar("T", "The temperature");
23 params.addRequiredParam<FunctionName>("vel", "The velocity");
24 params.addRequiredCoupledVar("A", "Cross-sectional area");
25 params.addClassDescription("Set the initial condition for rho*E*A from pressure and temperature "
26 "variables and a velocity scalar function");
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(getFunction("vel")),
37 _area(coupledValue("A"))
38{
39}
40
41Real
43{
44 const Real vel = _vel.value(_t, p);
45 const Real rho = _fp.rho_from_p_T(_p[_qp], _T[_qp]);
46 const Real e = _fp.e_from_p_rho(_p[_qp], rho);
47 return rho * (e + 0.5 * vel * vel) * _area[_qp];
48}
const Real p
const double rho
registerMooseObject("ThermalHydraulicsApp", RhoEAFromPressureTemperatureFunctionVelocityIC)
virtual Real value(Real t, const Point &p) const
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)
This IC sets total energy density from provided pressure, temperature and user-defined veloctiy funct...
Common class for single phase fluid properties.