www.mooseframework.org
NSStagnationPressureBC.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 // Navier-Stokes inclues
11 #include "NSStagnationPressureBC.h"
12 #include "NS.h"
13 
14 // FluidProperties includes
16 
17 // Full specialization of the validParams function for this object
19 
22 {
24  params.addClassDescription("This Dirichlet condition imposes the condition p_0 = p_0_desired.");
25  params.addRequiredCoupledVar(NS::pressure, "pressure");
26  params.addRequiredParam<Real>("desired_stagnation_pressure", "");
27  return params;
28 }
29 
31  : NSStagnationBC(parameters),
32  _pressure(coupledValue(NS::pressure)),
33  _desired_stagnation_pressure(getParam<Real>("desired_stagnation_pressure"))
34 {
35 }
36 
37 Real
39 {
40  // p_0 = p*(1 + 0.5*(gam-1)*M^2)^(gam/(gam-1))
41  const Real computed_stagnation_pressure =
42  _pressure[_qp] * std::pow(1. + 0.5 * (_fp.gamma() - 1.) * _mach[_qp] * _mach[_qp],
43  _fp.gamma() / (_fp.gamma() - 1.));
44 
45  // Return the difference between the current solution's stagnation pressure
46  // and the desired. The Dirichlet condition asserts that these should be equal.
47  return computed_stagnation_pressure - _desired_stagnation_pressure;
48 }
registerMooseObject("NavierStokesApp", NSStagnationPressureBC)
const unsigned int _qp
const VariableValue & _mach
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
This Dirichlet condition imposes the condition p_0 = p_0_desired, where p_0 is the stagnation pressur...
This is the base class for the "imposed stagnation" value boundary conditions.
static InputParameters validParams()
const VariableValue & _pressure
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Definition: NS.h:56
NSStagnationPressureBC(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
const IdealGasFluidProperties & _fp
MooseUnits pow(const MooseUnits &, int)