Gradient method that reconstructs and relaxes the pressure gradient used for Rhie-Chow momentum-pressure coupling on the linear finite-volume segregated solver. More...
#include <FVReconstructedPressureGradient.h>
Public Types | |
| using | GradientContainer = FVGradientMethod::GradientContainer |
| using | GradientView = LinearFVGradientReader::GradientContainer |
| typedef DataFileName | DataFileParameterType |
Public Member Functions | |
| FVReconstructedPressureGradient (const InputParameters ¶ms) | |
| void | linkFlowSystem (RhieChowMassFlux &rc, const LinearFVGradientReader &pressure_gradient) |
| Link this stateful method to one Rhie-Chow flow-system configuration. | |
| void | validateSetup (const RhieChowMassFlux &rc) const |
| Validate the one-time Rhie-Chow linkage and field layouts required by reconstruction. | |
| const GradientMethodName & | baseGradientMethodName () const |
| Name of the gradient method used before the reconstructed coupling pressure gradient exists. | |
| void | resetForTimeStep (const RhieChowMassFlux &rc) |
| Prepare solver-iteration state for a new time-step attempt. | |
| void | saveLaggedVelocityGradient (RhieChowMassFlux &rc) |
| Save the lagged cell velocity gradient used by the reconstruction. | |
| void | computeCandidateFromCorrectedFlux (const RhieChowMassFlux &rc) |
| Reconstruct the conservative pressure-gradient candidate from the corrected face flux. | |
| const GradientContainer & | reconstructedCandidate (const RhieChowMassFlux &rc) const |
| Get the conservative candidate produced by the current pressure corrector. | |
| void | finalizeCouplingPressureGradient (const RhieChowMassFlux &rc, const GradientView &base_gradient) |
| Relax and publish the current candidate as the coupling pressure gradient. | |
| virtual void | meshChanged () override |
| void | computeGradient (SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const |
| Moose::FV::GradientLimiterType | limiterType () const |
| 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 ¶meter_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 ¶m1, const std::string ¶m2) 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 ¶meter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const |
| void | paramError (const std::string ¶m, Args... args) const |
| void | paramWarning (const std::string ¶m, Args... args) const |
| void | paramWarning (const std::string ¶m, Args... args) const |
| void | paramInfo (const std::string ¶m, 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 ¶m) 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 ¶ms, 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 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 |
| FEProblemBase & | _mci_feproblem |
Private Types | |
| enum class | PressureGradientReconstructionState { NeedLaggedVelocityGradient , NeedCandidate , CandidateReady } |
| Current stage of the pressure-gradient reconstruction cycle. More... | |
| enum class | PressureGradientReconstructionEvent { Reset , SaveLaggedVelocityGradient , ReconstructCandidate , PublishCandidate } |
| Operations that advance or reset the pressure-gradient reconstruction cycle. More... | |
Private Member Functions | |
| void | computeGradientWithoutLimiter (SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const override |
| void | resolveGradientMethodDependencies (FEProblemBase &fe_problem) override |
| void | checkFlowSystem (const RhieChowMassFlux &rc) const |
| Check that a stateful operation is requested by the bound Rhie-Chow object. | |
| void | copyGradient (const GradientView &source, GradientContainer &destination) |
| Copy gradient values while reusing compatible destination storage. | |
| void | transition (PressureGradientReconstructionEvent event) |
| Apply and validate one reconstruction-cycle transition. | |
| void | updateCouplingPressureGradient (const RhieChowMassFlux &rc, const GradientView &base_gradient, const GradientContainer &reconstructed_candidate) |
| Blend a reconstructed candidate into the persistent coupling pressure gradient. | |
| RealVectorValue | reconstructionVelocityGradient (const RhieChowMassFlux &rc, const RealVectorValue &elem_gradient, const FaceInfo &fi, bool elem_has_info, unsigned int velocity_component) const |
| Interpolate a lagged velocity-component gradient to a face. | |
| void | assembleFaceProjection (const RhieChowMassFlux &rc, const ElemInfo &elem_info, const std::vector< RealVectorValue > &elem_velocity_gradients, const FaceInfo *fi, const Point &surface_vector, bool elem_has_info, DenseMatrix< Real > &matrix, DenseVector< Real > &projection_rhs) const |
| Add one face's contribution to the area-weighted least-squares system that reconstructs the cell velocity of elem_info from corrected face fluxes. | |
| DenseVector< Real > | solveFaceProjection (const DenseMatrix< Real > &matrix, const DenseVector< Real > &projection_rhs) const |
| Solve a cell's velocity-projection system. | |
| Real | reconstructPressureGradient (const RhieChowMassFlux &rc, const ElemInfo &elem_info, unsigned int component, Real reconstructed_velocity) const |
| Invert one diagonal momentum equation to recover a pressure-gradient component. | |
Static Private Member Functions | |
| static const hit::Node * | getHitNode (const InputParameters ¶ms) |
| static std::string | messagePrefix (const InputParameters ¶ms, const bool hit_prefix) |
Private Attributes | |
| const GradientMethodName | _base_gradient_method_name |
| Gradient method used before the reconstructed coupling pressure gradient exists. | |
| const FVGradientMethod * | _base_gradient_method = nullptr |
| Resolved method used before the reconstructed coupling pressure gradient exists. | |
| const Real | _gradient_relaxation |
| Relaxation factor applied to reconstructed pressure gradients. | |
| const RhieChowMassFlux * | _rhie_chow = nullptr |
| Rhie-Chow object that owns this stateful reconstruction method. | |
| const SystemBase * | _pressure_system = nullptr |
| Pressure system that owns the reconstructed pressure variable. | |
| unsigned int | _pressure_variable_number = libMesh::invalid_uint |
| Pressure variable reconstructed by this method. | |
| std::vector< const SystemBase * > | _momentum_systems |
| Momentum systems coupled through the owning Rhie-Chow object. | |
| std::vector< const LinearFVGradientReader * > | _velocity_gradient_fields |
| Ordinary gradient fields for the velocity components. | |
| std::vector< std::vector< std::unique_ptr< NumericVector< Number > > > > | _lagged_reconstruction_velocity_gradient |
| Lagged velocity gradients indexed by velocity component and spatial direction. | |
| PressureGradientReconstructionState | _reconstruction_state |
| Current position in the pressure-gradient reconstruction cycle. | |
| dof_id_type | _last_reconstructed_face_flux_iteration = 0 |
| Corrected face-flux iteration used by the previous reconstruction. | |
| GradientContainer | _reconstructed_pressure_gradient |
| Reconstructed pressure-gradient candidate. | |
| GradientContainer | _coupling_pressure_gradient |
| Persistent coupling pressure gradient. | |
| const Moose::FV::GradientLimiterType | _limiter_type |
| const ParallelParamObject & | _parent |
| const MooseBase & | _si_moose_base |
| const FEProblemBase * | _si_problem |
Gradient method that reconstructs and relaxes the pressure gradient used for Rhie-Chow momentum-pressure coupling on the linear finite-volume segregated solver.
Responsibilities:
Definition at line 43 of file FVReconstructedPressureGradient.h.
Definition at line 46 of file FVReconstructedPressureGradient.h.
Definition at line 47 of file FVReconstructedPressureGradient.h.
|
strongprivate |
Operations that advance or reset the pressure-gradient reconstruction cycle.
Definition at line 99 of file FVReconstructedPressureGradient.h.
|
strongprivate |
Current stage of the pressure-gradient reconstruction cycle.
Definition at line 88 of file FVReconstructedPressureGradient.h.
| FVReconstructedPressureGradient::FVReconstructedPressureGradient | ( | const InputParameters & | params | ) |
Definition at line 52 of file FVReconstructedPressureGradient.C.
|
private |
Add one face's contribution to the area-weighted least-squares system that reconstructs the cell velocity of elem_info from corrected face fluxes.
The pressure-corrected face-normal volumetric flux at fi, with the lagged velocity-gradient Taylor correction from the cell center to the face removed, gives one linear equation for the unknown cell velocity, u_P . n_f ~= qhat_f. This face equation contributes |S_f| n_f n_f^T to matrix and |S_f| qhat_f n_f to projection_rhs; once every face of elem_info has been added, solving that system gives the cell velocity that is later substituted into the discrete momentum balance to recover the pressure-gradient component consistent with these corrected fluxes.
| rc | The bound Rhie-Chow flow-system configuration supplying the corrected face flux and lagged velocity gradients |
| elem_info | The cell whose velocity-projection system is being assembled |
| elem_velocity_gradients | Lagged velocity gradients at the center of elem_info |
| fi | The face being added to the projection |
| surface_vector | The coordinate-system-aware area vector of this face, outward from elem_info |
| elem_has_info | Whether elem_info is the "elem" side of fi, as opposed to its "neighbor" side |
| matrix | Area-weighted normal-equation matrix accumulated over the cell's faces, updated in place with this face's contribution |
| projection_rhs | Area-weighted right-hand side accumulated over the cell's faces, updated in place with this face's contribution |
Definition at line 401 of file FVReconstructedPressureGradient.C.
Referenced by computeCandidateFromCorrectedFlux().
|
inline |
Name of the gradient method used before the reconstructed coupling pressure gradient exists.
Definition at line 60 of file FVReconstructedPressureGradient.h.
|
private |
Check that a stateful operation is requested by the bound Rhie-Chow object.
Definition at line 125 of file FVReconstructedPressureGradient.C.
Referenced by computeCandidateFromCorrectedFlux(), finalizeCouplingPressureGradient(), reconstructedCandidate(), resetForTimeStep(), saveLaggedVelocityGradient(), and validateSetup().
| void FVReconstructedPressureGradient::computeCandidateFromCorrectedFlux | ( | const RhieChowMassFlux & | rc | ) |
Reconstruct the conservative pressure-gradient candidate from the corrected face flux.
Definition at line 516 of file FVReconstructedPressureGradient.C.
Referenced by RhieChowMassFlux::preparePressureRelaxation().
|
overrideprivatevirtual |
Implements FVGradientMethod.
Definition at line 217 of file FVReconstructedPressureGradient.C.
|
private |
Copy gradient values while reusing compatible destination storage.
Definition at line 267 of file FVReconstructedPressureGradient.C.
Referenced by resetForTimeStep(), saveLaggedVelocityGradient(), and updateCouplingPressureGradient().
| void FVReconstructedPressureGradient::finalizeCouplingPressureGradient | ( | const RhieChowMassFlux & | rc, |
| const GradientView & | base_gradient | ||
| ) |
Relax and publish the current candidate as the coupling pressure gradient.
| rc | The bound Rhie-Chow flow-system configuration whose pressure gradient is being finalized |
| base_gradient | The ordinary (unreconstructed) pressure gradient used to initialize the coupling gradient the first time it is published |
Definition at line 655 of file FVReconstructedPressureGradient.C.
Referenced by RhieChowMassFlux::finalizePressureCorrector().
| void FVReconstructedPressureGradient::linkFlowSystem | ( | RhieChowMassFlux & | rc, |
| const LinearFVGradientReader & | pressure_gradient | ||
| ) |
Link this stateful method to one Rhie-Chow flow-system configuration.
Definition at line 61 of file FVReconstructedPressureGradient.C.
Referenced by RhieChowMassFlux::linkMomentumPressureSystems().
|
overridevirtual |
Reimplemented from MeshChangedInterface.
Definition at line 336 of file FVReconstructedPressureGradient.C.
| const FVReconstructedPressureGradient::GradientContainer & FVReconstructedPressureGradient::reconstructedCandidate | ( | const RhieChowMassFlux & | rc | ) | const |
Get the conservative candidate produced by the current pressure corrector.
Definition at line 611 of file FVReconstructedPressureGradient.C.
|
private |
Interpolate a lagged velocity-component gradient to a face.
Definition at line 366 of file FVReconstructedPressureGradient.C.
Referenced by assembleFaceProjection().
|
private |
Invert one diagonal momentum equation to recover a pressure-gradient component.
Definition at line 480 of file FVReconstructedPressureGradient.C.
Referenced by computeCandidateFromCorrectedFlux().
| void FVReconstructedPressureGradient::resetForTimeStep | ( | const RhieChowMassFlux & | rc | ) |
Prepare solver-iteration state for a new time-step attempt.
Definition at line 325 of file FVReconstructedPressureGradient.C.
Referenced by RhieChowMassFlux::timestepSetup().
|
overrideprivatevirtual |
Reimplemented from FVGradientMethod.
Definition at line 195 of file FVReconstructedPressureGradient.C.
| void FVReconstructedPressureGradient::saveLaggedVelocityGradient | ( | RhieChowMassFlux & | rc | ) |
Save the lagged cell velocity gradient used by the reconstruction.
Definition at line 345 of file FVReconstructedPressureGradient.C.
Referenced by RhieChowMassFlux::finalizeMomentumPredictor(), and RhieChowMassFlux::preparePISOCorrector().
|
private |
Solve a cell's velocity-projection system.
Definition at line 461 of file FVReconstructedPressureGradient.C.
Referenced by computeCandidateFromCorrectedFlux().
|
private |
Apply and validate one reconstruction-cycle transition.
Definition at line 294 of file FVReconstructedPressureGradient.C.
Referenced by computeCandidateFromCorrectedFlux(), finalizeCouplingPressureGradient(), meshChanged(), resetForTimeStep(), and saveLaggedVelocityGradient().
|
private |
Blend a reconstructed candidate into the persistent coupling pressure gradient.
Definition at line 621 of file FVReconstructedPressureGradient.C.
Referenced by finalizeCouplingPressureGradient().
| void FVReconstructedPressureGradient::validateSetup | ( | const RhieChowMassFlux & | rc | ) | const |
Validate the one-time Rhie-Chow linkage and field layouts required by reconstruction.
Definition at line 137 of file FVReconstructedPressureGradient.C.
Referenced by RhieChowMassFlux::checkReconstructedPressureGradientCompatibility().
|
static |
Definition at line 31 of file FVReconstructedPressureGradient.C.
|
private |
Resolved method used before the reconstructed coupling pressure gradient exists.
Definition at line 185 of file FVReconstructedPressureGradient.h.
Referenced by computeGradientWithoutLimiter(), and resolveGradientMethodDependencies().
|
private |
Gradient method used before the reconstructed coupling pressure gradient exists.
Definition at line 182 of file FVReconstructedPressureGradient.h.
Referenced by baseGradientMethodName(), and resolveGradientMethodDependencies().
|
private |
Persistent coupling pressure gradient.
Definition at line 220 of file FVReconstructedPressureGradient.h.
Referenced by computeGradientWithoutLimiter(), meshChanged(), resetForTimeStep(), and updateCouplingPressureGradient().
|
private |
Relaxation factor applied to reconstructed pressure gradients.
Definition at line 188 of file FVReconstructedPressureGradient.h.
Referenced by updateCouplingPressureGradient().
|
private |
Lagged velocity gradients indexed by velocity component and spatial direction.
Definition at line 207 of file FVReconstructedPressureGradient.h.
Referenced by computeCandidateFromCorrectedFlux(), meshChanged(), reconstructionVelocityGradient(), and saveLaggedVelocityGradient().
|
private |
Corrected face-flux iteration used by the previous reconstruction.
Definition at line 214 of file FVReconstructedPressureGradient.h.
Referenced by computeCandidateFromCorrectedFlux().
|
private |
Momentum systems coupled through the owning Rhie-Chow object.
Definition at line 200 of file FVReconstructedPressureGradient.h.
Referenced by linkFlowSystem(), and validateSetup().
|
private |
Pressure system that owns the reconstructed pressure variable.
Definition at line 194 of file FVReconstructedPressureGradient.h.
Referenced by assembleFaceProjection(), computeGradientWithoutLimiter(), linkFlowSystem(), and validateSetup().
|
private |
Pressure variable reconstructed by this method.
Definition at line 197 of file FVReconstructedPressureGradient.h.
Referenced by assembleFaceProjection(), computeCandidateFromCorrectedFlux(), computeGradientWithoutLimiter(), linkFlowSystem(), updateCouplingPressureGradient(), and validateSetup().
|
private |
Reconstructed pressure-gradient candidate.
Definition at line 217 of file FVReconstructedPressureGradient.h.
Referenced by computeCandidateFromCorrectedFlux(), finalizeCouplingPressureGradient(), meshChanged(), and reconstructedCandidate().
|
private |
Current position in the pressure-gradient reconstruction cycle.
Definition at line 210 of file FVReconstructedPressureGradient.h.
Referenced by reconstructedCandidate(), and transition().
|
private |
Rhie-Chow object that owns this stateful reconstruction method.
Definition at line 191 of file FVReconstructedPressureGradient.h.
Referenced by checkFlowSystem(), and linkFlowSystem().
|
private |
Ordinary gradient fields for the velocity components.
Definition at line 203 of file FVReconstructedPressureGradient.h.
Referenced by linkFlowSystem(), saveLaggedVelocityGradient(), and validateSetup().