https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CNSFVHLLCMomentumBC.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 "CNSFVHLLCMomentumBC.h"
11
14
15template <typename T>
16void
18{
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}
25
26template <typename T>
29{
30 InputParameters params = T::validParams();
31 addCommonParams(params);
32 params.addClassDescription("Implements the momentum boundary flux portion of the free-flow HLLC "
33 "discretization given specified mass fluxes and fluid temperature");
34 return params;
35}
36
37template <>
40{
42 addCommonParams(params);
43 params.addClassDescription("Implements the momentum boundary flux portion of the free-flow HLLC "
44 "discretization given specified pressure");
45 return params;
46}
47
48template <typename T>
50 : T(params), _index(this->template getParam<MooseEnum>("momentum_component"))
51{
52}
53
54template <typename T>
57{
58 return this->_normal_speed_elem * this->_rho_elem[this->_qp] *
59 this->_vel_elem[this->_qp](_index) +
60 this->_normal(_index) * this->_pressure_elem[this->_qp];
61}
62
63template <typename T>
66{
67 return this->_normal_speed_boundary * this->_rho_boundary * this->_vel_boundary(_index) +
68 this->_normal(_index) * this->_pressure_boundary;
69}
70
71template <typename T>
74{
75 auto vel_nonnormal = this->_vel_elem[this->_qp] - this->_normal_speed_elem * this->_normal;
76 return this->_normal(_index) * this->_SM + vel_nonnormal(_index);
77
78 // For some reason, the below expression doesn't give as good results as the
79 // above one.
80 // return this->_normal(_index) * (_SM - this->_normal_speed_elem) +
81 // this->_vel_elem[this->_qp](_index);
82}
83
84template <typename T>
87{
88 auto vel_nonnormal = this->_vel_boundary - this->_normal_speed_boundary * this->_normal;
89 return this->_normal(_index) * this->_SM + vel_nonnormal(_index);
90
91 // For some reason, the below expression doesn't give as good results as the
92 // above one.
93 // return this->_normal(_index) * (_SM - this->_normal_speed_boundary) +
94 // this->_vel_elem[this->_qp](_index);
95}
96
97template <typename T>
100{
101 return this->_rho_elem[this->_qp] * this->_vel_elem[this->_qp](_index);
102}
103
104template <typename T>
105ADReal
107{
108 return this->_rho_boundary * this->_vel_boundary(_index);
109}
110
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", CNSFVHLLCSpecifiedMassFluxAndTemperatureMomentumBC)
const double T
Template class for implementing the advective flux plus pressure terms in the conservation of momentu...
virtual ADReal fluxElem() override
flux functions on elem & boundary, i.e. standard left/right values of F
static void addCommonParams(InputParameters &params)
virtual ADReal hllcElem() override
HLLC modifications to flux for elem & boundary, see Toro.
virtual ADReal hllcBoundary() override
virtual ADReal fluxBoundary() override
static InputParameters validParams()
virtual ADReal conservedVariableElem() override
virtual ADReal conservedVariableBoundary() override
CNSFVHLLCMomentumBC(const InputParameters &params)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)