https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousRhieChowMassFlux.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 "RhieChowMassFlux.h"
14#include <unordered_set>
15
17namespace NS::FV
18{
20}
21
30{
31public:
33
39
40 void
41 linkMomentumPressureSystems(const std::vector<LinearSystem *> & momentum_systems,
42 LinearSystem & pressure_system,
43 const std::vector<unsigned int> & momentum_system_numbers) override;
44
45 void computeHbyA(bool verbose) override;
46
53 Real getFaceSidePorosity(const FaceInfo & fi, bool elem_side, const Moose::StateArg & time) const;
54
60 Real getSignedBaffleJump(const FaceInfo & fi, bool elem_side) const;
61
63 bool faceIsBaffle(const FaceInfo & fi) const;
64
66 bool hasPressureBaffles() const { return !_pressure_jump_models.empty(); }
67
78 RealVectorValue baffleFaceVelocity(const FaceInfo & fi, bool elem_side) const;
79
86 Real baffleNormalVelocity(const FaceInfo & fi) const;
87
89 Real cellPressureDiffusionCoefficient(const ElemInfo & elem_info, unsigned int component) const;
90
92 bool pressureDiffusionDataReady() const;
93
96
106 const RealVectorValue & elem_gradient,
107 const RealVectorValue & neighbor_gradient,
108 Real face_area) const;
109
111 void initCouplingField() override;
112
114 void meshChanged() override;
115
116private:
119
121 void updateBaffleJumps();
122
124 const PressureJumpModel * getPressureJumpModel(const FaceInfo & fi) const;
125
128
130 std::vector<const PressureJumpModel *> _pressure_jump_models;
131
134
136 std::vector<const LinearFVGradientReader *> _velocity_gradients;
137
140};
A functor whose evaluation relies on querying a map where the keys are face info ids and the values c...
Computes Rhie-Chow face mass fluxes for porous flow with optional internal pressure jumps.
const Moose::Functor< Real > & _eps
Porosity functor.
bool pressureDiffusionDataReady() const
Whether the pressure-diffusion kernel and cell coefficients are ready for interface use.
const Real _pressure_jump_relaxation
Under-relaxation factor applied when updating pressure jumps.
bool pressureDiffusionUsesNonorthogonalCorrection() const
Whether the linked pressure-diffusion kernel applies a nonorthogonal correction.
void linkMomentumPressureSystems(const std::vector< LinearSystem * > &momentum_systems, LinearSystem &pressure_system, const std::vector< unsigned int > &momentum_system_numbers) override
Update the momentum system-related information.
bool hasPressureBaffles() const
Whether at least one pressure-jump model is configured.
bool faceIsBaffle(const FaceInfo &fi) const
Whether a face is governed by a pressure-jump model.
void setupPorousMeshInformation()
Overwrite the cached cell fluid volumes with cell volume times porosity.
const PressureJumpModel * getPressureJumpModel(const FaceInfo &fi) const
Return the pressure-jump model that applies to the face, or null if there is none.
Real baffleNormalVelocity(const FaceInfo &fi) const
Return the normal superficial velocity at a baffle face, recovered from the shared face mass flux and...
Real getFaceSidePorosity(const FaceInfo &fi, bool elem_side, const Moose::StateArg &time) const
Return the porosity on one side of a face.
std::vector< const PressureJumpModel * > _pressure_jump_models
Pressure-jump models with mutually disjoint boundary sets.
static InputParameters validParams()
std::vector< const LinearFVGradientReader * > _velocity_gradients
Published velocity gradients, one per component, read by the baffle face states.
void updateBaffleJumps()
Recompute and relax the pressure jumps using the current face mass fluxes.
void meshChanged() override
Clear face-indexed baffle-jump data after a mesh change.
void computeHbyA(bool verbose) override
Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the press...
FaceCenteredMapFunctor< Real, std::unordered_map< dof_id_type, Real > > & _baffle_jump
Restartable face field storing pressure as non-owner minus owner.
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.
void initCouplingField() override
Populate baffle-jump storage after initializing the pressure coupling field.
RealVectorValue baffleFaceVelocity(const FaceInfo &fi, bool elem_side) const
Return the superficial velocity at a baffle face as seen from one side.
Real getSignedBaffleJump(const FaceInfo &fi, bool elem_side) const
Return the pressure jump seen from one side of a baffle face.
Real cellPressureDiffusionCoefficient(const ElemInfo &elem_info, unsigned int component) const
Cell coefficient whose face interpolation forms the pressure-diffusion tensor.
Interface for pressure-jump models evaluated by PorousRhieChowMassFlux.
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
Complete face operator obtained by eliminating the two one-sided interface pressures.