https://mooseframework.inl.gov
CNSFVMomentumHLLC.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 #include "CNSFVMomentumHLLC.h"
11 
12 // Full specialization of the validParams function for this object
13 registerADMooseObject("NavierStokesApp", CNSFVMomentumHLLC);
14 
17 {
19  MooseEnum momentum_component("x=0 y=1 z=2");
21  "momentum_component",
22  momentum_component,
23  "The component of the momentum equation that this kernel applies to.");
24  params.addClassDescription(
25  "Implements the momentum flux portion of the free-flow HLLC discretization.");
26  return params;
27 }
28 
30  : CNSFVHLLC(params), _index(getParam<MooseEnum>("momentum_component"))
31 {
32 }
33 
34 ADReal
36 {
39 }
40 
41 ADReal
43 {
46 }
47 
48 ADReal
50 {
51  auto vel_nonnormal = _vel_elem[_qp] - _normal_speed_elem * _normal;
52  return _normal(_index) * _SM + vel_nonnormal(_index);
53 
54  // For some reason, the below expression doesn't give as good results as the
55  // above one.
56  // return _normal(_index) * (_SM - _normal_speed_elem) + _vel_elem[_qp](_index);
57 }
58 
59 ADReal
61 {
62  auto vel_nonnormal = _vel_neighbor[_qp] - _normal_speed_neighbor * _normal;
63  return _normal(_index) * _SM + vel_nonnormal(_index);
64 
65  // For some reason, the below expression doesn't give as good results as the
66  // above one.
67  // return _normal(_index) * (_SM - _normal_speed_neighbor) + _vel_elem[_qp](_index);
68 }
69 
70 ADReal
72 {
73  return _rho_elem[_qp] * _vel_elem[_qp](_index);
74 }
75 
76 ADReal
78 {
80 }
unsigned int _index
index x|y|z
registerADMooseObject("NavierStokesApp", CNSFVMomentumHLLC)
static InputParameters validParams()
ADReal _normal_speed_neighbor
Definition: CNSFVHLLCBase.h:71
virtual ADReal fluxElem() override
flux functions on elem & neighbor, i.e. standard left/right values of F
CNSFVMomentumHLLC(const InputParameters &params)
RealVectorValue _normal
static InputParameters validParams()
Definition: CNSFVHLLC.C:13
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual ADReal conservedVariableNeighbor() override
const ADMaterialProperty< Real > & _rho_neighbor
Definition: CNSFVHLLCBase.h:97
const unsigned int _qp
Base class for HLLC inter-cell flux kernels.
Definition: CNSFVHLLC.h:19
virtual ADReal hllcElem() override
HLLC modifications to flux for elem & neighbor, see Toro.
const ADMaterialProperty< RealVectorValue > & _vel_neighbor
Definition: CNSFVHLLCBase.h:87
virtual ADReal fluxNeighbor() override
virtual ADReal hllcNeighbor() override
Implements the advective flux and the pressure terms in the conservation of momentum equation using a...
ADReal _normal_speed_elem
speeds normal to the interface
Definition: CNSFVHLLCBase.h:70
const ADMaterialProperty< Real > & _pressure_neighbor
void addClassDescription(const std::string &doc_string)
const ADMaterialProperty< Real > & _rho_elem
densities left == elem, right == neighbor
Definition: CNSFVHLLCBase.h:96
const ADMaterialProperty< Real > & _pressure_elem
pressures left == elem, right == neighbor
virtual ADReal conservedVariableElem() override
const ADMaterialProperty< RealVectorValue > & _vel_elem
velocities left == elem, right == neighbor
Definition: CNSFVHLLCBase.h:86