www.mooseframework.org
NSStagnationPressureBC.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 inclues
10 #include "NS.h"
11 
12 // FluidProperties includes
14 
15 // Full specialization of the validParams function for this object
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<NSStagnationBC>();
21  params.addClassDescription("This Dirichlet condition imposes the condition p_0 = p_0_desired.");
22  params.addRequiredCoupledVar(NS::pressure, "pressure");
23  params.addRequiredParam<Real>("desired_stagnation_pressure", "");
24  return params;
25 }
26 
27 NSStagnationPressureBC::NSStagnationPressureBC(const InputParameters & parameters)
28  : NSStagnationBC(parameters),
29  _pressure(coupledValue(NS::pressure)),
30  _desired_stagnation_pressure(getParam<Real>("desired_stagnation_pressure"))
31 {
32 }
33 
34 Real
36 {
37  // p_0 = p*(1 + 0.5*(gam-1)*M^2)^(gam/(gam-1))
38  const Real computed_stagnation_pressure =
39  _pressure[_qp] * std::pow(1. + 0.5 * (_fp.gamma() - 1.) * _mach[_qp] * _mach[_qp],
40  _fp.gamma() / (_fp.gamma() - 1.));
41 
42  // Return the difference between the current solution's stagnation pressure
43  // and the desired. The Dirichlet condition asserts that these should be equal.
44  return computed_stagnation_pressure - _desired_stagnation_pressure;
45 }
Definition: NS.h:13
InputParameters validParams< NSStagnationBC >()
const VariableValue & _mach
InputParameters validParams< NSStagnationPressureBC >()
This is the base class for the "imposed stagnation" value boundary conditions.
const VariableValue & _pressure
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real gamma(Real v=0., Real u=0.) const override
Compute the ratio of specific heats.
const std::string pressure
Definition: NS.h:24
NSStagnationPressureBC(const InputParameters &parameters)
const IdealGasFluidProperties & _fp