https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NSStagnationPressureBC.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
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
37Real
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)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
This is the base class for the "imposed stagnation" value boundary conditions.
static InputParameters validParams()
const IdealGasFluidProperties & _fp
const VariableValue & _mach
This Dirichlet condition imposes the condition p_0 = p_0_desired, where p_0 is the stagnation pressur...
const VariableValue & _pressure
NSStagnationPressureBC(const InputParameters &parameters)
static InputParameters validParams()
const unsigned int _qp
static const std::string pressure
Definition NS.h:57