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