diff --git a/modules/navier_stokes/include/executioners/SIMPLESolve.h b/modules/navier_stokes/include/executioners/SIMPLESolve.h index 89a8e39f56c9..d7633a980243 100644 --- a/modules/navier_stokes/include/executioners/SIMPLESolve.h +++ b/modules/navier_stokes/include/executioners/SIMPLESolve.h @@ -10,6 +10,7 @@ #pragma once #include "SolveObject.h" +#include "RhieChowMassFlux.h" class SIMPLESolve : public SolveObject { @@ -28,4 +29,42 @@ class SIMPLESolve : public SolveObject { mooseError("Cannot set inner solve for SIMPLESolve"); } + + /// Fetch the Rhie Chow + void linkRhieChowUserObject(); + + const RhieChowMassFlux & getRCUserObject() { return *_rc_uo; } + +protected: + /// Solve a momentum predictor step with a fixed pressure field + /// @return A vector of (number of linear iterations, normalized residual norm) pairs for + /// the momentum equations. The length of the vector equals the dimensionality of + /// the domain. + std::vector> solveMomentumPredictor(); + + /// Solve a pressure corrector step. + /// @return The number of linear iterations and the normalized residual norm of + /// the pressure equation. + std::pair solvePressureCorrector(); + + /// The names of the momentum systems. + const std::vector & _momentum_system_names; + + /// The number(s) of the system(s) corresponding to the momentum equation(s) + std::vector _momentum_system_numbers; + + /// Pointer(s) to the system(s) corresponding to the momentum equation(s) + std::vector _momentum_systems; + + /// The name of the pressure system + const SolverSystemName & _pressure_system_name; + + /// The number of the system corresponding to the pressure equation + const unsigned int _pressure_sys_number; + + /// Reference to the nonlinear system corresponding to the pressure equation + LinearSystem & _pressure_system; + + /// Pointer to the segregated RhieChow interpolation object + RhieChowMassFlux * _rc_uo; }; diff --git a/modules/navier_stokes/src/executioners/SIMPLESolve.C b/modules/navier_stokes/src/executioners/SIMPLESolve.C index 8976d6cbcd44..a003aeb35fcb 100644 --- a/modules/navier_stokes/src/executioners/SIMPLESolve.C +++ b/modules/navier_stokes/src/executioners/SIMPLESolve.C @@ -17,7 +17,21 @@ SIMPLESolve::validParams() return params; } -SIMPLESolve::SIMPLESolve(Executioner & ex) : SolveObject(ex) {} +SIMPLESolve::SIMPLESolve(Executioner & ex) + : SolveObject(ex), + _momentum_system_names(getParam>("momentum_systems")), + _pressure_system_name(getParam("pressure_system")), + _pressure_sys_number(_problem.linearSysNum(_pressure_system_name)), + _pressure_system(_problem.getLinearSystem(_pressure_sys_number)) +{ + // We fetch the system numbers for the momentum components plus add vectors + // for removing the contribution from the pressure gradient terms. + for (auto system_i : index_range(_momentum_system_names)) + { + _momentum_system_numbers.push_back(_problem.linearSysNum(_momentum_system_names[system_i])); + _momentum_systems.push_back(&_problem.getLinearSystem(_momentum_system_numbers[system_i])); + } +} bool SIMPLESolve::solve()