https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LinearFVPressureCorrectionDiffusionJump.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
12
14
17{
19 params.addClassDescription("Pressure correction diffusion kernel that adds a baffle jump "
20 "contribution on internal faces.");
21 params.addRequiredParam<UserObjectName>(
22 "rhie_chow_user_object", "The rhie-chow user-object which provides baffle jump information.");
23 // Baffle faces build their half-cell mobilities from the Rhie-Chow momentum inverse, so
24 // non-baffle faces must use the same coefficient.
25 params.set<MooseFunctorName>("diffusion_tensor") = "Ainv";
26 params.suppressParameter<MooseFunctorName>("diffusion_tensor");
27 return params;
28}
29
36
37void
43
46{
49
51 "Jump-interface data requires an internal face.");
52
53 const auto & elem_info = *_current_face_info->elemInfo();
54 const auto & neighbor_info = *_current_face_info->neighborInfo();
56 _gradient_field.gradient(elem_info),
57 _gradient_field.gradient(neighbor_info),
59
62}
63
64Real
66{
67 const auto & face_operator = jumpInterfaceData();
68 return face_operator.is_baffle ? face_operator.transmissibility : computeFluxMatrixContribution();
69}
70
71Real
73{
74 const auto & face_operator = jumpInterfaceData();
75 return face_operator.is_baffle
76 ? face_operator.correction + face_operator.transmissibility * face_operator.elem_jump
78}
79
80Real
82{
83 // LinearFVFluxKernel puts +T_f in A(P,P) and -T_f in A(N,P), where those entries multiply the
84 // current element pressure p_P.
86}
87
88Real
90{
91 // Returning -T_f puts -T_f in A(P,N) and +T_f in A(N,N), where those entries multiply the
92 // current neighbor pressure p_N.
94}
95
96Real
98{
99 // J_P is oriented from the opposite side toward P: J_P = p_P - p_N. Let R_f denote the
100 // explicit diffusion correction. The two local rows receive
101 //
102 // b_P = R_f + T_f J_P,
103 // b_N = -R_f + T_f J_N = -R_f - T_f J_P.
104 //
105 // Combined with the local matrix documented above, the element row is
106 //
107 // T_f (p_P - p_N) = R_f + T_f J_P,
108 //
109 // or T_f [(p_P - p_N) - J_P] = R_f. The neighbor equation is its negative, so the modeled jump
110 // changes only the right hand side and the face contribution remains conservative.
112}
113
114Real
116{
117 // The neighbor receives the negative of the complete element-side operator, preserving
118 // conservation across the internal face.
120}
registerMooseObject("NavierStokesApp", LinearFVPressureCorrectionDiffusionJump)
const Elem * neighborPtr() const
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
void suppressParameter(const std::string &name)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const LinearFVGradientReader & _gradient_field
virtual void setupFaceData(const FaceInfo *face_info)
const FaceInfo * _current_face_info
RealVectorValue gradient(const ElemInfo &elem_info) const
Pressure-correction diffusion kernel that enforces modeled jumps on internal baffle faces.
const NS::FV::PressureJumpInterfaceData & jumpInterfaceData()
Compute and cache the half-cell data shared by matrix and right-hand-side assembly.
Real computeNeighborRightHandSideContribution() override
Compute the neighbor-row right hand side, including the neighbor-side pressure jump.
Real computeElemRightHandSideContribution() override
Compute the element-row right hand side, including the element-side pressure jump.
const PorousRhieChowMassFlux & _rc_uo
Porous Rhie-Chow object supplying baffle identification and signed pressure jumps.
Real computeElemMatrixContribution() override
Compute the element-row internal-face matrix contribution.
LinearFVPressureCorrectionDiffusionJump(const InputParameters &params)
Construct the jump-aware pressure-correction diffusion kernel.
Real computeJumpAwareFluxMatrixContribution()
Compute the pressure-correction transmissibility for the current face.
bool _jump_interface_data_valid
Whether the half-cell coefficients have been computed for the current face.
NS::FV::PressureJumpInterfaceData _jump_interface_data
Cached half-cell coefficients for the current face.
Real computeNeighborMatrixContribution() override
Compute the neighbor-row internal-face matrix contribution.
Real computeJumpAwareFluxRHSContribution()
Compute the complete element-side right-hand side for the current face.
Pressure correction diffusion kernel for the linear finite volume SIMPLE algorithm.
Computes Rhie-Chow face mass fluxes for porous flow with optional internal pressure jumps.
NS::FV::PressureJumpInterfaceData pressureJumpInterfaceData(const FaceInfo &fi, const RealVectorValue &elem_gradient, const RealVectorValue &neighbor_gradient, Real face_area) const
Construct the complete pressure-jump operator for a face.
Complete face operator obtained by eliminating the two one-sided interface pressures.