https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
FVPressureJumpGreenGaussGradient Class Reference

Green-Gauss pressure gradient that removes prescribed jumps before interpolating across baffles. More...

#include <FVPressureJumpGreenGaussGradient.h>

Inheritance diagram for FVPressureJumpGreenGaussGradient:
[legend]

Public Types

typedef std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > GradientContainer
 
typedef DataFileName DataFileParameterType
 

Public Member Functions

 FVPressureJumpGreenGaussGradient (const InputParameters &params)
 
void linkFlowSystem (PorousRhieChowMassFlux &rc, const LinearFVGradientReader &pressure_gradient)
 Link this method to the porous Rhie-Chow object that supplies pressure jumps.
 
void computeGradient (SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const
 
Moose::FV::GradientLimiterType limiterType () const
 
virtual void resolveGradientMethodDependencies (FEProblemBase &fe_problem)
 
virtual bool enabled () const
 
std::shared_ptr< MooseObject > getSharedPtr ()
 
std::shared_ptr< const MooseObject > getSharedPtr () const
 
bool isKokkosObject () const
 
MooseApp & getMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 

Protected Types

typedef std::pair< Real, Real > InternalFaceValues
 

Protected Member Functions

void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 

Protected Attributes

const bool & _enabled
 
MooseApp & _app
 
Factory & _factory
 
ActionFactory & _action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters & _pars
 
const Parallel::Communicator & _communicator
 

Private Member Functions

void computeGradientWithoutLimiter (SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const override
 
InternalFaceValues internalFaceValues (const FaceInfo &fi, const ElemInfo &elem_info, const ElemInfo &neighbor_info, const MooseLinearVariableFV< Real > &variable, Real elem_value, Real neighbor_value) const override
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

const PorousRhieChowMassFlux * _rhie_chow = nullptr
 Porous Rhie-Chow object supplying baffle locations and signed pressure jumps after linkage.
 
const LinearFVGradientReader * _pressure_gradient = nullptr
 Published gradient used to lag the explicit half-cell correction during reconstruction.
 
const SystemBase * _pressure_system = nullptr
 Pressure system to which this method is linked.
 
unsigned int _pressure_variable_number = libMesh::invalid_uint
 Pressure variable number within the linked system.
 
const Moose::FV::GradientLimiterType _limiter_type
 
const ParallelParamObject & _parent
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 

Detailed Description

Green-Gauss pressure gradient that removes prescribed jumps before interpolating across baffles.

Definition at line 19 of file FVPressureJumpGreenGaussGradient.h.

Constructor & Destructor Documentation

◆ FVPressureJumpGreenGaussGradient()

FVPressureJumpGreenGaussGradient::FVPressureJumpGreenGaussGradient ( const InputParameters &  params)

Definition at line 31 of file FVPressureJumpGreenGaussGradient.C.

Member Function Documentation

◆ computeGradientWithoutLimiter()

void FVPressureJumpGreenGaussGradient::computeGradientWithoutLimiter ( SystemBase &  system,
GradientContainer &  gradient,
const std::unordered_set< unsigned int > &  variable_numbers 
) const
overrideprivatevirtual

Reimplemented from FVGreenGaussGradient.

Definition at line 61 of file FVPressureJumpGreenGaussGradient.C.

65{
66 if (variable_numbers.size() != 1)
67 mooseError("must be used by exactly one pressure variable, but it is used by ",
68 variable_numbers.size(),
69 ".");
70
72 {
73 mooseAssert(_pressure_system == &system,
74 "FVPressureJumpGreenGaussGradient can only compute gradients for its linked "
75 "pressure system.");
76 mooseAssert(_pressure_variable_number == *variable_numbers.begin(),
77 "FVPressureJumpGreenGaussGradient can only compute the linked pressure variable.");
78 }
79
80 FVGreenGaussGradient::computeGradientWithoutLimiter(system, gradient, variable_numbers);
81}
void computeGradientWithoutLimiter(SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const override
const SystemBase * _pressure_system
Pressure system to which this method is linked.
unsigned int _pressure_variable_number
Pressure variable number within the linked system.
void mooseError(Args &&... args) const

◆ internalFaceValues()

FVGreenGaussGradient::InternalFaceValues FVPressureJumpGreenGaussGradient::internalFaceValues ( const FaceInfo &  fi,
const ElemInfo &  elem_info,
const ElemInfo &  neighbor_info,
const MooseLinearVariableFV< Real > &  variable,
Real  elem_value,
Real  neighbor_value 
) const
overrideprivatevirtual

Reimplemented from FVGreenGaussGradient.

Definition at line 84 of file FVPressureJumpGreenGaussGradient.C.

90{
93 fi, elem_info, neighbor_info, variable, elem_value, neighbor_value);
94
95 mooseAssert(_pressure_gradient, "A linked pressure gradient is required on pressure-jump faces.");
96
97 const Real jump = _rhie_chow->getSignedBaffleJump(fi, /*elem_side=*/true);
99 {
100 // Gradient history is initialized before the pressure-diffusion coefficients exist.
101 // Preserve the jump during this startup pass using jump-adjusted interpolation.
102 return {Moose::FV::linearInterpolation(elem_value, neighbor_value + jump, fi, true),
103 Moose::FV::linearInterpolation(elem_value - jump, neighbor_value, fi, true)};
104 }
105
106 // Use the published geometric pressure gradient to match the deferred correction in the
107 // pressure equation. The reconstructed coupling gradient must not enter this correction.
108 const auto face_operator =
110 _pressure_gradient->gradient(elem_info),
111 _pressure_gradient->gradient(neighbor_info),
112 fi.faceArea() * fi.faceCoord());
113
114 // Eliminate the interface pressures to obtain one conservative mass flux, then recover the
115 // one-sided face value used in each cell's Green-Gauss surface sum. Each side's H/A flux enters
116 // its face value, so the face pressure carries the body force, e.g. the hydrostatic slope.
117 const Real mass_flux = NS::FV::pressureJumpFlux(face_operator, elem_value, neighbor_value) -
118 NS::FV::pressureJumpHbyAFlux(face_operator);
120 face_operator, elem_value, mass_flux, /*elem_side=*/true),
122 face_operator, neighbor_value, mass_flux, /*elem_side=*/false)};
123}
virtual InternalFaceValues internalFaceValues(const FaceInfo &fi, const ElemInfo &elem_info, const ElemInfo &neighbor_info, const MooseLinearVariableFV< Real > &variable, Real elem_value, Real neighbor_value) const
const PorousRhieChowMassFlux * _rhie_chow
Porous Rhie-Chow object supplying baffle locations and signed pressure jumps after linkage.
const LinearFVGradientReader * _pressure_gradient
Published gradient used to lag the explicit half-cell correction during reconstruction.
Real faceArea() const
Real & faceCoord()
RealVectorValue gradient(const ElemInfo &elem_info) const
bool pressureDiffusionDataReady() const
Whether the pressure-diffusion kernel and cell coefficients are ready for interface use.
bool faceIsBaffle(const FaceInfo &fi) const
Whether a face is governed by a pressure-jump model.
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.
Real getSignedBaffleJump(const FaceInfo &fi, bool elem_side) const
Return the pressure jump seen from one side of a baffle face.
libMesh::CompareTypes< T, T2 >::supertype linearInterpolation(const T &value1, const T2 &value2, const FaceInfo &fi, const bool one_is_elem, const InterpMethod interp_method=InterpMethod::Average)
Real pressureJumpOneSidedFaceValue(const PressureJumpInterfaceData &data, const Real cell_pressure, const Real mass_flux, const bool elem_side)
Recover one side's face pressure from the common oriented face mass flux.
Real pressureJumpHbyAFlux(const PressureJumpInterfaceData &data)
Compute the H/A part of the face mass flux after eliminating the interface pressures.
Real pressureJumpFlux(const PressureJumpInterfaceData &data, const Real elem_pressure, const Real neighbor_pressure)
Compute the pressure part of the element-to-neighbor flux after eliminating the interface pressures.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ linkFlowSystem()

void FVPressureJumpGreenGaussGradient::linkFlowSystem ( PorousRhieChowMassFlux &  rc,
const LinearFVGradientReader &  pressure_gradient 
)

Link this method to the porous Rhie-Chow object that supplies pressure jumps.

Definition at line 37 of file FVPressureJumpGreenGaussGradient.C.

39{
40 if (&pressure_gradient.method() != this)
41 mooseError("Must be linked using a gradient field produced by that method.");
42
43 if (pressure_gradient.system().number() != rc.pressureSystem().number() ||
44 pressure_gradient.variableNumber() != rc.pressureVariableNumber())
45 mooseError("Must be linked to the pressure variable owned by PorousRhieChowMassFlux '",
46 rc.name(),
47 "'.");
48
49 if (_rhie_chow && _rhie_chow != &rc)
50 mooseError("Already linked to PorousRhieChowMassFlux '",
52 "'. Use a separate gradient method for each flow system.");
53
54 _rhie_chow = &rc;
55 _pressure_gradient = &pressure_gradient;
56 _pressure_system = &pressure_gradient.system();
57 _pressure_variable_number = pressure_gradient.variableNumber();
58}
const FVGradientMethod & method() const
const SystemBase & system() const
unsigned int variableNumber() const
const std::string & name() const
const LinearSystem & pressureSystem() const
Pressure linear system.
unsigned int pressureVariableNumber() const
Variable number of the pressure variable reconstructed by this object.
unsigned int number() const

◆ validParams()

InputParameters FVPressureJumpGreenGaussGradient::validParams ( )
static

Definition at line 20 of file FVPressureJumpGreenGaussGradient.C.

21{
23 params.suppressParameter<MooseEnum>("limiter");
25 "Computes a Green-Gauss pressure gradient that excludes the pressure jump across baffles, "
26 "using a one-sided face pressure for each cell, so the zero-thickness jump does not appear "
27 "as a mesh-dependent gradient in the adjacent cells.");
28 return params;
29}
static InputParameters validParams()
void suppressParameter(const std::string &name)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _pressure_gradient

const LinearFVGradientReader* FVPressureJumpGreenGaussGradient::_pressure_gradient = nullptr
private

Published gradient used to lag the explicit half-cell correction during reconstruction.

Definition at line 47 of file FVPressureJumpGreenGaussGradient.h.

Referenced by internalFaceValues(), and linkFlowSystem().

◆ _pressure_system

const SystemBase* FVPressureJumpGreenGaussGradient::_pressure_system = nullptr
private

Pressure system to which this method is linked.

Definition at line 50 of file FVPressureJumpGreenGaussGradient.h.

Referenced by computeGradientWithoutLimiter(), and linkFlowSystem().

◆ _pressure_variable_number

unsigned int FVPressureJumpGreenGaussGradient::_pressure_variable_number = libMesh::invalid_uint
private

Pressure variable number within the linked system.

Definition at line 53 of file FVPressureJumpGreenGaussGradient.h.

Referenced by computeGradientWithoutLimiter(), and linkFlowSystem().

◆ _rhie_chow

const PorousRhieChowMassFlux* FVPressureJumpGreenGaussGradient::_rhie_chow = nullptr
private

Porous Rhie-Chow object supplying baffle locations and signed pressure jumps after linkage.

Definition at line 44 of file FVPressureJumpGreenGaussGradient.h.

Referenced by internalFaceValues(), and linkFlowSystem().


The documentation for this class was generated from the following files: