https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NSEnergyInviscidBC.h
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#pragma once
11
12#include "NSIntegratedBC.h"
13#include "NSPressureDerivs.h"
14
15// Forward Declarations
16
33{
34public:
36
38
39protected:
40 // Aux vars
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};
const double rho
const InputParameters & parameters() const
This class corresponds to the inviscid part of the "natural" boundary condition for the energy equati...
NSPressureDerivs< NSEnergyInviscidBC > _pressure_derivs
const VariableValue & _temperature
static InputParameters validParams()
Real qpResidualHelper(Real pressure, Real un)
Real qpJacobianTermA(unsigned var_number, Real pressure)
Real qpJacobianTermC(unsigned var_number, Real un)
Real qpJacobianTermB(unsigned var_number, Real un)
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Class outside the Moose hierarchy that contains common functionality for computing derivatives of the...
VariableValueTempl< false > VariableValue