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