www.mooseframework.org
NSInflowThermalBC.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 "NSInflowThermalBC.h"
9 
10 // FluidProperties includes
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<NodalBC>();
18 
19  params.addClassDescription("This class is used on a boundary where the incoming flow values "
20  "(rho, u, v, T) are all completely specified.");
21  // Boundary condition values, all required except for velocity which defaults to zero.
22  params.addRequiredParam<Real>("specified_rho", "Density of incoming flow");
23  params.addRequiredParam<Real>("specified_temperature", "Temperature of incoming flow");
24  params.addParam<Real>("specified_velocity_magnitude", 0., "Velocity magnitude of incoming flow");
25  params.addRequiredParam<UserObjectName>("fluid_properties",
26  "The name of the user object for fluid properties");
27 
28  return params;
29 }
30 
31 NSInflowThermalBC::NSInflowThermalBC(const InputParameters & parameters)
32  : NodalBC(parameters),
33  _specified_rho(getParam<Real>("specified_rho")),
34  _specified_temperature(getParam<Real>("specified_temperature")),
35  _specified_velocity_magnitude(getParam<Real>("specified_velocity_magnitude")),
36  _fp(getUserObject<IdealGasFluidProperties>("fluid_properties"))
37 {
38 }
39 
40 Real
42 {
43  // For the total energy, the essential BC is:
44  // rho*E = rho*(c_v*T + 0.5*|u|^2)
45  //
46  // or, in residual form, (In general, this BC is coupled to the velocity variables.)
47  // rho*E - rho*(c_v*T + 0.5*|u|^2) = 0
48  //
49  // ***at a no-slip wall*** this further reduces to (no coupling to velocity variables):
50  // rho*E - rho*cv*T = 0
51  return _u[_qp] -
54 }
const Real _specified_rho
InputParameters validParams< NSInflowThermalBC >()
const IdealGasFluidProperties & _fp
NSInflowThermalBC(const InputParameters &parameters)
virtual Real cv(Real v=0., Real u=0.) const override
Isochoric specific heat.
const Real _specified_velocity_magnitude
const Real _specified_temperature
Ideal gas fluid properties.
virtual Real computeQpResidual()