NSEnergyInviscidBC.h
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 #ifndef NSENERGYINVISCIDBC_H
8 #define NSENERGYINVISCIDBC_H
9
10 #include "NSIntegratedBC.h"
11 #include "NSPressureDerivs.h"
12
13 // Forward Declarations
14 class NSEnergyInviscidBC;
15
16 template <>
17 InputParameters validParams<NSEnergyInviscidBC>();
18
35 {
36 public:
37  NSEnergyInviscidBC(const InputParameters & parameters);
38
39 protected:
40  // Aux vars
41  const VariableValue & _temperature;
42
43  // An object for computing pressure derivatives.
44  // Constructed via a reference to ourself
46
47  // Declare ourselves friend to the helper class.
48  template <class U>
49  friend class NSPressureDerivs;
50
51  // Given the two inputs: pressure and u.n, compute the residual
52  // at this quadrature point. Note that the derived classes are
53  // responsible for determining whether the inputs are specified
54  // values or come from the current solution.
55  Real qpResidualHelper(Real pressure, Real un);
56
57  // This was experimental code and did not really work out, do not use!
58  // New version, allows input of three variables to provide both:
59  // .) specified (rho, u) boundary residuals
60  // .) specified pressure boundary residuals
61  //
62  // The actual term implemented here is:
63  // rho*H*(u.n) = (rho*E + p)(u.n) = (rho*(cv*T + 0.5*|u|^2) + p)(u.n)
64  Real qpResidualHelper(Real rho, RealVectorValue u, Real pressure);
65
66  // The Jacobian of this term is given by the product rule, i.e.
67  //
68  // d/dX (U4 + p)(u.n) = (U4+p) * d(u.n)/dX + d(U4+p)/dX * (u.n)
69  // = (U4+p) * d(u.n)/dX (A)
70  // + d(U4)/dX * (u.n) (B)
71  // + d(p)/dX * (u.n) (C)
72  // For some arbitrary variable X. We consider 2 cases:
73  // 1.) Specified pressure boundary: Term C is zero.
74  // 2.) Specified u.n boundary: Term A is zero.
75  //
76  // This class implements three jacobian functions corresponding to
77  // the terms above. It is up to the derived classes to determine
78  // which to call, and which values (specified or variable) must be
79  // passed in.
80
81  // (U4+p) * d(u.n)/dX
82  Real qpJacobianTermA(unsigned var_number, Real pressure);
83
84  // d(U4)/dX * (u.n)
85  Real qpJacobianTermB(unsigned var_number, Real un);
86
87  // d(p)/dX * (u.n)
88  Real qpJacobianTermC(unsigned var_number, Real un);
89
90  // The residual term with rho*E expanded has 3 parts:
91  // rho*cv*T*(u.n) + rho*0.5*|u|^2*(u.n) + p*(u.n)
92  // Each of these terms, when differentiated, leads to
93  // multiple terms due to the product rule:
94  // (1) d/dX (rho*cv*T*(u.n)) = cv * (d(rho)/dX*T*(u.n) + rho*d(T)/dX*(u.n) + rho*T*d(u.n)/dX)
95  // (2) d/dX (rho*0.5*|u|^2*(u.n)) = 0.5 * (d(rho)/dX*|u|^2*(u.n) + rho*d(|u|^2)/dX*(u.n) +
96  // rho*|u|^2*d(u.n)/dX)
97  // (3) d/dX (p*(u.n)) = d(p)/dx*(u.n) + p*d(u.n)/dX
98 };
99
100 #endif // NSENERGYINVISCIDBC_H
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
NSEnergyInviscidBC(const InputParameters &parameters)
Real qpJacobianTermC(unsigned var_number, Real un)
NSPressureDerivs< NSEnergyInviscidBC > _pressure_derivs
Real qpResidualHelper(Real pressure, Real un)
This class corresponds to the inviscid part of the "natural" boundary condition for the energy equati...
InputParameters validParams< NSEnergyInviscidBC >()
Real qpJacobianTermA(unsigned var_number, Real pressure)
const std::string pressure
Definition: NS.h:24
Real qpJacobianTermB(unsigned var_number, Real un)
const VariableValue & _temperature