www.mooseframework.org
CNSFVPressureIC.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "CNSFVPressureIC.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<InitialCondition>();
15 
16  params.addClassDescription(
17  "An initial condition object for computing pressure from conserved variables.");
18 
19  params.addRequiredCoupledVar("rho", "Conserved variable: rho");
20 
21  params.addRequiredCoupledVar("rhou", "Conserved variable: rhou");
22 
23  params.addCoupledVar("rhov", "Conserved variable: rhov");
24 
25  params.addCoupledVar("rhow", "Conserved variable: rhow");
26 
27  params.addRequiredCoupledVar("rhoe", "Conserved variable: rhoe");
28 
29  params.addRequiredParam<UserObjectName>("fluid_properties",
30  "Name for fluid properties user object");
31  return params;
32 }
33 
34 CNSFVPressureIC::CNSFVPressureIC(const InputParameters & parameters)
35  : InitialCondition(parameters),
36  _rho(coupledValue("rho")),
37  _rhou(coupledValue("rhou")),
38  _rhov(isCoupled("rhov") ? coupledValue("rhov") : _zero),
39  _rhow(isCoupled("rhow") ? coupledValue("rhow") : _zero),
40  _rhoe(coupledValue("rhoe")),
41  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
42 {
43 }
44 
46 
47 Real
48 CNSFVPressureIC::value(const Point & /*p*/)
49 {
50  Real v = 1. / _rho[_qp];
51 
52  Real e =
53  _rhoe[_qp] * v -
54  0.5 * v * v * (_rhou[_qp] * _rhou[_qp] + _rhov[_qp] * _rhov[_qp] + _rhow[_qp] * _rhow[_qp]);
55 
56  return _fp.pressure(v, e);
57 }
virtual ~CNSFVPressureIC()
const SinglePhaseFluidProperties & _fp
const VariableValue & _rhov
const VariableValue & _rhoe
InputParameters validParams< CNSFVPressureIC >()
Common class for single phase fluid properties.
const VariableValue & _rhow
virtual Real value(const Point &p)
const VariableValue & _rho
CNSFVPressureIC(const InputParameters &parameters)
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.
const VariableValue & _rhou