www.mooseframework.org
NSStagnationTemperatureBC.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 // Navier-Stokes includes
10 #include "NS.h"
11 
12 // FluidProperties includes
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<NSStagnationBC>();
20  params.addClassDescription("This Dirichlet condition imposes the condition T_0 = T_0_desired.");
21  params.addRequiredCoupledVar(NS::temperature, "temperature");
22  params.addRequiredParam<Real>("desired_stagnation_temperature", "");
23  return params;
24 }
25 
26 NSStagnationTemperatureBC::NSStagnationTemperatureBC(const InputParameters & parameters)
27  : NSStagnationBC(parameters),
28  _temperature(coupledValue(NS::temperature)),
29  _desired_stagnation_temperature(getParam<Real>("desired_stagnation_temperature"))
30 {
31 }
32 
33 Real
35 {
36  // T_0 = T*(1 + 0.5*(gam-1)*M^2)
37  Real computed_stagnation_temperature =
38  _temperature[_qp] * (1. + 0.5 * (_fp.gamma() - 1.) * _mach[_qp] * _mach[_qp]);
39 
40  // Return the difference between the current solution's stagnation temperature
41  // and the desired. The Dirichlet condition asserts that these should be equal.
42  return computed_stagnation_temperature - _desired_stagnation_temperature;
43 }
Definition: NS.h:13
InputParameters validParams< NSStagnationBC >()
const std::string temperature
Definition: NS.h:25
const VariableValue & _mach
This is the base class for the "imposed stagnation" value boundary conditions.
virtual Real gamma(Real v=0., Real u=0.) const override
Compute the ratio of specific heats.
NSStagnationTemperatureBC(const InputParameters &parameters)
const VariableValue & _temperature
const IdealGasFluidProperties & _fp
InputParameters validParams< NSStagnationTemperatureBC >()