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

Common base class for segregated solvers for the Navier-Stokes equations with linear FV assembly routines. More...

#include <LinearAssemblySegregatedSolve.h>

Inheritance diagram for LinearAssemblySegregatedSolve:
[legend]

Classes

struct  ResidualStorage
 Aggregated storage for residuals, tolerances, and indices used in convergence checks. More...
 

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 LinearAssemblySegregatedSolve (Executioner &ex)
 
virtual void linkRhieChowUserObject () override
 Fetch the Rhie Chow user object that is reponsible for determining face velocities and mass flux.
 
virtual void initialSetup () override
 
virtual bool solve () override
 Performs the momentum pressure coupling.
 
const std::vector< LinearSystem * > systemsToSolve () const
 Return pointers to the systems which are solved for within this object.
 
virtual void setInnerSolve (SolveObject &) override
 
void setupPressurePin ()
 Setup pressure pin if there is need for one.
 
virtual void checkIntegrity ()
 Check if the user defined time kernels.
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () 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 InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (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
 
PerfGraphperfGraph ()
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) 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 Member Functions

virtual std::vector< std::pair< unsigned int, Real > > solveMomentumPredictor () override
 Solve a momentum predictor step with a fixed pressure field.
 
virtual std::pair< unsigned int, Real > solvePressureCorrector () override
 Solve a pressure corrector step.
 
virtual std::pair< unsigned int, Real > correctVelocity (const bool subtract_updated_pressure, const bool recompute_face_mass_flux, const SolverParams &solver_params)
 Computes new velocity field based on computed pressure gradients.
 
std::pair< unsigned int, Real > solveAdvectedSystem (const unsigned int system_num, LinearSystem &system, const Real relaxation_factor, libMesh::SolverConfiguration &solver_config, const Real abs_tol, const bool reuse_pc, const Real field_relaxation=1.0, const Real min_value_limiter=std::numeric_limits< Real >::min())
 Solve an equation which contains an advection term that depends on the solution of the segregated Navier-Stokes equations.
 
ResidualStorage setupResidualStorage () const
 Build residual/tolerance vectors and associated indices for all enabled systems.
 
std::pair< unsigned int, Real > solveSolidEnergy ()
 Solve an equation which contains the solid energy conservation.
 
void updatePressureGradient ()
 Explicitly update all registered pressure gradient fields.
 
void checkDependentParameterError (const std::string &main_parameter, const std::vector< std::string > &dependent_parameters, const bool should_be_defined)
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &) const
 

Protected Attributes

std::vector< unsigned int_momentum_system_numbers
 The number(s) of the system(s) corresponding to the momentum equation(s)
 
std::vector< LinearSystem * > _momentum_systems
 Pointer(s) to the system(s) corresponding to the momentum equation(s)
 
const unsigned int _momentum_pc_recompute_frequency
 How often to recompute the momentum equations preconditioner.
 
unsigned int _momentum_pc_solve_counter
 Number of momentum equations solves performed without recomputing the preconditioner.
 
const unsigned int _pressure_sys_number
 The number of the system corresponding to the pressure equation.
 
LinearSystem_pressure_system
 Reference to the linear system corresponding to the pressure equation.
 
const unsigned int _pressure_pc_recompute_frequency
 How often (in pressure corrector solves) to recompute the pressure preconditioner.
 
unsigned int _pressure_pc_solve_counter
 Number of pressure corrector solves performed without recomputing the preconditioner.
 
const unsigned int _energy_sys_number
 The number of the system corresponding to the energy equation.
 
LinearSystem_energy_system
 Pointer to the linear system corresponding to the fluid energy equation.
 
const unsigned int _energy_pc_recompute_frequency
 How often to recompute the energy equation preconditioner.
 
unsigned int _energy_pc_solve_counter
 Number of energy solves performed without recomputing the preconditioner.
 
const unsigned int _solid_energy_sys_number
 The number of the system corresponding to the solid energy equation.
 
LinearSystem_solid_energy_system
 Pointer to the linear system corresponding to the solid energy equation.
 
const unsigned int _solid_energy_pc_recompute_frequency
 How often to recompute the solid energy equation preconditioner.
 
unsigned int _solid_energy_pc_solve_counter
 Number of solid energy solves performed without recomputing the preconditioner.
 
const unsigned int _passive_scalar_pc_recompute_frequency
 How often to recompute the passive scalar equations preconditioner.
 
unsigned int _passive_scalar_pc_solve_counter
 Number of passive scalar solves performed without recomputing the preconditioner.
 
const unsigned int _turbulence_pc_recompute_frequency
 How often to recompute the turbulence equations preconditioner.
 
unsigned int _turbulence_pc_solve_counter
 Number of turbulence equations solves performed without recomputing the preconditioner.
 
std::vector< LinearSystem * > _passive_scalar_systems
 Pointer(s) to the system(s) corresponding to the passive scalar equation(s)
 
std::vector< LinearSystem * > _pm_radiation_systems
 Pointer(s) to the system(s) corresponding to the participting media radiation equation(s)
 
std::vector< LinearSystem * > _active_scalar_systems
 Pointer(s) to the system(s) corresponding to the active scalar equation(s)
 
std::vector< LinearSystem * > _turbulence_systems
 Pointer(s) to the system(s) corresponding to the turbulence equation(s)
 
RhieChowMassFlux_rc_uo
 Pointer to the segregated RhieChow interpolation object.
 
std::vector< LinearSystem * > _systems_to_solve
 Shortcut to every linear system that we solve for here.
 
const bool _should_solve_momentum
 Flags controlling which systems are actively solved (can be used with restart to freeze flow)
 
const bool _should_solve_pressure
 
const bool _should_solve_energy
 
const bool _should_solve_solid_energy
 
const bool _should_solve_turbulence
 
const bool _should_solve_passive_scalars
 
const bool _should_solve_active_scalars
 
const bool _should_solve_pm_radiation
 
const std::vector< SolverSystemName > & _active_scalar_system_names
 The names of the active scalar systems.
 
const bool _has_active_scalar_systems
 Boolean for easy check if a active scalar systems shall be solved or not.
 
std::vector< unsigned int_active_scalar_system_numbers
 
const std::vector< Real > _active_scalar_equation_relaxation
 The user-defined relaxation parameter(s) for the active scalar equation(s)
 
Moose::PetscSupport::PetscOptions _active_scalar_petsc_options
 Options which hold the petsc settings for the active scalar equation(s)
 
SIMPLESolverConfiguration _active_scalar_linear_control
 Options for the linear solver of the active scalar equation(s)
 
const Real _active_scalar_l_abs_tol
 Absolute linear tolerance for the active scalar equation(s).
 
const std::vector< Real > _active_scalar_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in active scalars.
 
const unsigned int _active_scalar_pc_recompute_frequency
 How often to recompute the active scalar equations preconditioner.
 
unsigned int _active_scalar_pc_solve_counter
 Number of active scalar solves performed without recomputing the preconditioner.
 
NS::FV::CHTHandler _cht
 ********************** Conjugate heat transfer variables ************** //
 
const std::vector< SolverSystemName > & _momentum_system_names
 The names of the momentum systems.
 
SIMPLESolverConfiguration _momentum_linear_control
 Options for the linear solver of the momentum equation.
 
const Real _momentum_l_abs_tol
 Absolute linear tolerance for the momentum equation(s).
 
Moose::PetscSupport::PetscOptions _momentum_petsc_options
 Options which hold the petsc settings for the momentum equation.
 
const Real _momentum_equation_relaxation
 The user-defined relaxation parameter for the momentum equation.
 
const SolverSystemName & _pressure_system_name
 The name of the pressure system.
 
SIMPLESolverConfiguration _pressure_linear_control
 Options for the linear solver of the pressure equation.
 
const Real _pressure_l_abs_tol
 Absolute linear tolerance for the pressure equation.
 
Moose::PetscSupport::PetscOptions _pressure_petsc_options
 Options which hold the petsc settings for the pressure equation.
 
const Real _pressure_variable_relaxation
 The user-defined relaxation parameter for the pressure variable.
 
const bool _pin_pressure
 If the pressure needs to be pinned.
 
const Real _pressure_pin_value
 The value we want to enforce for pressure.
 
dof_id_type _pressure_pin_dof
 The dof ID where the pressure needs to be pinned.
 
const bool _has_energy_system
 Boolean for easy check if a fluid energy system shall be solved or not.
 
const Real _energy_equation_relaxation
 The user-defined relaxation parameter for the energy equation.
 
Moose::PetscSupport::PetscOptions _energy_petsc_options
 Options which hold the petsc settings for the fluid energy equation.
 
SIMPLESolverConfiguration _energy_linear_control
 Options for the linear solver of the energy equation.
 
const Real _energy_l_abs_tol
 Absolute linear tolerance for the energy equations.
 
const bool _has_solid_energy_system
 Boolean for easy check if a solid energy system shall be solved or not.
 
Moose::PetscSupport::PetscOptions _solid_energy_petsc_options
 Options which hold the petsc settings for the fluid energy equation.
 
SIMPLESolverConfiguration _solid_energy_linear_control
 Options for the linear solver of the energy equation.
 
const Real _solid_energy_l_abs_tol
 Absolute linear tolerance for the energy equations.
 
const std::vector< SolverSystemName > & _passive_scalar_system_names
 The names of the passive scalar systems.
 
const bool _has_passive_scalar_systems
 Boolean for easy check if a passive scalar systems shall be solved or not.
 
std::vector< unsigned int_passive_scalar_system_numbers
 
const std::vector< Real > _passive_scalar_equation_relaxation
 The user-defined relaxation parameter(s) for the passive scalar equation(s)
 
Moose::PetscSupport::PetscOptions _passive_scalar_petsc_options
 Options which hold the petsc settings for the passive scalar equation(s)
 
SIMPLESolverConfiguration _passive_scalar_linear_control
 Options for the linear solver of the passive scalar equation(s)
 
const Real _passive_scalar_l_abs_tol
 Absolute linear tolerance for the passive scalar equation(s).
 
const std::vector< SolverSystemName > & _pm_radiation_system_names
 The names of the participating media radiation systems.
 
const bool _has_pm_radiation_systems
 Boolean for easy check if participating media radiation systems shall be solved or not.
 
std::vector< unsigned int_pm_radiation_system_numbers
 
const std::vector< Real > _pm_radiation_equation_relaxation
 The user-defined relaxation parameter(s) for the participating media radiation equation(s)
 
Moose::PetscSupport::PetscOptions _pm_radiation_petsc_options
 Options which hold the petsc settings for the participating media radiation equation(s)
 
SIMPLESolverConfiguration _pm_radiation_linear_control
 Options for the linear solver of the participating media radiation equation(s)
 
const Real _pm_radiation_l_abs_tol
 Absolute linear tolerance for the participating media radiation equation(s).
 
const std::vector< SolverSystemName > & _turbulence_system_names
 The names of the turbulence systems.
 
const bool _has_turbulence_systems
 Boolean for easy check if a turbulence scalar systems shall be solved or not.
 
std::vector< unsigned int_turbulence_system_numbers
 
const std::vector< Real > _turbulence_equation_relaxation
 The user-defined relaxation parameter(s) for the turbulence equation(s)
 
std::vector< Real > _turbulence_field_relaxation
 The user-defined relaxation parameter(s) for the turbulence field(s)
 
std::vector< Real > _turbulence_field_min_limit
 The user-defined lower limit for turbulent quantities e.g. k, eps/omega, etc..
 
Moose::PetscSupport::PetscOptions _turbulence_petsc_options
 Options which hold the petsc settings for the turbulence equation(s)
 
SIMPLESolverConfiguration _turbulence_linear_control
 Options for the linear solver of the turbulence equation(s)
 
const Real _turbulence_l_abs_tol
 Absolute linear tolerance for the turbulence equation(s).
 
const std::vector< Real > _momentum_absolute_tolerance
 The user-defined absolute tolerance(s) for determining the convergence in momentum.
 
const Real _pressure_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in pressure.
 
const Real _energy_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in energy.
 
const Real _solid_energy_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in solid energy.
 
const std::vector< Real > _passive_scalar_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in passive scalars.
 
const std::vector< Real > _pm_radiation_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in participating media radiation.
 
const std::vector< Real > _turbulence_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence turbulence variables.
 
const unsigned int _num_iterations
 The maximum number of momentum-pressure iterations.
 
const bool _continue_on_max_its
 If solve should continue if maximum number of iterations is hit.
 
const bool _print_fields
 Debug parameter which allows printing the coupling and solution vectors/matrices.
 
Executioner_executioner
 
FEProblemBase_problem
 
DisplacedProblem_displaced_problem
 
MooseMesh_mesh
 
MooseMesh_displaced_mesh
 
SystemBase_solver_sys
 
AuxiliarySystem_aux
 
SolveObject_inner_solve
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Private Member Functions

const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 

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 ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
const MooseObject_ppi_moose_object
 
const InputParameters_ppi_params
 
const FEProblemBase_ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const MooseObject_uoi_moose_object
 
const FEProblemBase_uoi_feproblem
 
const THREAD_ID _uoi_tid
 

Detailed Description

Common base class for segregated solvers for the Navier-Stokes equations with linear FV assembly routines.

Once the nonlinear assembly-based routines are retired, this will be the primary base class instead of SIMPLESolveBase.

Definition at line 23 of file LinearAssemblySegregatedSolve.h.

Constructor & Destructor Documentation

◆ LinearAssemblySegregatedSolve()

LinearAssemblySegregatedSolve::LinearAssemblySegregatedSolve ( Executioner ex)

Definition at line 170 of file LinearAssemblySegregatedSolve.C.

171 : SIMPLESolveBase(ex),
172 _momentum_pc_recompute_frequency(getParam<unsigned int>("momentum_pc_recompute_frequency")),
174 _pressure_sys_number(_problem.linearSysNum(getParam<SolverSystemName>("pressure_system"))),
176 _pressure_pc_recompute_frequency(getParam<unsigned int>("pressure_pc_recompute_frequency")),
179 ? _problem.linearSysNum(getParam<SolverSystemName>("energy_system"))
181 _energy_system(_has_energy_system ? &_problem.getLinearSystem(_energy_sys_number) : nullptr),
182 _energy_pc_recompute_frequency(getParam<unsigned int>("energy_pc_recompute_frequency")),
186 ? _problem.linearSysNum(getParam<SolverSystemName>("solid_energy_system"))
189 _has_solid_energy_system ? &_problem.getLinearSystem(_solid_energy_sys_number) : nullptr),
191 getParam<unsigned int>("solid_energy_pc_recompute_frequency")),
194 getParam<unsigned int>("passive_scalar_pc_recompute_frequency")),
196 _turbulence_pc_recompute_frequency(getParam<unsigned int>("turbulence_pc_recompute_frequency")),
198 _should_solve_momentum(getParam<bool>("should_solve_momentum")),
199 _should_solve_pressure(getParam<bool>("should_solve_pressure")),
200 _should_solve_energy(getParam<bool>("should_solve_energy")),
201 _should_solve_solid_energy(getParam<bool>("should_solve_solid_energy")),
202 _should_solve_turbulence(getParam<bool>("should_solve_turbulence")),
203 _should_solve_passive_scalars(getParam<bool>("should_solve_passive_scalars")),
204 _should_solve_active_scalars(getParam<bool>("should_solve_active_scalars")),
205 _should_solve_pm_radiation(getParam<bool>("should_solve_pm_radiation")),
206 _active_scalar_system_names(getParam<std::vector<SolverSystemName>>("active_scalar_systems")),
209 getParam<std::vector<Real>>("active_scalar_equation_relaxation")),
210 _active_scalar_l_abs_tol(getParam<Real>("active_scalar_l_abs_tol")),
212 getParam<std::vector<Real>>("active_scalar_absolute_tolerance")),
214 getParam<unsigned int>("active_scalar_pc_recompute_frequency")),
216 _cht(ex.parameters())
217{
219 paramError("should_solve_momentum",
220 "Pressure correction requires solving the momentum equations.");
222 paramError("should_solve_pressure",
223 "Solving momentum without a pressure corrector is not supported.");
225 paramError("should_solve_solid_energy",
226 "Solid energy solve cannot be enabled when the fluid energy solve is disabled.");
227
228 // We fetch the systems and their numbers for the momentum equations only if we solve them
230 for (auto system_i : index_range(_momentum_system_names))
231 {
234 _systems_to_solve.push_back(_momentum_systems.back());
235 }
236
239
242
245
246 // and for the turbulence surrogate equations
248 for (auto system_i : index_range(_turbulence_system_names))
249 {
252 _turbulence_systems.push_back(
254 }
255
256 // and for the passive scalar equations
258 for (auto system_i : index_range(_passive_scalar_system_names))
259 {
262 _passive_scalar_systems.push_back(
266 }
267
268 // and for the participating media radiation equations
270 for (auto system_i : index_range(_pm_radiation_system_names))
271 {
274 _pm_radiation_systems.push_back(
277 }
278
279 // and for the active scalar equations
281 for (auto system_i : index_range(_active_scalar_system_names))
282 {
285 _active_scalar_systems.push_back(
288
289 const auto & active_scalar_petsc_options =
290 getParam<MultiMooseEnum>("active_scalar_petsc_options");
291 const auto & active_scalar_petsc_pair_options = getParam<MooseEnumItem, std::string>(
292 "active_scalar_petsc_options_iname", "active_scalar_petsc_options_value");
294 active_scalar_petsc_options, "", *this, _active_scalar_petsc_options);
295 Moose::PetscSupport::addPetscPairsToPetscOptions(active_scalar_petsc_pair_options,
297 "",
298 *this,
300
302 getParam<Real>("active_scalar_l_tol");
304 getParam<Real>("active_scalar_l_abs_tol");
306 getParam<unsigned int>("active_scalar_l_max_its");
307 }
308
310 paramError("active_scalar_equation_relaxation",
311 "Should be the same size as the number of systems");
312
313 // We disable the prefix here for the time being, the segregated solvers use a different approach
314 // for setting the petsc parameters
315 for (auto & system : _systems_to_solve)
316 system->system().prefix_with_name(false);
317
318 // Link CHT objects, this will also do some error checking
319 // Make a copy for compatibility. These could change in the future
320 // Convert _pm_radiation_systems to std::vector<SystemBase *>
321 if (_cht.enabled())
322 {
324 paramError("should_solve_energy",
325 "Conjugate heat transfer requires solving the fluid energy equation.");
327 paramError("should_solve_solid_energy",
328 "Conjugate heat transfer requires solving the solid energy equation.");
329
330 std::vector<SystemBase *> pm_radiation_systems_base(_pm_radiation_systems.begin(),
332
333 _cht.linkEnergySystems(_solid_energy_system, _energy_system, pm_radiation_systems_base);
334 }
335}
void ErrorVector unsigned int
LinearSystem & getLinearSystem(unsigned int sys_num)
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
virtual MooseMesh & mesh() override
const unsigned int _energy_sys_number
The number of the system corresponding to the energy equation.
unsigned int _turbulence_pc_solve_counter
Number of turbulence equations solves performed without recomputing the preconditioner.
unsigned int _energy_pc_solve_counter
Number of energy solves performed without recomputing the preconditioner.
const unsigned int _energy_pc_recompute_frequency
How often to recompute the energy equation preconditioner.
SIMPLESolverConfiguration _active_scalar_linear_control
Options for the linear solver of the active scalar equation(s)
const unsigned int _solid_energy_sys_number
The number of the system corresponding to the solid energy equation.
std::vector< LinearSystem * > _systems_to_solve
Shortcut to every linear system that we solve for here.
unsigned int _solid_energy_pc_solve_counter
Number of solid energy solves performed without recomputing the preconditioner.
const unsigned int _momentum_pc_recompute_frequency
How often to recompute the momentum equations preconditioner.
const Real _active_scalar_l_abs_tol
Absolute linear tolerance for the active scalar equation(s).
LinearSystem * _energy_system
Pointer to the linear system corresponding to the fluid energy equation.
NS::FV::CHTHandler _cht
********************** Conjugate heat transfer variables ************** //
LinearSystem * _solid_energy_system
Pointer to the linear system corresponding to the solid energy equation.
std::vector< unsigned int > _momentum_system_numbers
The number(s) of the system(s) corresponding to the momentum equation(s)
std::vector< LinearSystem * > _turbulence_systems
Pointer(s) to the system(s) corresponding to the turbulence equation(s)
std::vector< LinearSystem * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
std::vector< LinearSystem * > _pm_radiation_systems
Pointer(s) to the system(s) corresponding to the participting media radiation equation(s)
Moose::PetscSupport::PetscOptions _active_scalar_petsc_options
Options which hold the petsc settings for the active scalar equation(s)
const unsigned int _pressure_pc_recompute_frequency
How often (in pressure corrector solves) to recompute the pressure preconditioner.
unsigned int _momentum_pc_solve_counter
Number of momentum equations solves performed without recomputing the preconditioner.
const std::vector< Real > _active_scalar_equation_relaxation
The user-defined relaxation parameter(s) for the active scalar equation(s)
std::vector< LinearSystem * > _active_scalar_systems
Pointer(s) to the system(s) corresponding to the active scalar equation(s)
unsigned int _active_scalar_pc_solve_counter
Number of active scalar solves performed without recomputing the preconditioner.
unsigned int _pressure_pc_solve_counter
Number of pressure corrector solves performed without recomputing the preconditioner.
const unsigned int _active_scalar_pc_recompute_frequency
How often to recompute the active scalar equations preconditioner.
const unsigned int _turbulence_pc_recompute_frequency
How often to recompute the turbulence equations preconditioner.
LinearSystem & _pressure_system
Reference to the linear system corresponding to the pressure equation.
const std::vector< Real > _active_scalar_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in active scalars.
const bool _has_active_scalar_systems
Boolean for easy check if a active scalar systems shall be solved or not.
const unsigned int _solid_energy_pc_recompute_frequency
How often to recompute the solid energy equation preconditioner.
const std::vector< SolverSystemName > & _active_scalar_system_names
The names of the active scalar systems.
unsigned int _passive_scalar_pc_solve_counter
Number of passive scalar solves performed without recomputing the preconditioner.
const unsigned int _passive_scalar_pc_recompute_frequency
How often to recompute the passive scalar equations preconditioner.
const unsigned int _pressure_sys_number
The number of the system corresponding to the pressure equation.
std::vector< unsigned int > _active_scalar_system_numbers
const bool _should_solve_momentum
Flags controlling which systems are actively solved (can be used with restart to freeze flow)
std::vector< LinearSystem * > _passive_scalar_systems
Pointer(s) to the system(s) corresponding to the passive scalar equation(s)
const InputParameters & parameters() const
void paramError(const std::string &param, Args... args) const
const T & getParam(const std::string &name) const
virtual unsigned int dimension() const
virtual bool enabled() const override final
Check if CHT treatment is needed.
Definition CHTHandler.h:152
void linkEnergySystems(SystemBase *solid_energy_system, SystemBase *fluid_energy_system, std::vector< SystemBase * > pm_radiation_systems)
Link energy systems.
Definition CHTHandler.C:91
Solve class serving as a base class for the two SIMPLE solvers that operate with different assembly a...
const bool _has_energy_system
Boolean for easy check if a fluid energy system shall be solved or not.
std::vector< unsigned int > _pm_radiation_system_numbers
const bool _has_turbulence_systems
Boolean for easy check if a turbulence scalar systems shall be solved or not.
std::vector< unsigned int > _turbulence_system_numbers
const std::vector< SolverSystemName > & _passive_scalar_system_names
The names of the passive scalar systems.
std::vector< unsigned int > _passive_scalar_system_numbers
const bool _has_pm_radiation_systems
Boolean for easy check if participating media radiation systems shall be solved or not.
const std::vector< SolverSystemName > & _turbulence_system_names
The names of the turbulence systems.
const bool _has_solid_energy_system
Boolean for easy check if a solid energy system shall be solved or not.
const bool _has_passive_scalar_systems
Boolean for easy check if a passive scalar systems shall be solved or not.
const std::vector< SolverSystemName > & _pm_radiation_system_names
The names of the participating media radiation systems.
const std::vector< SolverSystemName > & _momentum_system_names
The names of the momentum systems.
FEProblemBase & _problem
std::map< std::string, int > int_valued_data
std::map< std::string, Real > real_valued_data
void addPetscFlagsToPetscOptions(const MultiMooseEnum &petsc_flags, std::string prefix, const ParallelParamObject &param_object, PetscOptions &petsc_options)
void addPetscPairsToPetscOptions(const std::vector< std::pair< MooseEnumItem, std::string > > &petsc_pair_options, const unsigned int mesh_dimension, std::string prefix, const ParallelParamObject &param_object, PetscOptions &petsc_options)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
auto index_range(const T &sizable)
const unsigned int invalid_uint
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ checkDependentParameterError()

void SIMPLESolveBase::checkDependentParameterError ( const std::string &  main_parameter,
const std::vector< std::string > &  dependent_parameters,
const bool  should_be_defined 
)
protectedinherited

Definition at line 711 of file SIMPLESolveBase.C.

714{
715 for (const auto & param : dependent_parameters)
716 if (parameters().isParamSetByUser(param) == !should_be_defined)
717 paramError(param,
718 "This parameter should " + std::string(should_be_defined ? "" : "not") +
719 " be given by the user with the corresponding " + main_parameter +
720 " setting!");
721}
bool isParamSetByUser(const std::string &name) const
if(subdm)

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and SIMPLESolveNonlinearAssembly::SIMPLESolveNonlinearAssembly().

◆ checkIntegrity()

virtual void SIMPLESolveBase::checkIntegrity ( )
inlinevirtualinherited

Check if the user defined time kernels.

Reimplemented in SIMPLESolve, and SIMPLESolveNonlinearAssembly.

Definition at line 61 of file SIMPLESolveBase.h.

61{}

◆ correctVelocity()

std::pair< unsigned int, Real > LinearAssemblySegregatedSolve::correctVelocity ( const bool  subtract_updated_pressure,
const bool  recompute_face_mass_flux,
const SolverParams solver_params 
)
protectedvirtual

Computes new velocity field based on computed pressure gradients.

Parameters
subtract_updated_pressureIf we need to subtract the updated pressure gradient from the right hand side of the system
recompute_face_mass_fluxIf we want to recompute the face flux too
solver_paramsDummy solver parameter object for the linear solve

Reimplemented in PIMPLESolve.

Definition at line 604 of file LinearAssemblySegregatedSolve.C.

607{
608 // Compute the coupling fields between the momentum and pressure equations.
609 // The first argument makes sure the pressure gradient is staged at the first
610 // iteration
611 _rc_uo->computeHbyA(subtract_updated_pressure, _print_fields);
612
613 // We set the preconditioner/controllable parameters for the pressure equations through
614 // petsc options. Linear tolerances will be overridden within the solver.
616
617 // Solve the pressure corrector
618 const auto residuals = solvePressureCorrector();
619
620 // Compute the face velocity which is used in the advection terms. In certain
621 // segregated solver algorithms (like PISO) this is only done on the last iteration.
622 if (recompute_face_mass_flux)
624
625 auto & pressure_current_solution = *(_pressure_system.system().current_local_solution.get());
626 auto & pressure_old_solution = *(_pressure_system.solutionPreviousNewton());
627
628 // Relax the pressure update for the next momentum predictor
630 pressure_current_solution, pressure_old_solution, _pressure_variable_relaxation);
631
632 // Overwrite old solution
633 pressure_old_solution = pressure_current_solution;
634 _pressure_system.setSolution(pressure_current_solution);
635
636 // We recompute the updated pressure gradient
638
639 // Reconstruct the cell velocity as well to accelerate convergence
641
642 return residuals;
643}
RhieChowMassFlux * _rc_uo
Pointer to the segregated RhieChow interpolation object.
virtual std::pair< unsigned int, Real > solvePressureCorrector() override
Solve a pressure corrector step.
void updatePressureGradient()
Explicitly update all registered pressure gradient fields.
virtual System & system() override
void computeHbyA(const bool with_updated_pressure, const bool verbose)
Computes the inverse of the diagonal (1/A) of the system matrix plus the H/A components for the press...
void computeCellVelocity()
Update the cell values of the velocity variables.
void computeFaceMassFlux()
Update the values of the face velocities in the containers.
const Real _pressure_variable_relaxation
The user-defined relaxation parameter for the pressure variable.
Moose::PetscSupport::PetscOptions _pressure_petsc_options
Options which hold the petsc settings for the pressure equation.
const bool _print_fields
Debug parameter which allows printing the coupling and solution vectors/matrices.
void setSolution(const NumericVector< Number > &soln)
virtual const NumericVector< Number > * solutionPreviousNewton() const
void petscSetOptions(const PetscOptions &po, const SolverParams &solver_params, FEProblemBase *const problem=nullptr)
void relaxSolutionUpdate(NumericVector< Number > &vec_new, const NumericVector< Number > &vec_old, const Real relaxation_factor)
Relax the update on a solution field using the following approach: $u = u_{old}+\lambda (u - u_{old})...

Referenced by PIMPLESolve::correctVelocity(), and solve().

◆ initialSetup()

void LinearAssemblySegregatedSolve::initialSetup ( )
overridevirtual

Reimplemented from SolveObject.

Definition at line 454 of file LinearAssemblySegregatedSolve.C.

455{
456 if (_cht.enabled())
457 {
460 }
461}
void deduceCHTBoundaryCoupling()
Run error checks and make sure everything works.
Definition CHTHandler.C:106
void setupConjugateHeatTransferContainers()
Set up the boundary condition pairs, functor maps, and every other necessary structure for the conjug...
Definition CHTHandler.C:291

Referenced by PIMPLE::init(), and SIMPLE::init().

◆ linkRhieChowUserObject()

void LinearAssemblySegregatedSolve::linkRhieChowUserObject ( )
overridevirtual

Fetch the Rhie Chow user object that is reponsible for determining face velocities and mass flux.

Implements SIMPLESolveBase.

Definition at line 338 of file LinearAssemblySegregatedSolve.C.

339{
341 return;
342
343 _rc_uo =
344 const_cast<RhieChowMassFlux *>(&getUserObject<RhieChowMassFlux>("rhie_chow_user_object"));
347
348 // Initialize the face velocities in the RC object
349 if (!_app.isRecovering())
352}
bool isRecovering() const
MooseApp & _app
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
void linkMomentumPressureSystems(const std::vector< LinearSystem * > &momentum_systems, LinearSystem &pressure_system, const std::vector< unsigned int > &momentum_system_numbers)
Update the momentum system-related information.
void initFaceMassFlux()
Initialize the container for face velocities.
void initCouplingField()
Initialize the coupling fields (HbyA and Ainv)

Referenced by PIMPLE::init(), and SIMPLE::init().

◆ setInnerSolve()

virtual void SIMPLESolveBase::setInnerSolve ( SolveObject )
inlineoverridevirtualinherited

Reimplemented from SolveObject.

Definition at line 48 of file SIMPLESolveBase.h.

49 {
50 mooseError("Cannot set inner solve object for solves that inherit from SIMPLESolveBase");
51 }
void mooseError(Args &&... args) const

◆ setupPressurePin()

void SIMPLESolveBase::setupPressurePin ( )
inherited

Setup pressure pin if there is need for one.

Definition at line 702 of file SIMPLESolveBase.C.

703{
704 if (_pin_pressure)
706 _problem.mesh(),
707 getParam<Point>("pressure_pin_point"));
708}
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
dof_id_type _pressure_pin_dof
The dof ID where the pressure needs to be pinned.
const bool _pin_pressure
If the pressure needs to be pinned.
dof_id_type findPointDoFID(const MooseVariableFieldBase &variable, const MooseMesh &mesh, const Point &point)
Find the ID of the degree of freedom which corresponds to the variable and a given point on the mesh.

Referenced by PIMPLE::init(), SIMPLE::init(), and SIMPLENonlinearAssembly::init().

◆ setupResidualStorage()

LinearAssemblySegregatedSolve::ResidualStorage LinearAssemblySegregatedSolve::setupResidualStorage ( ) const
protected

Build residual/tolerance vectors and associated indices for all enabled systems.

Definition at line 978 of file LinearAssemblySegregatedSolve.C.

979{
980 ResidualStorage storage;
981
982 // Residual store: position in this vector defines the ordering used by NS::FV::converged()
983 // Each entry holds (linear its, normalized residual) for one system
985 for (const auto system_i : index_range(_momentum_systems))
986 {
987 storage.momentum_indices.push_back(storage.ns_residuals.size());
988 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
989
990 const auto abs_tol = _momentum_absolute_tolerance.size() == 1
993 storage.ns_abs_tols.push_back(abs_tol);
994 }
995
997 {
998 storage.pressure_index = storage.ns_residuals.size();
999 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
1000 storage.ns_abs_tols.push_back(_pressure_absolute_tolerance);
1001 }
1002
1004 {
1005 storage.energy_index = storage.ns_residuals.size();
1006 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
1007 storage.ns_abs_tols.push_back(_energy_absolute_tolerance);
1008 }
1009
1011 {
1012 storage.solid_energy_index = storage.ns_residuals.size();
1013 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
1014 storage.ns_abs_tols.push_back(_solid_energy_absolute_tolerance);
1015 }
1016
1018 for (const auto i : index_range(_active_scalar_system_names))
1019 {
1020 storage.active_scalar_indices.push_back(storage.ns_residuals.size());
1021 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
1022 storage.ns_abs_tols.push_back(_active_scalar_absolute_tolerance[i]);
1023 }
1024
1026 for (const auto i : index_range(_turbulence_system_names))
1027 {
1028 storage.turbulence_indices.push_back(storage.ns_residuals.size());
1029 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
1030 storage.ns_abs_tols.push_back(_turbulence_absolute_tolerance[i]);
1031 }
1032
1034 for (const auto i : index_range(_pm_radiation_system_names))
1035 {
1036 storage.pm_radiation_indices.push_back(storage.ns_residuals.size());
1037 storage.ns_residuals.push_back(std::make_pair(0, 1.0));
1038 storage.ns_abs_tols.push_back(_pm_radiation_absolute_tolerance[i]);
1039 }
1040
1041 storage.converged = storage.ns_residuals.empty();
1042 return storage;
1043}
const std::vector< Real > _pm_radiation_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in participating media radiation.
const Real _pressure_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in pressure.
const std::vector< Real > _turbulence_absolute_tolerance
The user-defined absolute tolerance for determining the convergence turbulence variables.
const std::vector< Real > _momentum_absolute_tolerance
The user-defined absolute tolerance(s) for determining the convergence in momentum.
const Real _energy_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in energy.
const Real _solid_energy_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in solid energy.

Referenced by solve().

◆ solve()

bool LinearAssemblySegregatedSolve::solve ( )
overridevirtual

Performs the momentum pressure coupling.

Returns
True if solver is converged.

Implements SolveObject.

Definition at line 737 of file LinearAssemblySegregatedSolve.C.

738{
739 // Do not solve if problem is set not to
740 if (!_problem.shouldSolve())
741 return true;
742
744
745 // Dummy solver parameter file which is needed for switching petsc options
746 SolverParams solver_params;
747 solver_params._type = Moose::SolveType::ST_LINEAR;
748 solver_params._line_search = Moose::LineSearchType::LS_NONE;
749
750 // Initialize the SIMPLE iteration counter
751 unsigned int simple_iteration_counter = 0;
752
753 // Reset all the PC solve counters for preconditioner re-use
761
762 // We set up the residual storage and the corresponding tolerances.
763 ResidualStorage residual_storage = setupResidualStorage();
764 auto & ns_residuals = residual_storage.ns_residuals;
765 auto & ns_abs_tols = residual_storage.ns_abs_tols;
766 const auto & momentum_indices = residual_storage.momentum_indices;
767 const auto pressure_index = residual_storage.pressure_index;
768 const auto energy_index = residual_storage.energy_index;
769 const auto solid_energy_index = residual_storage.solid_energy_index;
770 const auto & active_scalar_indices = residual_storage.active_scalar_indices;
771 const auto & turbulence_indices = residual_storage.turbulence_indices;
772 const auto & pm_radiation_indices = residual_storage.pm_radiation_indices;
773
774 bool converged = residual_storage.converged;
775
776 // Loop until converged or hit the maximum allowed iteration number
779
780 while (simple_iteration_counter < _num_iterations && !converged)
781 {
782 simple_iteration_counter++;
783
784 // We set the preconditioner/controllable parameters through petsc options. Linear
785 // tolerances will be overridden within the solver. In case of a segregated momentum
786 // solver, we assume that every velocity component uses the same preconditioner
789
790 // Initialize pressure gradients, after this we just reuse the last ones from each
791 // iteration
792 if (_should_solve_pressure && simple_iteration_counter == 1)
794
795 _console << "Iteration " << simple_iteration_counter << " Initial residual norms:" << std::endl;
796
797 // Solve the momentum predictor step
799 {
800 auto momentum_residual = solveMomentumPredictor();
801 for (const auto system_i : index_range(momentum_residual))
802 ns_residuals[momentum_indices[system_i]] = momentum_residual[system_i];
803 }
804
805 // Now we correct the velocity, this function depends on the method, it differs for
806 // SIMPLE/PIMPLE, this returns the pressure errors
808 ns_residuals[pressure_index] = correctVelocity(true, true, solver_params);
809
810 // If we have an energy equation, solve it here.We assume the material properties in the
811 // Navier-Stokes equations depend on temperature, therefore we can not solve for temperature
812 // outside of the velocity-pressure loop
814 {
815 // If there is no CHT specified this will just do go once through this block
817 while (!_cht.converged())
818 {
819 if (_cht.enabled())
821
822 // We set the preconditioner/controllable parameters through petsc options. Linear
823 // tolerances will be overridden within the solver.
825 ns_residuals[energy_index] =
832
834 {
835 // We set the preconditioner/controllable parameters through petsc options. Linear
836 // tolerances will be overridden within the solver.
838 for (const auto i : index_range(_pm_radiation_system_names))
839 {
840 ns_residuals[pm_radiation_indices[i]] =
846 /*reuse_pc*/ false);
847 }
848 }
849
851 {
852 // For now we only update gradients if cht is needed, might change in the future
853 if (_cht.enabled())
854 {
857 }
858
859 // We set the preconditioner/controllable parameters through petsc options. Linear
860 // tolerances will be overridden within the solver.
862 ns_residuals[solid_energy_index] = solveSolidEnergy();
863
864 // For now we only update gradients if cht is needed, might change in the future
865 if (_cht.enabled())
867 }
868
869 if (_cht.enabled())
870 {
873 }
874
876 }
877 if (_cht.enabled())
879 }
880
881 // If we have active scalar equations, solve them here in case they depend on temperature
882 // or they affect the fluid properties such that they must be solved concurrently with
883 // pressure and velocity
885 {
886 _problem.execute(EXEC_NONLINEAR);
887
888 // We set the preconditioner/controllable parameters through petsc options. Linear
889 // tolerances will be overridden within the solver.
891 for (const auto i : index_range(_active_scalar_system_names))
892 ns_residuals[active_scalar_indices[i]] = solveAdvectedSystem(
900 }
901
902 // If we have turbulence equations, solve them here.
903 // The turbulent viscosity depends on the value of the turbulence surrogate variables
905 {
906 // We set the preconditioner/controllable parameters through petsc options. Linear
907 // tolerances will be overridden within the solver.
909 for (const auto i : index_range(_turbulence_system_names))
910 {
911 ns_residuals[turbulence_indices[i]] = solveAdvectedSystem(
920 }
922 }
923
924 _problem.execute(EXEC_NONLINEAR);
925
926 converged = NS::FV::converged(ns_residuals, ns_abs_tols);
927 }
928
929 // If we have passive scalar equations, solve them here. We assume the material properties in
930 // the Navier-Stokes equations do not depend on passive scalars, as they are passive, therefore
931 // we solve outside of the velocity-pressure loop
933 (converged || _continue_on_max_its))
934 {
935 // The reason why we need more than one iteration is due to the matrix relaxation
936 // which can be used to stabilize the equations
937 bool passive_scalar_converged = false;
938 unsigned int ps_iteration_counter = 0;
939
940 _console << "Passive scalar iteration " << ps_iteration_counter
941 << " Initial residual norms:" << std::endl;
942
943 while (ps_iteration_counter < _num_iterations && !passive_scalar_converged)
944 {
945 ps_iteration_counter++;
946 std::vector<std::pair<unsigned int, Real>> scalar_residuals(
947 _passive_scalar_system_names.size(), std::make_pair(0, 1.0));
948 std::vector<Real> scalar_abs_tols;
949 for (const auto scalar_tol : _passive_scalar_absolute_tolerance)
950 scalar_abs_tols.push_back(scalar_tol);
951
952 // We set the preconditioner/controllable parameters through petsc options. Linear
953 // tolerances will be overridden within the solver.
955 for (const auto i : index_range(_passive_scalar_system_names))
956 scalar_residuals[i] = solveAdvectedSystem(
964
965 passive_scalar_converged = NS::FV::converged(scalar_residuals, scalar_abs_tols);
966 }
967
968 // Both flow and scalars must converge
969 converged = passive_scalar_converged && converged;
970 }
971
973
974 return converged;
975}
const ConsoleStream _console
bool shouldSolve() const
virtual void execute(const ExecFlagType &exec_type)
std::pair< unsigned int, Real > solveSolidEnergy()
Solve an equation which contains the solid energy conservation.
std::pair< unsigned int, Real > solveAdvectedSystem(const unsigned int system_num, LinearSystem &system, const Real relaxation_factor, libMesh::SolverConfiguration &solver_config, const Real abs_tol, const bool reuse_pc, const Real field_relaxation=1.0, const Real min_value_limiter=std::numeric_limits< Real >::min())
Solve an equation which contains an advection term that depends on the solution of the segregated Nav...
virtual std::pair< unsigned int, Real > correctVelocity(const bool subtract_updated_pressure, const bool recompute_face_mass_flux, const SolverParams &solver_params)
Computes new velocity field based on computed pressure gradients.
ResidualStorage setupResidualStorage() const
Build residual/tolerance vectors and associated indices for all enabled systems.
virtual std::vector< std::pair< unsigned int, Real > > solveMomentumPredictor() override
Solve a momentum predictor step with a fixed pressure field.
void computeGradients()
void sumIntegratedFluxes()
Sum the integrated fluxes over all processors.
Definition CHTHandler.C:465
void printIntegratedFluxes() const
Print the integrated heat fluxes.
Definition CHTHandler.C:476
void resetCHTConvergence()
Reset the convergence data.
Definition CHTHandler.h:158
void resetIntegratedFluxes()
Reset the heat fluxes to 0.
Definition CHTHandler.C:488
void initializeCHTCouplingFields()
Initialize the coupling fields for the conjugate heat transfer routines.
Definition CHTHandler.C:371
bool converged() const
Check if CHT iteration converged.
Definition CHTHandler.C:495
void updateCHTBoundaryCouplingFields(const NS::CHTSide side)
Update the coupling fields for.
Definition CHTHandler.C:392
void incrementCHTIterators()
Increment CHT iterators in the loop.
Definition CHTHandler.h:164
const std::vector< Real > _turbulence_equation_relaxation
The user-defined relaxation parameter(s) for the turbulence equation(s)
SIMPLESolverConfiguration _pm_radiation_linear_control
Options for the linear solver of the participating media radiation equation(s)
Moose::PetscSupport::PetscOptions _turbulence_petsc_options
Options which hold the petsc settings for the turbulence equation(s)
const Real _turbulence_l_abs_tol
Absolute linear tolerance for the turbulence equation(s).
const std::vector< Real > _passive_scalar_equation_relaxation
The user-defined relaxation parameter(s) for the passive scalar equation(s)
const Real _passive_scalar_l_abs_tol
Absolute linear tolerance for the passive scalar equation(s).
Moose::PetscSupport::PetscOptions _passive_scalar_petsc_options
Options which hold the petsc settings for the passive scalar equation(s)
std::vector< Real > _turbulence_field_relaxation
The user-defined relaxation parameter(s) for the turbulence field(s)
std::vector< Real > _turbulence_field_min_limit
The user-defined lower limit for turbulent quantities e.g. k, eps/omega, etc..
Moose::PetscSupport::PetscOptions _pm_radiation_petsc_options
Options which hold the petsc settings for the participating media radiation equation(s)
const Real _pm_radiation_l_abs_tol
Absolute linear tolerance for the participating media radiation equation(s).
Moose::PetscSupport::PetscOptions _momentum_petsc_options
Options which hold the petsc settings for the momentum equation.
SIMPLESolverConfiguration _energy_linear_control
Options for the linear solver of the energy equation.
const Real _energy_l_abs_tol
Absolute linear tolerance for the energy equations.
Moose::PetscSupport::PetscOptions _solid_energy_petsc_options
Options which hold the petsc settings for the fluid energy equation.
const bool _continue_on_max_its
If solve should continue if maximum number of iterations is hit.
const unsigned int _num_iterations
The maximum number of momentum-pressure iterations.
const std::vector< Real > _passive_scalar_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in passive scalars.
SIMPLESolverConfiguration _turbulence_linear_control
Options for the linear solver of the turbulence equation(s)
const Real _energy_equation_relaxation
The user-defined relaxation parameter for the energy equation.
SIMPLESolverConfiguration _passive_scalar_linear_control
Options for the linear solver of the passive scalar equation(s)
Moose::PetscSupport::PetscOptions _energy_petsc_options
Options which hold the petsc settings for the fluid energy equation.
const std::vector< Real > _pm_radiation_equation_relaxation
The user-defined relaxation parameter(s) for the participating media radiation equation(s)
Moose::LineSearchType _line_search
Moose::SolveType _type
bool converged(const std::vector< std::pair< unsigned int, Real > > &residuals, const std::vector< Real > &abs_tolerances)
Based on the residuals, determine if the iterative process converged or not.
@ SOLID
Definition NS.h:200
@ FLUID
Definition NS.h:201

◆ solveAdvectedSystem()

std::pair< unsigned int, Real > LinearAssemblySegregatedSolve::solveAdvectedSystem ( const unsigned int  system_num,
LinearSystem system,
const Real  relaxation_factor,
libMesh::SolverConfiguration solver_config,
const Real  abs_tol,
const bool  reuse_pc,
const Real  field_relaxation = 1.0,
const Real  min_value_limiter = std::numeric_limits<Real>::min() 
)
protected

Solve an equation which contains an advection term that depends on the solution of the segregated Navier-Stokes equations.

Parameters
system_numThe number of the system which is solved
systemReference to the system which is solved
relaxation_factorThe relaxation factor for matrix relaxation
solver_configThe solver configuration object for the linear solve
abs_tolThe scaled absolute tolerance for the linear solve
reuse_pcWhether to reuse the preconditioning from the previous solve
field_relaxation(optional) The relaxation factor for fields if relax_fields is true. Default value is 1.0.
min_value_limiter(optional) The minimum value for the solution field
Returns
The normalized residual norm of the equation.

Definition at line 646 of file LinearAssemblySegregatedSolve.C.

654{
656
657 // We will need some members from the implicit linear system
658 LinearImplicitSystem & li_system = cast_ref<LinearImplicitSystem &>(system.system());
659
660 // We will need the solution, the right hand side and the matrix
661 NumericVector<Number> & current_local_solution = *(li_system.current_local_solution);
662 NumericVector<Number> & solution = *(li_system.solution);
663 SparseMatrix<Number> & mmat = *(li_system.matrix);
664 NumericVector<Number> & rhs = *(li_system.rhs);
665
666 // We need a vector that stores the (diagonal_relaxed-original_diagonal) vector
667 auto diff_diagonal = solution.zero_clone();
668
669 // Fetch the linear solver from the system
670 libMesh::PetscLinearSolver<Real> & linear_solver =
671 cast_ref<libMesh::PetscLinearSolver<Real> &>(*li_system.get_linear_solver());
672
673 _problem.computeLinearSystemSys(li_system, mmat, rhs, true);
674
675 // Go and relax the system matrix and the right hand side
676 NS::FV::relaxMatrix(mmat, relaxation_factor, *diff_diagonal);
677 NS::FV::relaxRightHandSide(rhs, solution, *diff_diagonal);
678
679 if (_print_fields)
680 {
681 _console << system.name() << " system matrix" << std::endl;
682 mmat.print();
683 }
684
685 // We compute the normalization factors based on the fluxes
686 Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
687
688 // We need the non-preconditioned norm to be consistent with the norm factor
689 LibmeshPetscCall(KSPSetNormType(linear_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
690
691 // Setting the linear tolerances and maximum iteration counts
692 solver_config.real_valued_data["abs_tol"] = absolute_tol * norm_factor;
693 linear_solver.set_solver_configuration(solver_config);
694
695 // Preconditioner reuse to reduce computational cost
696 linear_solver.reuse_preconditioner(reuse_pc);
697
698 // Solve the system and update current local solution
699 auto its_res_pair = linear_solver.solve(mmat, mmat, solution, rhs);
700 li_system.update();
701
702 if (_print_fields)
703 {
704 _console << " rhs when we solve " << system.name() << std::endl;
705 rhs.print();
706 _console << system.name() << " solution " << std::endl;
707 solution.print();
708 _console << " Norm factor " << norm_factor << std::endl;
709 }
710
711 // Limiting scalar solution
712 if (min_value_limiter != std::numeric_limits<Real>::min())
713 NS::FV::limitSolutionUpdate(current_local_solution, min_value_limiter);
714
715 // Relax the field update for the next momentum predictor
716 if (field_relaxation != 1.0)
717 {
718 auto & old_local_solution = *(system.solutionPreviousNewton());
719 NS::FV::relaxSolutionUpdate(current_local_solution, old_local_solution, field_relaxation);
720
721 // Update old solution, only needed if relaxing the field
722 old_local_solution = current_local_solution;
723 }
724
725 system.setSolution(current_local_solution);
726
727 const auto residuals =
728 std::make_pair(its_res_pair.first, linear_solver.get_initial_residual() / norm_factor);
729
730 _console << " Advected system: " << system.name() << " " << COLOR_GREEN << residuals.second
731 << COLOR_DEFAULT << " Linear its: " << residuals.first << std::endl;
732
733 return residuals;
734}
virtual void computeLinearSystemSys(libMesh::LinearImplicitSystem &sys, libMesh::SparseMatrix< libMesh::Number > &system_matrix, NumericVector< libMesh::Number > &rhs, const bool compute_gradients=true)
void setCurrentLinearSystem(unsigned int sys_num)
virtual const std::string & name() const
void set_solver_configuration(SolverConfiguration &solver_configuration)
virtual void reuse_preconditioner(bool)
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &matrix_in, NumericVector< T > &solution_in, NumericVector< T > &rhs_in, const std::optional< double > tol=std::nullopt, const std::optional< unsigned int > m_its=std::nullopt) override
Real computeNormalizationFactor(const NumericVector< Number > &solution, const SparseMatrix< Number > &mat, const NumericVector< Number > &rhs)
Compute a normalization factor which is applied to the linear residual to determine convergence.
void relaxMatrix(SparseMatrix< Number > &matrix_in, const Real relaxation_parameter, NumericVector< Number > &diff_diagonal)
Relax the matrix to ensure diagonal dominance, we hold onto the difference in diagonals for later use...
void limitSolutionUpdate(NumericVector< Number > &solution, const Real min_limit=std::numeric_limits< Real >::epsilon(), const Real max_limit=1e10)
Limit a solution to its minimum and maximum bounds: $u = min(max(u, min_limit), max_limit)$.
void relaxRightHandSide(NumericVector< Number > &rhs_in, const NumericVector< Number > &solution_in, const NumericVector< Number > &diff_diagonal)
Relax the right hand side of an equation, this needs to be called once and the system matrix has been...

Referenced by solve().

◆ solveMomentumPredictor()

std::vector< std::pair< unsigned int, Real > > LinearAssemblySegregatedSolve::solveMomentumPredictor ( )
overrideprotectedvirtual

Solve a momentum predictor step with a fixed pressure field.

Returns
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.

Implements SIMPLESolveBase.

Definition at line 355 of file LinearAssemblySegregatedSolve.C.

356{
357 // Temporary storage for the (flux-normalized) residuals from
358 // different momentum components
359 std::vector<std::pair<unsigned int, Real>> its_normalized_residuals;
360
361 LinearImplicitSystem & momentum_system_0 =
362 cast_ref<LinearImplicitSystem &>(_momentum_systems[0]->system());
363
364 libMesh::PetscLinearSolver<Real> & momentum_solver =
365 cast_ref<libMesh::PetscLinearSolver<Real> &>(*momentum_system_0.get_linear_solver());
366
367 // Solve the momentum equations.
368 // TO DO: These equations are VERY similar. If we can store the differences (things coming from
369 // BCs for example) separately, it is enough to construct one matrix.
370 for (const auto system_i : index_range(_momentum_systems))
371 {
373
374 // We will need the right hand side and the solution of the next component
375 LinearImplicitSystem & momentum_system =
376 cast_ref<LinearImplicitSystem &>(_momentum_systems[system_i]->system());
377
378 NumericVector<Number> & solution = *(momentum_system.solution);
379 NumericVector<Number> & rhs = *(momentum_system.rhs);
380 SparseMatrix<Number> & mmat = *(momentum_system.matrix);
381
382 auto diff_diagonal = solution.zero_clone();
383
384 // We assemble the matrix and the right hand side
385 _problem.computeLinearSystemSys(momentum_system, mmat, rhs, /*compute_grads*/ true);
386
387 // Still need to relax the right hand side with the same vector
389 NS::FV::relaxRightHandSide(rhs, solution, *diff_diagonal);
390
391 // The normalization factor depends on the right hand side so we need to recompute it for this
392 // component
393 Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
394
395 // Very important, for deciding the convergence, we need the unpreconditioned
396 // norms in the linear solve
397 LibmeshPetscCall(KSPSetNormType(momentum_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
398 // Solve this component. We don't update the ghosted solution yet, that will come at the end
399 // of the corrector step. Also setting the linear tolerances and maximum iteration counts.
402
403 // We solve the equation
404 auto its_resid_pair = momentum_solver.solve(mmat, mmat, solution, rhs);
405 momentum_system.update();
406
407 // We will reuse the preconditioner for every momentum system
408 if (system_i == 0)
409 momentum_solver.reuse_preconditioner(true);
410
411 // Save the normalized residual
412 its_normalized_residuals.push_back(
413 std::make_pair(its_resid_pair.first, momentum_solver.get_initial_residual() / norm_factor));
414
415 if (_print_fields)
416 {
417 _console << " matrix when we solve " << std::endl;
418 mmat.print();
419 _console << " rhs when we solve " << std::endl;
420 rhs.print();
421 _console << " velocity solution component " << system_i << std::endl;
422 solution.print();
423 _console << "Norm factor " << norm_factor << std::endl;
424 _console << Moose::stringify(momentum_solver.get_initial_residual()) << std::endl;
425 }
426
427 // Printing residuals
428 _console << " Momentum equation:"
429 << (_momentum_systems.size() > 1
430 ? std::string(" Component ") + std::to_string(system_i + 1) + std::string(" ")
431 : std::string(" "))
432 << COLOR_GREEN << its_normalized_residuals[system_i].second << COLOR_DEFAULT
433 << " Linear its: " << its_normalized_residuals[system_i].first << std::endl;
434 }
435
436 for (const auto system_i : index_range(_momentum_systems))
437 {
438 LinearImplicitSystem & momentum_system =
439 cast_ref<LinearImplicitSystem &>(_momentum_systems[system_i]->system());
440 _momentum_systems[system_i]->setSolution(*(momentum_system.current_local_solution));
441 _momentum_systems[system_i]->copyPreviousSolutions(Moose::SolutionIterationType::Nonlinear);
442 }
443
444 // We reset this to ensure the preconditioner is computed again when we go to the momentum
445 // predictor, if the number of reuses has been met
446 momentum_solver.reuse_preconditioner(
449
450 return its_normalized_residuals;
451}
const Real _momentum_equation_relaxation
The user-defined relaxation parameter for the momentum equation.
const Real _momentum_l_abs_tol
Absolute linear tolerance for the momentum equation(s).
SIMPLESolverConfiguration _momentum_linear_control
Options for the linear solver of the momentum equation.
std::string stringify(const T &t)

Referenced by solve().

◆ solvePressureCorrector()

std::pair< unsigned int, Real > LinearAssemblySegregatedSolve::solvePressureCorrector ( )
overrideprotectedvirtual

Solve a pressure corrector step.

Returns
The number of linear iterations and the normalized residual norm of the pressure equation.

Implements SIMPLESolveBase.

Definition at line 470 of file LinearAssemblySegregatedSolve.C.

471{
473
474 // We will need some members from the linear system
475 LinearImplicitSystem & pressure_system =
476 cast_ref<LinearImplicitSystem &>(_pressure_system.system());
477
478 // We will need the solution, the right hand side and the matrix
479 NumericVector<Number> & current_local_solution = *(pressure_system.current_local_solution);
480 NumericVector<Number> & solution = *(pressure_system.solution);
481 SparseMatrix<Number> & mmat = *(pressure_system.matrix);
482 NumericVector<Number> & rhs = *(pressure_system.rhs);
483
484 // Fetch the linear solver from the system
485 libMesh::PetscLinearSolver<Real> & pressure_solver =
486 cast_ref<libMesh::PetscLinearSolver<Real> &>(*pressure_system.get_linear_solver());
487
488 _problem.computeLinearSystemSys(pressure_system, mmat, rhs, false);
489
490 if (_print_fields)
491 {
492 _console << "Pressure matrix" << std::endl;
493 mmat.print();
494 }
495
496 // We compute the normalization factors based on the fluxes
497 Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
498
499 // We need the non-preconditioned norm to be consistent with the norm factor
500 LibmeshPetscCall(KSPSetNormType(pressure_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
501
502 // Setting the linear tolerances and maximum iteration counts
505
506 if (_pin_pressure)
508 pressure_system.update();
509
510 // Optionally reuse the pressure preconditioner across SIMPLE iterations to amortize its setup
511 // cost. We rebuild it on the first solve and then once every _pressure_pc_recompute_frequency
512 // solves, reusing it in between. With the default frequency of 1 this rebuilds on every solve.
513 pressure_solver.reuse_preconditioner(
515
516 auto its_res_pair = pressure_solver.solve(mmat, mmat, solution, rhs);
517 pressure_system.update();
518
519 if (_print_fields)
520 {
521 _console << " rhs when we solve pressure " << std::endl;
522 rhs.print();
523 _console << " Pressure " << std::endl;
524 solution.print();
525 _console << "Norm factor " << norm_factor << std::endl;
526 }
527
528 _pressure_system.setSolution(current_local_solution);
529
530 const auto residuals =
531 std::make_pair(its_res_pair.first, pressure_solver.get_initial_residual() / norm_factor);
532
533 _console << " Pressure equation: " << COLOR_GREEN << residuals.second << COLOR_DEFAULT
534 << " Linear its: " << residuals.first << std::endl;
535
536 return residuals;
537}
const Real _pressure_l_abs_tol
Absolute linear tolerance for the pressure equation.
SIMPLESolverConfiguration _pressure_linear_control
Options for the linear solver of the pressure equation.
const Real _pressure_pin_value
The value we want to enforce for pressure.
void constrainSystem(SparseMatrix< Number > &mx, NumericVector< Number > &rhs, const Real desired_value, const dof_id_type dof_id)
Implicitly constrain the system by adding a factor*(u-u_desired) to it at a desired dof value.

Referenced by correctVelocity().

◆ solveSolidEnergy()

std::pair< unsigned int, Real > LinearAssemblySegregatedSolve::solveSolidEnergy ( )
protected

Solve an equation which contains the solid energy conservation.

Definition at line 540 of file LinearAssemblySegregatedSolve.C.

541{
543
544 // We will need some members from the linear system
545 LinearImplicitSystem & system = cast_ref<LinearImplicitSystem &>(_solid_energy_system->system());
546
547 // We will need the solution, the right hand side and the matrix
548 NumericVector<Number> & current_local_solution = *(system.current_local_solution);
549 NumericVector<Number> & solution = *(system.solution);
550 SparseMatrix<Number> & mmat = *(system.matrix);
551 NumericVector<Number> & rhs = *(system.rhs);
552
553 // Fetch the linear solver from the system
555 cast_ref<libMesh::PetscLinearSolver<Real> &>(*system.get_linear_solver());
556
557 _problem.computeLinearSystemSys(system, mmat, rhs, false);
558
559 if (_print_fields)
560 {
561 _console << "Solid energy matrix" << std::endl;
562 mmat.print();
563 }
564
565 // We compute the normalization factors based on the fluxes
566 Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
567
568 // We need the non-preconditioned norm to be consistent with the norm factor
569 LibmeshPetscCall(KSPSetNormType(solver.ksp(), KSP_NORM_UNPRECONDITIONED));
570
571 // Setting the linear tolerances and maximum iteration counts
574
575 // Handle preconditioner reuse logic
579
580 auto its_res_pair = solver.solve(mmat, mmat, solution, rhs);
581 system.update();
582
583 if (_print_fields)
584 {
585 _console << " rhs when we solve solid energy " << std::endl;
586 rhs.print();
587 _console << " Solid energy " << std::endl;
588 solution.print();
589 _console << "Norm factor " << norm_factor << std::endl;
590 }
591
592 _solid_energy_system->setSolution(current_local_solution);
593
594 const auto residuals =
595 std::make_pair(its_res_pair.first, solver.get_initial_residual() / norm_factor);
596
597 _console << " Solid energy equation: " << COLOR_GREEN << residuals.second << COLOR_DEFAULT
598 << " Linear its: " << residuals.first << std::endl;
599
600 return residuals;
601}
SIMPLESolverConfiguration _solid_energy_linear_control
Options for the linear solver of the energy equation.
const Real _solid_energy_l_abs_tol
Absolute linear tolerance for the energy equations.

Referenced by solve().

◆ systemsToSolve()

const std::vector< LinearSystem * > LinearAssemblySegregatedSolve::systemsToSolve ( ) const
inline

Return pointers to the systems which are solved for within this object.

Definition at line 41 of file LinearAssemblySegregatedSolve.h.

41{ return _systems_to_solve; }

Referenced by PIMPLE::getTimeIntegrators(), and PIMPLE::relativeSolutionDifferenceNorm().

◆ updatePressureGradient()

void LinearAssemblySegregatedSolve::updatePressureGradient ( )
protected

Explicitly update all registered pressure gradient fields.

Definition at line 464 of file LinearAssemblySegregatedSolve.C.

Referenced by correctVelocity(), and solve().

◆ validParams()

InputParameters LinearAssemblySegregatedSolve::validParams ( )
static

Definition at line 17 of file LinearAssemblySegregatedSolve.C.

18{
20
21 params.addParam<std::vector<SolverSystemName>>(
22 "active_scalar_systems", {}, "The solver system for each active scalar advection equation.");
23
24 /*
25 * Parameters to control the solution of each scalar advection system
26 */
27 params.addParam<std::vector<Real>>("active_scalar_equation_relaxation",
28 std::vector<Real>(),
29 "The relaxation which should be used for the active scalar "
30 "equations. (=1 for no relaxation, "
31 "diagonal dominance will still be enforced)");
32
33 params.addParam<MultiMooseEnum>("active_scalar_petsc_options",
35 "Singleton PETSc options for the active scalar equation(s)");
37 "active_scalar_petsc_options_iname",
39 "Names of PETSc name/value pairs for the active scalar equation(s)");
40 params.addParam<std::vector<std::string>>(
41 "active_scalar_petsc_options_value",
42 "Values of PETSc name/value pairs (must correspond with \"petsc_options_iname\" for the "
43 "active scalar equation(s)");
44 params.addParam<std::vector<Real>>(
45 "active_scalar_absolute_tolerance",
46 std::vector<Real>(),
47 "The absolute tolerance(s) on the normalized residual(s) of the active scalar equation(s).");
48 params.addRangeCheckedParam<Real>("active_scalar_l_tol",
49 1e-5,
50 "0.0<=active_scalar_l_tol & active_scalar_l_tol<1.0",
51 "The relative tolerance on the normalized residual in the "
52 "linear solver of the active scalar equation(s).");
53 params.addRangeCheckedParam<Real>("active_scalar_l_abs_tol",
54 1e-10,
55 "0.0<active_scalar_l_abs_tol",
56 "The absolute tolerance on the normalized residual in the "
57 "linear solver of the active scalar equation(s).");
58 params.addParam<unsigned int>(
59 "active_scalar_l_max_its",
60 10000,
61 "The maximum allowed iterations in the linear solver of the turbulence equation.");
62
64 "active_scalar_systems active_scalar_equation_relaxation active_scalar_petsc_options "
65 "active_scalar_petsc_options_iname "
66 "active_scalar_petsc_options_value active_scalar_petsc_options_value "
67 "active_scalar_absolute_tolerance "
68 "active_scalar_l_tol active_scalar_l_abs_tol active_scalar_l_max_its",
69 "Active Scalars Equations");
70
71 /*
72 * Flags to optionally skip solving subsets of the thermal-hydraulics system (useful when
73 * recovering a converged solution and only advancing scalar transport for example).
74 */
75 params.addParam<bool>(
76 "should_solve_momentum", true, "Whether we should solve the momentum predictor/corrector.");
77 params.addParam<bool>(
78 "should_solve_pressure", true, "Whether we should solve the pressure corrector.");
79 params.addParam<bool>(
80 "should_solve_energy", true, "Whether we should solve the fluid energy equation.");
81 params.addParam<bool>(
82 "should_solve_solid_energy", true, "Whether we should solve the solid energy equation.");
83 params.addParam<bool>("should_solve_turbulence",
84 true,
85 "Whether we should solve the turbulence surrogate equations.");
86 params.addParam<bool>(
87 "should_solve_passive_scalars", true, "Whether we should solve passive scalar equations.");
88 params.addParam<bool>(
89 "should_solve_active_scalars", true, "Whether we should solve active scalar equations.");
90 params.addParam<bool>("should_solve_pm_radiation",
91 true,
92 "Whether we should solve participating media radiation equations.");
93 params.addParamNamesToGroup("should_solve_momentum should_solve_pressure should_solve_energy "
94 "should_solve_solid_energy should_solve_turbulence "
95 "should_solve_passive_scalars should_solve_active_scalars",
96 "Solve control");
97
98 /*
99 * Parameter to amortize the (often dominant) pressure preconditioner setup cost. The pressure
100 * operator changes slowly between SIMPLE iterations, so its preconditioner can be reused for
101 * several iterations rather than rebuilt every solve.
102 */
103 const std::string recompute_frequency_explanation =
104 "The default of 1 rebuilds it on every solve. A value of N rebuilds it once every N solves "
105 "and "
106 "reuses it in between, which can substantially reduce the solve cost when the "
107 "preconditioner setup dominates (e.g. algebraic multigrid). Larger values trade more reuse "
108 "for a possibly staler preconditioner (more Krylov iterations); for solves where the "
109 "operator changes significantly between linear solves, prefer a smaller value.";
110 params.addRangeCheckedParam<unsigned int>(
111 "pressure_pc_recompute_frequency",
112 1,
113 "pressure_pc_recompute_frequency >= 1",
114 "How often (in pressure corrector solves) to recompute the pressure preconditioner. " +
115 recompute_frequency_explanation);
116 params.addParamNamesToGroup("pressure_pc_recompute_frequency", "Pressure Equation");
117 // Other preconditioner reuse
118 params.addRangeCheckedParam<unsigned int>(
119 "momentum_pc_recompute_frequency",
120 1,
121 "momentum_pc_recompute_frequency >= 1",
122 "How often (in SIMPLE iteration solves) to recompute the momentum preconditioner. " +
123 recompute_frequency_explanation);
124 params.addParamNamesToGroup("momentum_pc_recompute_frequency", "Momentum Equations");
125 params.addRangeCheckedParam<unsigned int>(
126 "energy_pc_recompute_frequency",
127 1,
128 "energy_pc_recompute_frequency >= 1",
129 "How often (in terms of CHT and SIMPLE iterations) to recompute the preconditioner. " +
130 recompute_frequency_explanation);
131 params.addParamNamesToGroup("energy_pc_recompute_frequency", "Energy Equation");
132 params.addRangeCheckedParam<unsigned int>("solid_energy_pc_recompute_frequency",
133 1,
134 "solid_energy_pc_recompute_frequency >= 1",
135 "How often (in terms of CHT solves nested within "
136 "SIMPLE solves) to recompute the preconditioner. " +
137 recompute_frequency_explanation);
138 params.addParamNamesToGroup("solid_energy_pc_recompute_frequency", "Solid Energy Equation");
139 params.addRangeCheckedParam<unsigned int>(
140 "passive_scalar_pc_recompute_frequency",
141 1,
142 "passive_scalar_pc_recompute_frequency >= 1",
143 "How often (in advection solves) to recompute the preconditioner. " +
144 recompute_frequency_explanation);
145 params.addParamNamesToGroup("passive_scalar_pc_recompute_frequency",
146 "Passive Scalars Advection Equation");
147 params.addRangeCheckedParam<unsigned int>(
148 "turbulence_pc_recompute_frequency",
149 1,
150 "turbulence_pc_recompute_frequency >= 1",
151 "How often (in advection solves) to recompute the preconditioner. " +
152 recompute_frequency_explanation);
153 params.addParamNamesToGroup("turbulence_pc_recompute_frequency", "Turbulence Equation");
154 params.addRangeCheckedParam<unsigned int>(
155 "active_scalar_pc_recompute_frequency",
156 1,
157 "active_scalar_pc_recompute_frequency >= 1",
158 "How often (in advection solves) to recompute the preconditioner. " +
159 recompute_frequency_explanation);
160 params.addParamNamesToGroup("active_scalar_pc_recompute_frequency", "Active Scalars Equation");
161
162 /*
163 * Parameters to control the conjugate heat transfer
164 */
166
167 return params;
168}
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
Definition CHTHandler.C:25
static InputParameters validParams()
MultiMooseEnum getCommonPetscFlags()
MultiMooseEnum getCommonPetscKeys()

Referenced by PIMPLESolve::validParams(), and SIMPLESolve::validParams().

Member Data Documentation

◆ _active_scalar_absolute_tolerance

const std::vector<Real> LinearAssemblySegregatedSolve::_active_scalar_absolute_tolerance
protected

The user-defined absolute tolerance for determining the convergence in active scalars.

Definition at line 231 of file LinearAssemblySegregatedSolve.h.

Referenced by setupResidualStorage().

◆ _active_scalar_equation_relaxation

const std::vector<Real> LinearAssemblySegregatedSolve::_active_scalar_equation_relaxation
protected

The user-defined relaxation parameter(s) for the active scalar equation(s)

Definition at line 218 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), and solve().

◆ _active_scalar_l_abs_tol

const Real LinearAssemblySegregatedSolve::_active_scalar_l_abs_tol
protected

Absolute linear tolerance for the active scalar equation(s).

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 228 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _active_scalar_linear_control

SIMPLESolverConfiguration LinearAssemblySegregatedSolve::_active_scalar_linear_control
protected

Options for the linear solver of the active scalar equation(s)

Definition at line 224 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), and solve().

◆ _active_scalar_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_active_scalar_pc_recompute_frequency
protected

How often to recompute the active scalar equations preconditioner.

Definition at line 234 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _active_scalar_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_active_scalar_pc_solve_counter
protected

Number of active scalar solves performed without recomputing the preconditioner.

Definition at line 237 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _active_scalar_petsc_options

Moose::PetscSupport::PetscOptions LinearAssemblySegregatedSolve::_active_scalar_petsc_options
protected

Options which hold the petsc settings for the active scalar equation(s)

Definition at line 221 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), and solve().

◆ _active_scalar_system_names

const std::vector<SolverSystemName>& LinearAssemblySegregatedSolve::_active_scalar_system_names
protected

The names of the active scalar systems.

Definition at line 209 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), setupResidualStorage(), and solve().

◆ _active_scalar_system_numbers

std::vector<unsigned int> LinearAssemblySegregatedSolve::_active_scalar_system_numbers
protected

Definition at line 215 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), and solve().

◆ _active_scalar_systems

std::vector<LinearSystem *> LinearAssemblySegregatedSolve::_active_scalar_systems
protected

Pointer(s) to the system(s) corresponding to the active scalar equation(s)

Definition at line 185 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), and solve().

◆ _cht

NS::FV::CHTHandler LinearAssemblySegregatedSolve::_cht
protected

********************** Conjugate heat transfer variables ************** //

Definition at line 242 of file LinearAssemblySegregatedSolve.h.

Referenced by initialSetup(), LinearAssemblySegregatedSolve(), and solve().

◆ _continue_on_max_its

const bool SIMPLESolveBase::_continue_on_max_its
protectedinherited

If solve should continue if maximum number of iterations is hit.

Definition at line 264 of file SIMPLESolveBase.h.

Referenced by solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _energy_absolute_tolerance

const Real SIMPLESolveBase::_energy_absolute_tolerance
protectedinherited

The user-defined absolute tolerance for determining the convergence in energy.

Definition at line 246 of file SIMPLESolveBase.h.

Referenced by setupResidualStorage(), and SIMPLESolveNonlinearAssembly::solve().

◆ _energy_equation_relaxation

const Real SIMPLESolveBase::_energy_equation_relaxation
protectedinherited

The user-defined relaxation parameter for the energy equation.

Definition at line 130 of file SIMPLESolveBase.h.

Referenced by solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _energy_l_abs_tol

const Real SIMPLESolveBase::_energy_l_abs_tol
protectedinherited

Absolute linear tolerance for the energy equations.

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 140 of file SIMPLESolveBase.h.

Referenced by solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _energy_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_energy_linear_control
protectedinherited

Options for the linear solver of the energy equation.

Definition at line 136 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _energy_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_energy_pc_recompute_frequency
protected

How often to recompute the energy equation preconditioner.

Definition at line 149 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _energy_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_energy_pc_solve_counter
protected

Number of energy solves performed without recomputing the preconditioner.

Definition at line 152 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _energy_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_energy_petsc_options
protectedinherited

Options which hold the petsc settings for the fluid energy equation.

Definition at line 133 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _energy_sys_number

const unsigned int LinearAssemblySegregatedSolve::_energy_sys_number
protected

The number of the system corresponding to the energy equation.

Definition at line 143 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _energy_system

LinearSystem* LinearAssemblySegregatedSolve::_energy_system
protected

Pointer to the linear system corresponding to the fluid energy equation.

Definition at line 146 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), and solve().

◆ _has_active_scalar_systems

const bool LinearAssemblySegregatedSolve::_has_active_scalar_systems
protected

Boolean for easy check if a active scalar systems shall be solved or not.

Definition at line 212 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), setupResidualStorage(), and solve().

◆ _has_energy_system

const bool SIMPLESolveBase::_has_energy_system
protectedinherited

◆ _has_passive_scalar_systems

const bool SIMPLESolveBase::_has_passive_scalar_systems
protectedinherited

◆ _has_pm_radiation_systems

const bool SIMPLESolveBase::_has_pm_radiation_systems
protectedinherited

Boolean for easy check if participating media radiation systems shall be solved or not.

Definition at line 187 of file SIMPLESolveBase.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), setupResidualStorage(), SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _has_solid_energy_system

const bool SIMPLESolveBase::_has_solid_energy_system
protectedinherited

Boolean for easy check if a solid energy system shall be solved or not.

Definition at line 145 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveNonlinearAssembly::checkIntegrity(), LinearAssemblySegregatedSolve(), setupResidualStorage(), SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _has_turbulence_systems

const bool SIMPLESolveBase::_has_turbulence_systems
protectedinherited

Boolean for easy check if a turbulence scalar systems shall be solved or not.

Definition at line 211 of file SIMPLESolveBase.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), setupResidualStorage(), SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _momentum_absolute_tolerance

const std::vector<Real> SIMPLESolveBase::_momentum_absolute_tolerance
protectedinherited

The user-defined absolute tolerance(s) for determining the convergence in momentum.

If a single value is provided it is applied to all momentum components; otherwise one value per momentum system is expected.

Definition at line 240 of file SIMPLESolveBase.h.

Referenced by setupResidualStorage(), SIMPLESolveBase::SIMPLESolveBase(), and SIMPLESolveNonlinearAssembly::solve().

◆ _momentum_equation_relaxation

const Real SIMPLESolveBase::_momentum_equation_relaxation
protectedinherited

The user-defined relaxation parameter for the momentum equation.

Definition at line 95 of file SIMPLESolveBase.h.

Referenced by solveMomentumPredictor(), and SIMPLESolveNonlinearAssembly::solveMomentumPredictor().

◆ _momentum_l_abs_tol

const Real SIMPLESolveBase::_momentum_l_abs_tol
protectedinherited

Absolute linear tolerance for the momentum equation(s).

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 89 of file SIMPLESolveBase.h.

Referenced by solveMomentumPredictor(), and SIMPLESolveNonlinearAssembly::solveMomentumPredictor().

◆ _momentum_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_momentum_linear_control
protectedinherited

Options for the linear solver of the momentum equation.

Definition at line 85 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solveMomentumPredictor(), and SIMPLESolveNonlinearAssembly::solveMomentumPredictor().

◆ _momentum_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_momentum_pc_recompute_frequency
protected

How often to recompute the momentum equations preconditioner.

Definition at line 121 of file LinearAssemblySegregatedSolve.h.

Referenced by solveMomentumPredictor().

◆ _momentum_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_momentum_pc_solve_counter
protected

Number of momentum equations solves performed without recomputing the preconditioner.

Definition at line 124 of file LinearAssemblySegregatedSolve.h.

Referenced by solve(), and solveMomentumPredictor().

◆ _momentum_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_momentum_petsc_options
protectedinherited

Options which hold the petsc settings for the momentum equation.

Definition at line 92 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _momentum_system_names

const std::vector<SolverSystemName>& SIMPLESolveBase::_momentum_system_names
protectedinherited

◆ _momentum_system_numbers

std::vector<unsigned int> LinearAssemblySegregatedSolve::_momentum_system_numbers
protected

The number(s) of the system(s) corresponding to the momentum equation(s)

Definition at line 115 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), linkRhieChowUserObject(), and solveMomentumPredictor().

◆ _momentum_systems

std::vector<LinearSystem *> LinearAssemblySegregatedSolve::_momentum_systems
protected

Pointer(s) to the system(s) corresponding to the momentum equation(s)

Definition at line 118 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), linkRhieChowUserObject(), setupResidualStorage(), and solveMomentumPredictor().

◆ _num_iterations

const unsigned int SIMPLESolveBase::_num_iterations
protectedinherited

The maximum number of momentum-pressure iterations.

Definition at line 261 of file SIMPLESolveBase.h.

Referenced by solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _passive_scalar_absolute_tolerance

const std::vector<Real> SIMPLESolveBase::_passive_scalar_absolute_tolerance
protectedinherited

The user-defined absolute tolerance for determining the convergence in passive scalars.

Definition at line 252 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _passive_scalar_equation_relaxation

const std::vector<Real> SIMPLESolveBase::_passive_scalar_equation_relaxation
protectedinherited

The user-defined relaxation parameter(s) for the passive scalar equation(s)

Definition at line 169 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _passive_scalar_l_abs_tol

const Real SIMPLESolveBase::_passive_scalar_l_abs_tol
protectedinherited

Absolute linear tolerance for the passive scalar equation(s).

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 179 of file SIMPLESolveBase.h.

Referenced by solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _passive_scalar_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_passive_scalar_linear_control
protectedinherited

Options for the linear solver of the passive scalar equation(s)

Definition at line 175 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _passive_scalar_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_passive_scalar_pc_recompute_frequency
protected

How often to recompute the passive scalar equations preconditioner.

Definition at line 167 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _passive_scalar_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_passive_scalar_pc_solve_counter
protected

Number of passive scalar solves performed without recomputing the preconditioner.

Definition at line 170 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _passive_scalar_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_passive_scalar_petsc_options
protectedinherited

Options which hold the petsc settings for the passive scalar equation(s)

Definition at line 172 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and SIMPLESolveNonlinearAssembly::solve().

◆ _passive_scalar_system_names

const std::vector<SolverSystemName>& SIMPLESolveBase::_passive_scalar_system_names
protectedinherited

◆ _passive_scalar_system_numbers

std::vector<unsigned int> SIMPLESolveBase::_passive_scalar_system_numbers
protectedinherited

◆ _passive_scalar_systems

std::vector<LinearSystem *> LinearAssemblySegregatedSolve::_passive_scalar_systems
protected

Pointer(s) to the system(s) corresponding to the passive scalar equation(s)

Definition at line 179 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), and solve().

◆ _pin_pressure

const bool SIMPLESolveBase::_pin_pressure
protectedinherited

If the pressure needs to be pinned.

Definition at line 116 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::setupPressurePin(), solvePressureCorrector(), and SIMPLESolveNonlinearAssembly::solvePressureCorrector().

◆ _pm_radiation_absolute_tolerance

const std::vector<Real> SIMPLESolveBase::_pm_radiation_absolute_tolerance
protectedinherited

The user-defined absolute tolerance for determining the convergence in participating media radiation.

Definition at line 255 of file SIMPLESolveBase.h.

Referenced by setupResidualStorage(), and SIMPLESolveBase::SIMPLESolveBase().

◆ _pm_radiation_equation_relaxation

const std::vector<Real> SIMPLESolveBase::_pm_radiation_equation_relaxation
protectedinherited

The user-defined relaxation parameter(s) for the participating media radiation equation(s)

Definition at line 193 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _pm_radiation_l_abs_tol

const Real SIMPLESolveBase::_pm_radiation_l_abs_tol
protectedinherited

Absolute linear tolerance for the participating media radiation equation(s).

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 203 of file SIMPLESolveBase.h.

Referenced by solve().

◆ _pm_radiation_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_pm_radiation_linear_control
protectedinherited

Options for the linear solver of the participating media radiation equation(s)

Definition at line 199 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _pm_radiation_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_pm_radiation_petsc_options
protectedinherited

Options which hold the petsc settings for the participating media radiation equation(s)

Definition at line 196 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _pm_radiation_system_names

const std::vector<SolverSystemName>& SIMPLESolveBase::_pm_radiation_system_names
protectedinherited

The names of the participating media radiation systems.

Definition at line 184 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve(), setupResidualStorage(), SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _pm_radiation_system_numbers

std::vector<unsigned int> SIMPLESolveBase::_pm_radiation_system_numbers
protectedinherited

Definition at line 190 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve(), and solve().

◆ _pm_radiation_systems

std::vector<LinearSystem *> LinearAssemblySegregatedSolve::_pm_radiation_systems
protected

Pointer(s) to the system(s) corresponding to the participting media radiation equation(s)

Definition at line 182 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), and solve().

◆ _pressure_absolute_tolerance

const Real SIMPLESolveBase::_pressure_absolute_tolerance
protectedinherited

The user-defined absolute tolerance for determining the convergence in pressure.

Definition at line 243 of file SIMPLESolveBase.h.

Referenced by setupResidualStorage(), and SIMPLESolveNonlinearAssembly::solve().

◆ _pressure_l_abs_tol

const Real SIMPLESolveBase::_pressure_l_abs_tol
protectedinherited

Absolute linear tolerance for the pressure equation.

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 107 of file SIMPLESolveBase.h.

Referenced by solvePressureCorrector(), and SIMPLESolveNonlinearAssembly::solvePressureCorrector().

◆ _pressure_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_pressure_linear_control
protectedinherited

Options for the linear solver of the pressure equation.

Definition at line 103 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solvePressureCorrector(), and SIMPLESolveNonlinearAssembly::solvePressureCorrector().

◆ _pressure_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_pressure_pc_recompute_frequency
protected

How often (in pressure corrector solves) to recompute the pressure preconditioner.

The pressure (Poisson-like) operator changes slowly between SIMPLE iterations, so reusing the preconditioner - whose setup is often the dominant cost of the pressure solve - for several iterations can substantially reduce the solve time. A value of 1 (the default) rebuilds it on every solve; a value of N rebuilds it once every N solves and reuses it in between.

Definition at line 137 of file LinearAssemblySegregatedSolve.h.

Referenced by solvePressureCorrector().

◆ _pressure_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_pressure_pc_solve_counter
protected

Number of pressure corrector solves performed without recomputing the preconditioner.

Definition at line 140 of file LinearAssemblySegregatedSolve.h.

Referenced by solve(), and solvePressureCorrector().

◆ _pressure_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_pressure_petsc_options
protectedinherited

Options which hold the petsc settings for the pressure equation.

Definition at line 110 of file SIMPLESolveBase.h.

Referenced by correctVelocity(), SIMPLESolveBase::SIMPLESolveBase(), and SIMPLESolveNonlinearAssembly::solve().

◆ _pressure_pin_dof

dof_id_type SIMPLESolveBase::_pressure_pin_dof
protectedinherited

The dof ID where the pressure needs to be pinned.

Definition at line 122 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::setupPressurePin(), solvePressureCorrector(), and SIMPLESolveNonlinearAssembly::solvePressureCorrector().

◆ _pressure_pin_value

const Real SIMPLESolveBase::_pressure_pin_value
protectedinherited

The value we want to enforce for pressure.

Definition at line 119 of file SIMPLESolveBase.h.

Referenced by solvePressureCorrector(), and SIMPLESolveNonlinearAssembly::solvePressureCorrector().

◆ _pressure_sys_number

const unsigned int LinearAssemblySegregatedSolve::_pressure_sys_number
protected

The number of the system corresponding to the pressure equation.

Definition at line 127 of file LinearAssemblySegregatedSolve.h.

Referenced by solvePressureCorrector().

◆ _pressure_system

LinearSystem& LinearAssemblySegregatedSolve::_pressure_system
protected

Reference to the linear system corresponding to the pressure equation.

Definition at line 130 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), correctVelocity(), LinearAssemblySegregatedSolve(), linkRhieChowUserObject(), solvePressureCorrector(), and updatePressureGradient().

◆ _pressure_system_name

const SolverSystemName& SIMPLESolveBase::_pressure_system_name
protectedinherited

The name of the pressure system.

Definition at line 100 of file SIMPLESolveBase.h.

◆ _pressure_variable_relaxation

const Real SIMPLESolveBase::_pressure_variable_relaxation
protectedinherited

The user-defined relaxation parameter for the pressure variable.

Definition at line 113 of file SIMPLESolveBase.h.

Referenced by correctVelocity(), and SIMPLESolveNonlinearAssembly::solve().

◆ _print_fields

const bool SIMPLESolveBase::_print_fields
protectedinherited

◆ _rc_uo

RhieChowMassFlux* LinearAssemblySegregatedSolve::_rc_uo
protected

Pointer to the segregated RhieChow interpolation object.

Definition at line 191 of file LinearAssemblySegregatedSolve.h.

Referenced by correctVelocity(), and linkRhieChowUserObject().

◆ _should_solve_active_scalars

const bool LinearAssemblySegregatedSolve::_should_solve_active_scalars
protected

◆ _should_solve_energy

const bool LinearAssemblySegregatedSolve::_should_solve_energy
protected

◆ _should_solve_momentum

const bool LinearAssemblySegregatedSolve::_should_solve_momentum
protected

Flags controlling which systems are actively solved (can be used with restart to freeze flow)

Definition at line 197 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), linkRhieChowUserObject(), setupResidualStorage(), and solve().

◆ _should_solve_passive_scalars

const bool LinearAssemblySegregatedSolve::_should_solve_passive_scalars
protected

◆ _should_solve_pm_radiation

const bool LinearAssemblySegregatedSolve::_should_solve_pm_radiation
protected

◆ _should_solve_pressure

const bool LinearAssemblySegregatedSolve::_should_solve_pressure
protected

◆ _should_solve_solid_energy

const bool LinearAssemblySegregatedSolve::_should_solve_solid_energy
protected

◆ _should_solve_turbulence

const bool LinearAssemblySegregatedSolve::_should_solve_turbulence
protected

◆ _solid_energy_absolute_tolerance

const Real SIMPLESolveBase::_solid_energy_absolute_tolerance
protectedinherited

The user-defined absolute tolerance for determining the convergence in solid energy.

Definition at line 249 of file SIMPLESolveBase.h.

Referenced by setupResidualStorage(), and SIMPLESolveNonlinearAssembly::solve().

◆ _solid_energy_l_abs_tol

const Real SIMPLESolveBase::_solid_energy_l_abs_tol
protectedinherited

Absolute linear tolerance for the energy equations.

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 155 of file SIMPLESolveBase.h.

Referenced by solveSolidEnergy(), and SIMPLESolveNonlinearAssembly::solveSolidEnergySystem().

◆ _solid_energy_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_solid_energy_linear_control
protectedinherited

Options for the linear solver of the energy equation.

Definition at line 151 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solveSolidEnergy(), and SIMPLESolveNonlinearAssembly::solveSolidEnergySystem().

◆ _solid_energy_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_solid_energy_pc_recompute_frequency
protected

How often to recompute the solid energy equation preconditioner.

Definition at line 161 of file LinearAssemblySegregatedSolve.h.

Referenced by solveSolidEnergy().

◆ _solid_energy_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_solid_energy_pc_solve_counter
protected

Number of solid energy solves performed without recomputing the preconditioner.

Definition at line 164 of file LinearAssemblySegregatedSolve.h.

Referenced by solve(), and solveSolidEnergy().

◆ _solid_energy_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_solid_energy_petsc_options
protectedinherited

Options which hold the petsc settings for the fluid energy equation.

Definition at line 148 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _solid_energy_sys_number

const unsigned int LinearAssemblySegregatedSolve::_solid_energy_sys_number
protected

The number of the system corresponding to the solid energy equation.

Definition at line 155 of file LinearAssemblySegregatedSolve.h.

Referenced by solveSolidEnergy().

◆ _solid_energy_system

LinearSystem* LinearAssemblySegregatedSolve::_solid_energy_system
protected

Pointer to the linear system corresponding to the solid energy equation.

Definition at line 158 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), solve(), and solveSolidEnergy().

◆ _systems_to_solve

std::vector<LinearSystem *> LinearAssemblySegregatedSolve::_systems_to_solve
protected

Shortcut to every linear system that we solve for here.

Definition at line 194 of file LinearAssemblySegregatedSolve.h.

Referenced by LinearAssemblySegregatedSolve(), and systemsToSolve().

◆ _turbulence_absolute_tolerance

const std::vector<Real> SIMPLESolveBase::_turbulence_absolute_tolerance
protectedinherited

The user-defined absolute tolerance for determining the convergence turbulence variables.

Definition at line 258 of file SIMPLESolveBase.h.

Referenced by setupResidualStorage(), and SIMPLESolveBase::SIMPLESolveBase().

◆ _turbulence_equation_relaxation

const std::vector<Real> SIMPLESolveBase::_turbulence_equation_relaxation
protectedinherited

The user-defined relaxation parameter(s) for the turbulence equation(s)

Definition at line 217 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _turbulence_field_min_limit

std::vector<Real> SIMPLESolveBase::_turbulence_field_min_limit
protectedinherited

The user-defined lower limit for turbulent quantities e.g. k, eps/omega, etc..

Definition at line 223 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _turbulence_field_relaxation

std::vector<Real> SIMPLESolveBase::_turbulence_field_relaxation
protectedinherited

The user-defined relaxation parameter(s) for the turbulence field(s)

Definition at line 220 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _turbulence_l_abs_tol

const Real SIMPLESolveBase::_turbulence_l_abs_tol
protectedinherited

Absolute linear tolerance for the turbulence equation(s).

We need to store this, because it needs to be scaled with a representative flux.

Definition at line 233 of file SIMPLESolveBase.h.

Referenced by solve().

◆ _turbulence_linear_control

SIMPLESolverConfiguration SIMPLESolveBase::_turbulence_linear_control
protectedinherited

Options for the linear solver of the turbulence equation(s)

Definition at line 229 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _turbulence_pc_recompute_frequency

const unsigned int LinearAssemblySegregatedSolve::_turbulence_pc_recompute_frequency
protected

How often to recompute the turbulence equations preconditioner.

Definition at line 173 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _turbulence_pc_solve_counter

unsigned int LinearAssemblySegregatedSolve::_turbulence_pc_solve_counter
protected

Number of turbulence equations solves performed without recomputing the preconditioner.

Definition at line 176 of file LinearAssemblySegregatedSolve.h.

Referenced by solve().

◆ _turbulence_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveBase::_turbulence_petsc_options
protectedinherited

Options which hold the petsc settings for the turbulence equation(s)

Definition at line 226 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _turbulence_system_names

const std::vector<SolverSystemName>& SIMPLESolveBase::_turbulence_system_names
protectedinherited

The names of the turbulence systems.

Definition at line 208 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve(), setupResidualStorage(), SIMPLESolveBase::SIMPLESolveBase(), and solve().

◆ _turbulence_system_numbers

std::vector<unsigned int> SIMPLESolveBase::_turbulence_system_numbers
protectedinherited

Definition at line 214 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve(), and solve().

◆ _turbulence_systems

std::vector<LinearSystem *> LinearAssemblySegregatedSolve::_turbulence_systems
protected

Pointer(s) to the system(s) corresponding to the turbulence equation(s)

Definition at line 188 of file LinearAssemblySegregatedSolve.h.

Referenced by SIMPLESolve::checkIntegrity(), LinearAssemblySegregatedSolve(), and solve().


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