https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NSMomentumViscousFlux.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
11
13
16{
19 "Derived instance of the NSViscousFluxBase class for the momentum equations.");
20 params.addRequiredParam<unsigned int>("component", "");
21 return params;
22}
23
25 : NSKernel(parameters), _component(getParam<unsigned int>("component")), _vst_derivs(*this)
26{
27}
28
29Real
31{
32 // Yay for less typing!
33 const RealTensorValue & vst = _viscous_stress_tensor[_qp];
34
35 // _component'th column of vst...
36 RealVectorValue vec(vst(0, _component), vst(1, _component), vst(2, _component));
37
38 // ... dotted with grad(phi), note: sign is positive as this term was -div(tau) on the lhs
39 return vec * _grad_test[_i][_qp];
40}
41
42Real
44{
45 Real value = 0.0;
46
47 // Set variable names as in the notes
48 const unsigned k = _component;
49 const unsigned m = _component + 1; // _component = 0,1,2 -> m = 1,2,3 global variable number
50
51 // Use external templated friend class for common viscous stress
52 // tensor derivative computations.
53 for (unsigned int ell = 0; ell < LIBMESH_DIM; ++ell)
54 value += _vst_derivs.dtau(k, ell, m) * _grad_test[_i][_qp](ell);
55
56 return value;
57}
58
59Real
61{
62 if (isNSVariable(jvar))
63 {
64 Real value = 0.0;
65
66 // Set variable names as in the notes
67 const unsigned int k = _component;
68
69 // Map jvar into the variable m for our problem, regardless of
70 // how Moose has numbered things.
71 unsigned int m = mapVarNumber(jvar);
72
73 for (unsigned ell = 0; ell < LIBMESH_DIM; ++ell)
74 value += _vst_derivs.dtau(k, ell, m) * _grad_test[_i][_qp](ell);
75
76 return value;
77 }
78 else
79 return 0.0;
80}
registerMooseObject("NavierStokesApp", NSMomentumViscousFlux)
void ErrorVector unsigned int
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _i
const VariableTestGradient & _grad_test
virtual const OutputTools< Real >::VariableValue & value()
This class couples together all the variables for the compressible Navier-Stokes equations to allow t...
Definition NSKernel.h:26
unsigned mapVarNumber(unsigned var)
Definition NSKernel.C:89
bool isNSVariable(unsigned var)
Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compres...
Definition NSKernel.C:79
static InputParameters validParams()
Definition NSKernel.C:23
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
Definition NSKernel.h:60
Derived instance of the NSViscousFluxBase class for the momentum equations.
const unsigned int _component
NSViscStressTensorDerivs< NSMomentumViscousFlux > _vst_derivs
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
NSMomentumViscousFlux(const InputParameters &parameters)
static InputParameters validParams()
Real dtau(unsigned k, unsigned ell, unsigned m)
The primary interface for computing viscous stress tensor derivatives.