https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
SIMPLESolveNonlinearAssembly Class Reference

SIMPLE-based solution object with nonlinear FV system assembly. More...

#include <SIMPLESolveNonlinearAssembly.h>

Inheritance diagram for SIMPLESolveNonlinearAssembly:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 SIMPLESolveNonlinearAssembly (Executioner &ex)
 
virtual void linkRhieChowUserObject () override
 Fetch the Rhie Chow user object that is reponsible for determining face velocities and mass flux. More...
 
virtual void checkIntegrity () override
 Check if the user defined time kernels. More...
 
virtual bool solve () override
 Performs the momentum pressure coupling. More...
 
virtual void setInnerSolve (SolveObject &) override
 
void setupPressurePin ()
 Setup pressure pin if there is need for one. More...
 
virtual void initialSetup ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (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
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) 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 T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (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 ()
 

Public Attributes

const ConsoleStream _console
 

Protected Member Functions

virtual std::vector< std::pair< unsigned int, Real > > solveMomentumPredictor () override
 Solve a momentum predictor step with a fixed pressure field. More...
 
virtual std::pair< unsigned int, RealsolvePressureCorrector () override
 Solve a pressure corrector step. More...
 
virtual void checkTimeKernels (NonlinearSystemBase &system)
 Check if the system contains time kernels. More...
 
std::pair< unsigned int, RealsolveAdvectedSystem (const unsigned int system_num, NonlinearSystemBase &system, const Real relaxation_factor, libMesh::SolverConfiguration &solver_config, const Real abs_tol)
 Solve an equation which contains an advection term that depends on the solution of the segregated Navier-Stokes equations. More...
 
std::pair< unsigned int, RealsolveSolidEnergySystem ()
 Solve the solid energy conservation equation. More...
 
void checkDependentParameterError (const std::string &main_parameter, const std::vector< std::string > &dependent_parameters, const bool should_be_defined)
 
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 UserObject &) const
 

Protected Attributes

std::vector< unsigned int_momentum_system_numbers
 The number(s) of the system(s) corresponding to the momentum equation(s) More...
 
std::vector< NonlinearSystemBase * > _momentum_systems
 Pointer(s) to the system(s) corresponding to the momentum equation(s) More...
 
const unsigned int _pressure_sys_number
 The number of the system corresponding to the pressure equation. More...
 
NonlinearSystemBase_pressure_system
 Reference to the nonlinear system corresponding to the pressure equation. More...
 
const bool _has_turbulence_systems
 Boolean for easy check if turbulence systems shall be solved or not. More...
 
const unsigned int _energy_sys_number
 The number of the system corresponding to the energy equation. More...
 
NonlinearSystemBase_energy_system
 Pointer to the nonlinear system corresponding to the fluid energy equation. More...
 
const unsigned int _solid_energy_sys_number
 The number of the system corresponding to the solid energy equation. More...
 
NonlinearSystemBase_solid_energy_system
 Pointer to the nonlinear system corresponding to the solid energy equation. More...
 
std::vector< NonlinearSystemBase * > _passive_scalar_systems
 Pointer(s) to the system(s) corresponding to the passive scalar equation(s) More...
 
const std::vector< SolverSystemName > & _turbulence_system_names
 The names of the turbulence scalar systems. More...
 
std::vector< unsigned int_turbulence_system_numbers
 
std::vector< NonlinearSystemBase * > _turbulence_systems
 Pointer(s) to the system(s) corresponding to the turbulence equation(s) More...
 
const std::vector< Real_turbulence_equation_relaxation
 The user-defined relaxation parameter(s) for the turbulence equation(s) More...
 
std::vector< Real_turbulence_field_min_limit
 The user-defined lower limit for turbulent quantities e.g. k, eps/omega, etc.. More...
 
Moose::PetscSupport::PetscOptions _turbulence_petsc_options
 Options which hold the petsc settings for the turbulence equation(s) More...
 
SIMPLESolverConfiguration _turbulence_linear_control
 Options for the linear solver of the turbulence equation(s) More...
 
const Real _turbulence_l_abs_tol
 Absolute linear tolerance for the turbulence equation(s). More...
 
const std::vector< Real_turbulence_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in turbulence equations. More...
 
INSFVRhieChowInterpolatorSegregated_rc_uo
 Pointer to the segregated RhieChow interpolation object. More...
 
const TagName _pressure_tag_name
 The name of the vector tag which corresponds to the pressure gradient terms in the momentum equation. More...
 
const TagID _pressure_tag_id
 The ID of the tag which corresponds to the pressure gradient terms in the momentum equation. More...
 
const std::vector< SolverSystemName > & _momentum_system_names
 The names of the momentum systems. More...
 
SIMPLESolverConfiguration _momentum_linear_control
 Options for the linear solver of the momentum equation. More...
 
const Real _momentum_l_abs_tol
 Absolute linear tolerance for the momentum equation(s). More...
 
Moose::PetscSupport::PetscOptions _momentum_petsc_options
 Options which hold the petsc settings for the momentum equation. More...
 
const Real _momentum_equation_relaxation
 The user-defined relaxation parameter for the momentum equation. More...
 
const SolverSystemName & _pressure_system_name
 The name of the pressure system. More...
 
SIMPLESolverConfiguration _pressure_linear_control
 Options for the linear solver of the pressure equation. More...
 
const Real _pressure_l_abs_tol
 Absolute linear tolerance for the pressure equation. More...
 
Moose::PetscSupport::PetscOptions _pressure_petsc_options
 Options which hold the petsc settings for the pressure equation. More...
 
const Real _pressure_variable_relaxation
 The user-defined relaxation parameter for the pressure variable. More...
 
const bool _pin_pressure
 If the pressure needs to be pinned. More...
 
const Real _pressure_pin_value
 The value we want to enforce for pressure. More...
 
dof_id_type _pressure_pin_dof
 The dof ID where the pressure needs to be pinned. More...
 
const bool _has_energy_system
 Boolean for easy check if a fluid energy system shall be solved or not. More...
 
const Real _energy_equation_relaxation
 The user-defined relaxation parameter for the energy equation. More...
 
Moose::PetscSupport::PetscOptions _energy_petsc_options
 Options which hold the petsc settings for the fluid energy equation. More...
 
SIMPLESolverConfiguration _energy_linear_control
 Options for the linear solver of the energy equation. More...
 
const Real _energy_l_abs_tol
 Absolute linear tolerance for the energy equations. More...
 
const bool _has_solid_energy_system
 Boolean for easy check if a solid energy system shall be solved or not. More...
 
Moose::PetscSupport::PetscOptions _solid_energy_petsc_options
 Options which hold the petsc settings for the fluid energy equation. More...
 
SIMPLESolverConfiguration _solid_energy_linear_control
 Options for the linear solver of the energy equation. More...
 
const Real _solid_energy_l_abs_tol
 Absolute linear tolerance for the energy equations. More...
 
const std::vector< SolverSystemName > & _passive_scalar_system_names
 The names of the passive scalar systems. More...
 
const bool _has_passive_scalar_systems
 Boolean for easy check if a passive scalar systems shall be solved or not. More...
 
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) More...
 
Moose::PetscSupport::PetscOptions _passive_scalar_petsc_options
 Options which hold the petsc settings for the passive scalar equation(s) More...
 
SIMPLESolverConfiguration _passive_scalar_linear_control
 Options for the linear solver of the passive scalar equation(s) More...
 
const Real _passive_scalar_l_abs_tol
 Absolute linear tolerance for the passive scalar equation(s). More...
 
const Real _momentum_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in momentum. More...
 
const Real _pressure_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in pressure. More...
 
const Real _energy_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in energy. More...
 
const Real _solid_energy_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in solid energy. More...
 
const std::vector< Real_passive_scalar_absolute_tolerance
 The user-defined absolute tolerance for determining the convergence in passive scalars. More...
 
const unsigned int _num_iterations
 The maximum number of momentum-pressure iterations. More...
 
const bool _continue_on_max_its
 If solve should continue if maximum number of iterations is hit. More...
 
const bool _print_fields
 Debug parameter which allows printing the coupling and solution vectors/matrices. More...
 
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
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 

Detailed Description

SIMPLE-based solution object with nonlinear FV system assembly.

Definition at line 20 of file SIMPLESolveNonlinearAssembly.h.

Constructor & Destructor Documentation

◆ SIMPLESolveNonlinearAssembly()

SIMPLESolveNonlinearAssembly::SIMPLESolveNonlinearAssembly ( Executioner ex)

Definition at line 107 of file SIMPLESolveNonlinearAssembly.C.

108  : SIMPLESolveBase(ex),
109  _pressure_sys_number(_problem.nlSysNum(getParam<SolverSystemName>("pressure_system"))),
111  _has_turbulence_systems(!getParam<std::vector<SolverSystemName>>("turbulence_systems").empty()),
113  ? _problem.nlSysNum(getParam<SolverSystemName>("energy_system"))
116  : nullptr),
119  ? _problem.nlSysNum(getParam<SolverSystemName>("solid_energy_system"))
123  : nullptr),
124  _turbulence_system_names(getParam<std::vector<SolverSystemName>>("turbulence_systems")),
125  _turbulence_equation_relaxation(getParam<std::vector<Real>>("turbulence_equation_relaxation")),
126  _turbulence_field_min_limit(getParam<std::vector<Real>>("turbulence_field_min_limit")),
127  _turbulence_l_abs_tol(getParam<Real>("turbulence_l_abs_tol")),
128  _turbulence_absolute_tolerance(getParam<std::vector<Real>>("turbulence_absolute_tolerance")),
129  _pressure_tag_name(getParam<TagName>("pressure_gradient_tag")),
131 {
132  // We disable this considering that this object passes petsc options a little differently
134 
135  // We fetch the system numbers for the momentum components plus add vectors
136  // for removing the contribution from the pressure gradient terms.
137  for (auto system_i : index_range(_momentum_system_names))
138  {
140  _momentum_systems.push_back(
142  _momentum_systems[system_i]->addVector(_pressure_tag_id, false, ParallelType::PARALLEL);
143 
144  // We disable this considering that this object passes petsc options a little differently
145  _momentum_systems[system_i]->system().prefix_with_name(false);
146  }
147 
149  for (auto system_i : index_range(_passive_scalar_system_names))
150  {
153  _passive_scalar_systems.push_back(
155 
156  // We disable this considering that this object passes petsc options a little differently
157  _passive_scalar_systems[system_i]->system().prefix_with_name(false);
158  }
159 
161  {
162  for (auto system_i : index_range(_turbulence_system_names))
163  {
165  _turbulence_systems.push_back(
167 
168  // We disable this considering that this object passes petsc options a little differently
169  _turbulence_systems[system_i]->system().prefix_with_name(false);
170  }
171 
172  // We check for input errors with regards to the turbulence equations. At the same time, we
173  // set up the corresponding system numbers
175  paramError("turbulence_equation_relaxation",
176  "The number of equation relaxation parameters does not match the number of "
177  "turbulence scalar equations!");
179  paramError("turbulence_absolute_tolerance",
180  "The number of absolute tolerances does not match the number of "
181  "turbulence equations!");
182  if (_turbulence_field_min_limit.empty())
183  // If no minimum bounds are given, initialize to default value 1e-8
185  else if (_turbulence_system_names.size() != _turbulence_field_min_limit.size())
186  paramError("turbulence_field_min_limit",
187  "The number of lower bounds for turbulent quantities does not match the "
188  "number of turbulence equations!");
189  }
190 
191  if (isParamValid("solid_energy_system") && !_has_energy_system)
192  paramError(
193  "solid_energy_system",
194  "We cannot solve a solid energy system without solving for the fluid energy as well!");
195 
197  {
198  const auto & turbulence_petsc_options = getParam<MultiMooseEnum>("turbulence_petsc_options");
199  const auto & turbulence_petsc_pair_options = getParam<MooseEnumItem, std::string>(
200  "turbulence_petsc_options_iname", "turbulence_petsc_options_value");
202  turbulence_petsc_options, "-", *this, _turbulence_petsc_options);
203  Moose::PetscSupport::addPetscPairsToPetscOptions(turbulence_petsc_pair_options,
204  _problem.mesh().dimension(),
205  "-",
206  *this,
208 
209  _turbulence_linear_control.real_valued_data["rel_tol"] = getParam<Real>("turbulence_l_tol");
210  _turbulence_linear_control.real_valued_data["abs_tol"] = getParam<Real>("turbulence_l_abs_tol");
212  getParam<unsigned int>("turbulence_l_max_its");
213  }
214  else
215  checkDependentParameterError("turbulence_system",
216  {"turbulence_petsc_options",
217  "turbulence_petsc_options_iname",
218  "turbulence_petsc_options_value",
219  "turbulence_l_tol",
220  "turbulence_l_abs_tol",
221  "turbulence_l_max_its",
222  "turbulence_equation_relaxation",
223  "turbulence_absolute_tolerance"},
224  false);
225 }
const unsigned int _energy_sys_number
The number of the system corresponding to the energy equation.
FEProblemBase & _problem
const TagID _pressure_tag_id
The ID of the tag which corresponds to the pressure gradient terms in the momentum equation...
const unsigned int invalid_uint
const bool _has_energy_system
Boolean for easy check if a fluid energy system shall be solved or not.
std::vector< Real > _turbulence_field_min_limit
The user-defined lower limit for turbulent quantities e.g. k, eps/omega, etc..
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
std::vector< unsigned int > _turbulence_system_numbers
void checkDependentParameterError(const std::string &main_parameter, const std::vector< std::string > &dependent_parameters, const bool should_be_defined)
const unsigned int _solid_energy_sys_number
The number of the system corresponding to the solid energy equation.
const Real _turbulence_l_abs_tol
Absolute linear tolerance for the turbulence equation(s).
NonlinearSystemBase & _pressure_system
Reference to the nonlinear system corresponding to the pressure equation.
std::map< std::string, Real > real_valued_data
bool isParamValid(const std::string &name) const
const TagName _pressure_tag_name
The name of the vector tag which corresponds to the pressure gradient terms in the momentum equation...
const std::vector< SolverSystemName > & _passive_scalar_system_names
The names of the passive scalar systems.
SIMPLESolverConfiguration _turbulence_linear_control
Options for the linear solver of the turbulence equation(s)
virtual unsigned int dimension() const
std::map< std::string, int > int_valued_data
const bool _has_turbulence_systems
Boolean for easy check if turbulence systems shall be solved or not.
const T & getParam(const std::string &name) const
const std::vector< SolverSystemName > & _turbulence_system_names
The names of the turbulence scalar systems.
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
void paramError(const std::string &param, Args... args) const
const std::vector< SolverSystemName > & _momentum_system_names
The names of the momentum systems.
NonlinearSystemBase * _solid_energy_system
Pointer to the nonlinear system corresponding to the solid energy equation.
SIMPLESolveBase(Executioner &ex)
NonlinearSystemBase * _energy_system
Pointer to the nonlinear system corresponding to the fluid energy equation.
void addPetscPairsToPetscOptions(const std::vector< std::pair< MooseEnumItem, std::string >> &petsc_pair_options, const unsigned int mesh_dimension, const std::string &prefix, const ParallelParamObject &param_object, PetscOptions &petsc_options)
std::vector< NonlinearSystemBase * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
virtual MooseMesh & mesh() override
const bool _has_passive_scalar_systems
Boolean for easy check if a passive scalar systems shall be solved or not.
void addPetscFlagsToPetscOptions(const MultiMooseEnum &petsc_flags, const std::string &prefix, const ParallelParamObject &param_object, PetscOptions &petsc_options)
Moose::PetscSupport::PetscOptions _turbulence_petsc_options
Options which hold the petsc settings for the turbulence equation(s)
const unsigned int _pressure_sys_number
The number of the system corresponding to the pressure equation.
void prefix_with_name(bool value)
const std::vector< Real > _turbulence_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in turbulence equations...
const std::vector< Real > _turbulence_equation_relaxation
The user-defined relaxation parameter(s) for the turbulence equation(s)
std::vector< NonlinearSystemBase * > _passive_scalar_systems
Pointer(s) to the system(s) corresponding to the passive scalar equation(s)
auto index_range(const T &sizable)
std::vector< NonlinearSystemBase * > _turbulence_systems
Pointer(s) to the system(s) corresponding to the turbulence equation(s)
std::vector< unsigned int > _momentum_system_numbers
The number(s) of the system(s) corresponding to the momentum equation(s)
std::vector< unsigned int > _passive_scalar_system_numbers
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
const bool _has_solid_energy_system
Boolean for easy check if a solid energy system shall be solved or not.
virtual libMesh::System & system() override

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 487 of file SIMPLESolveBase.C.

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

490 {
491  for (const auto & param : dependent_parameters)
492  if (parameters().isParamSetByUser(param) == !should_be_defined)
493  paramError(param,
494  "This parameter should " + std::string(should_be_defined ? "" : "not") +
495  " be given by the user with the corresponding " + main_parameter +
496  " setting!");
497 }
void paramError(const std::string &param, Args... args) const
bool isParamSetByUser(const std::string &nm) const
const InputParameters & parameters() const

◆ checkIntegrity()

void SIMPLESolveNonlinearAssembly::checkIntegrity ( )
overridevirtual

Check if the user defined time kernels.

Reimplemented from SIMPLESolveBase.

Definition at line 775 of file SIMPLESolveNonlinearAssembly.C.

Referenced by SIMPLENonlinearAssembly::init().

776 {
777  // check to make sure that we don't have any time kernels in this simulation (Steady State)
778  for (const auto system : _momentum_systems)
779  checkTimeKernels(*system);
780 
782 
783  if (_has_energy_system)
784  {
788  }
789 
791  for (const auto system : _passive_scalar_systems)
792  checkTimeKernels(*system);
793 
795  for (const auto system : _turbulence_systems)
796  checkTimeKernels(*system);
797 }
const bool _has_energy_system
Boolean for easy check if a fluid energy system shall be solved or not.
virtual void checkTimeKernels(NonlinearSystemBase &system)
Check if the system contains time kernels.
NonlinearSystemBase & _pressure_system
Reference to the nonlinear system corresponding to the pressure equation.
const bool _has_turbulence_systems
Boolean for easy check if turbulence systems shall be solved or not.
NonlinearSystemBase * _solid_energy_system
Pointer to the nonlinear system corresponding to the solid energy equation.
NonlinearSystemBase * _energy_system
Pointer to the nonlinear system corresponding to the fluid energy equation.
std::vector< NonlinearSystemBase * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
const bool _has_passive_scalar_systems
Boolean for easy check if a passive scalar systems shall be solved or not.
std::vector< NonlinearSystemBase * > _passive_scalar_systems
Pointer(s) to the system(s) corresponding to the passive scalar equation(s)
std::vector< NonlinearSystemBase * > _turbulence_systems
Pointer(s) to the system(s) corresponding to the turbulence equation(s)
const bool _has_solid_energy_system
Boolean for easy check if a solid energy system shall be solved or not.

◆ checkTimeKernels()

void SIMPLESolveNonlinearAssembly::checkTimeKernels ( NonlinearSystemBase system)
protectedvirtual

Check if the system contains time kernels.

Definition at line 800 of file SIMPLESolveNonlinearAssembly.C.

Referenced by checkIntegrity().

801 {
802  // check to make sure that we don't have any time kernels in this simulation (Steady State)
803  if (system.containsTimeKernel())
804  mooseError("You have specified time kernels in your steady state simulation in system",
805  system.name());
806 }
virtual const std::string & name() const
virtual bool containsTimeKernel() override
void mooseError(Args &&... args) const

◆ linkRhieChowUserObject()

void SIMPLESolveNonlinearAssembly::linkRhieChowUserObject ( )
overridevirtual

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

Implements SIMPLESolveBase.

Definition at line 228 of file SIMPLESolveNonlinearAssembly.C.

Referenced by SIMPLENonlinearAssembly::init().

229 {
230  // Fetch the segregated rhie-chow object and transfer some information about the momentum
231  // system(s)
233  &getUserObject<INSFVRhieChowInterpolatorSegregated>("rhie_chow_user_object"));
235 
236  // Initialize the face velocities in the RC object
238 }
const TagID _pressure_tag_id
The ID of the tag which corresponds to the pressure gradient terms in the momentum equation...
INSFVRhieChowInterpolatorSegregated * _rc_uo
Pointer to the segregated RhieChow interpolation object.
std::vector< NonlinearSystemBase * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
std::vector< unsigned int > _momentum_system_numbers
The number(s) of the system(s) corresponding to the momentum equation(s)
A user object which implements the Rhie Chow interpolation for segregated momentum-pressure systems...
void linkMomentumSystem(std::vector< NonlinearSystemBase *> momentum_systems, const std::vector< unsigned int > &momentum_system_numbers, const TagID pressure_gradient_tag)
Update the momentum system-related information.
void initFaceVelocities()
Initialize the container for face velocities.

◆ 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 478 of file SIMPLESolveBase.C.

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

479 {
480  if (_pin_pressure)
482  _problem.mesh(),
483  getParam<Point>("pressure_pin_point"));
484 }
FEProblemBase & _problem
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...
virtual MooseMesh & mesh() override

◆ solve()

bool SIMPLESolveNonlinearAssembly::solve ( )
overridevirtual

Performs the momentum pressure coupling.

Returns
True if solver is converged.

Implements SolveObject.

Definition at line 517 of file SIMPLESolveNonlinearAssembly.C.

518 {
519  // Dummy solver parameter file which is needed for switching petsc options
520  SolverParams solver_params;
521  solver_params._type = Moose::SolveType::ST_LINEAR;
522  solver_params._line_search = Moose::LineSearchType::LS_NONE;
523 
524  // Initialize the quantities which matter in terms of the iteration
525  unsigned int iteration_counter = 0;
526 
527  // Assign residuals to general residual vector
528  unsigned int no_systems =
531  no_systems += _turbulence_systems.size();
532  std::vector<std::pair<unsigned int, Real>> ns_its_residuals(no_systems, std::make_pair(0, 1.0));
533  std::vector<Real> ns_abs_tols(_momentum_systems.size(), _momentum_absolute_tolerance);
534  ns_abs_tols.push_back(_pressure_absolute_tolerance);
535  if (_has_energy_system)
536  {
537  ns_abs_tols.push_back(_energy_absolute_tolerance);
539  ns_abs_tols.push_back(_solid_energy_absolute_tolerance);
540  }
542  for (auto system_i : index_range(_turbulence_absolute_tolerance))
543  ns_abs_tols.push_back(_turbulence_absolute_tolerance[system_i]);
544 
545  bool converged = false;
546  // Loop until converged or hit the maximum allowed iteration number
547  while (iteration_counter < _num_iterations && !converged)
548  {
549  iteration_counter++;
550  // Resdiual index
551  size_t residual_index = 0;
552 
553  // Execute all objects tagged as nonlinear
554  // This will execute everything in the problem at nonlinear, including the aux kernels.
555  // This way we compute the aux kernels before the momentum equations are solved.
556  _problem.execute(EXEC_NONLINEAR);
557 
558  // We clear the caches in the momentum and pressure variables
559  for (auto system_i : index_range(_momentum_systems))
560  _momentum_systems[system_i]->residualSetup();
562 
563  // If we solve for energy, we clear the caches there too
564  if (_has_energy_system)
565  {
569  }
570 
571  // If we solve for turbulence, we clear the caches there too
573  for (auto system_i : index_range(_turbulence_systems))
574  _turbulence_systems[system_i]->residualSetup();
575 
576  // We set the preconditioner/controllable parameters through petsc options. Linear
577  // tolerances will be overridden within the solver. In case of a segregated momentum
578  // solver, we assume that every velocity component uses the same preconditioner
580 
581  // Solve the momentum predictor step
582  auto momentum_residual = solveMomentumPredictor();
583  for (const auto system_i : index_range(momentum_residual))
584  ns_its_residuals[system_i] = momentum_residual[system_i];
585 
586  // Compute the coupling fields between the momentum and pressure equations
588 
589  // We set the preconditioner/controllable parameters for the pressure equations through
590  // petsc options. Linear tolerances will be overridden within the solver.
592 
593  // Solve the pressure corrector
594  ns_its_residuals[momentum_residual.size()] = solvePressureCorrector();
595  // We need this to make sure we evaluate cell gradients for the nonorthogonal correction in
596  // the face velocity update
598 
599  // Compute the face velocity which is used in the advection terms
601 
602  auto & pressure_current_solution = *(_pressure_system.system().current_local_solution.get());
603  auto & pressure_old_solution = *(_pressure_system.solutionPreviousNewton());
604  // Relax the pressure update for the next momentum predictor
606  pressure_current_solution, pressure_old_solution, _pressure_variable_relaxation);
607 
608  // Overwrite old solution
609  pressure_old_solution = pressure_current_solution;
610  _pressure_system.setSolution(pressure_current_solution);
611 
612  // We clear out the caches so that the gradients can be computed with the relaxed solution
614 
615  // Reconstruct the cell velocity as well to accelerate convergence
617 
618  // Update residual index
619  residual_index = momentum_residual.size();
620 
621  // If we have an energy equation, solve it here. We assume the material properties in the
622  // Navier-Stokes equations depend on temperature, therefore we can not solve for temperature
623  // outside of the velocity-pressure loop
624  if (_has_energy_system)
625  {
626  // We set the preconditioner/controllable parameters through petsc options. Linear
627  // tolerances will be overridden within the solver.
629  residual_index += 1;
630  ns_its_residuals[residual_index] = solveAdvectedSystem(_energy_sys_number,
635 
637  {
638  // We set the preconditioner/controllable parameters through petsc options. Linear
639  // tolerances will be overridden within the solver.
641  residual_index += 1;
642  ns_its_residuals[residual_index] = solveSolidEnergySystem();
643  }
644  }
645 
646  // If we have an turbulence equations, we solve it here. We solve it inside the
647  // momentum-pressure loop because it affects the turbulent viscosity
649  {
651 
652  for (auto system_i : index_range(_turbulence_systems))
653  {
654  residual_index += 1;
655  ns_its_residuals[residual_index] =
657  *_turbulence_systems[system_i],
661 
662  auto & current_solution =
663  *(_turbulence_systems[system_i]->system().current_local_solution.get());
664  NS::FV::limitSolutionUpdate(current_solution, _turbulence_field_min_limit[system_i]);
665 
666  // Relax the turbulence update for the next momentum predictor
667  auto & old_solution = *(_turbulence_systems[system_i]->solutionPreviousNewton());
668 
669  // Relax the pressure update for the next momentum predictor
671  current_solution, old_solution, _turbulence_equation_relaxation[system_i]);
672 
673  // Overwrite old solution
674  old_solution = current_solution;
675  _turbulence_systems[system_i]->setSolution(current_solution);
676 
677  // We clear out the caches so that the gradients can be computed with the relaxed solution
678  _turbulence_systems[system_i]->residualSetup();
679  }
680  }
681 
682  // Printing residuals
683  residual_index = 0;
684  _console << "Iteration " << iteration_counter << " Initial residual norms:" << std::endl;
685  for (auto system_i : index_range(_momentum_systems))
686  _console << " Momentum equation:"
687  << (_momentum_systems.size() > 1
688  ? std::string(" Component ") + std::to_string(system_i + 1) +
689  std::string(" ")
690  : std::string(" "))
691  << COLOR_GREEN << ns_its_residuals[system_i].second << COLOR_DEFAULT << std::endl;
692  _console << " Pressure equation: " << COLOR_GREEN
693  << ns_its_residuals[momentum_residual.size()].second << COLOR_DEFAULT << std::endl;
694  residual_index = momentum_residual.size();
695 
696  if (_has_energy_system)
697  {
698  residual_index += 1;
699  _console << " Energy equation: " << COLOR_GREEN << ns_its_residuals[residual_index].second
700  << COLOR_DEFAULT << std::endl;
702  {
703  residual_index += 1;
704  _console << " Solid energy equation: " << COLOR_GREEN
705  << ns_its_residuals[residual_index].second << COLOR_DEFAULT << std::endl;
706  }
707  }
708 
710  {
711  _console << "Turbulence Iteration " << std::endl;
712  for (auto system_i : index_range(_turbulence_systems))
713  {
714  residual_index += 1;
715  _console << _turbulence_systems[system_i]->name() << " " << COLOR_GREEN
716  << ns_its_residuals[residual_index].second << COLOR_DEFAULT << std::endl;
717  }
718  }
719 
720  converged = NS::FV::converged(ns_its_residuals, ns_abs_tols);
721  }
722 
724 
725  // Now we solve for the passive scalar equations, they should not influence the solution of the
726  // system above. The reason why we need more than one iteration is due to the matrix relaxation
727  // which can be used to stabilize the equations
729  {
730  _console << " Passive Scalar Iteration " << iteration_counter << std::endl;
731 
732  // We set the options used by Petsc (preconditioners etc). We assume that every passive
733  // scalar equation uses the same options for now.
735 
736  iteration_counter = 0;
737  std::vector<std::pair<unsigned int, Real>> passive_scalar_residuals(
738  _passive_scalar_systems.size(), std::make_pair(0, 1.0));
739 
740  bool passive_scalar_converged =
741  NS::FV::converged(passive_scalar_residuals, _passive_scalar_absolute_tolerance);
742  while (iteration_counter < _num_iterations && !passive_scalar_converged)
743  {
744  // We clear the caches in the passive scalar variables
745  for (auto system_i : index_range(_passive_scalar_systems))
746  _passive_scalar_systems[system_i]->residualSetup();
747 
748  iteration_counter++;
749 
750  // Solve the passive scalar equations
751  for (auto system_i : index_range(_passive_scalar_systems))
752  passive_scalar_residuals[system_i] =
754  *_passive_scalar_systems[system_i],
758 
759  _console << "Iteration " << iteration_counter << " Initial residual norms:" << std::endl;
760  for (auto system_i : index_range(_passive_scalar_systems))
761  _console << _passive_scalar_systems[system_i]->name() << " " << COLOR_GREEN
762  << passive_scalar_residuals[system_i].second << COLOR_DEFAULT << std::endl;
763 
764  passive_scalar_converged =
765  NS::FV::converged(passive_scalar_residuals, _passive_scalar_absolute_tolerance);
766  }
767 
768  converged = _continue_on_max_its ? true : passive_scalar_converged;
769  }
770 
771  return converged;
772 }
const unsigned int _energy_sys_number
The number of the system corresponding to the energy equation.
FEProblemBase & _problem
const Real _energy_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in energy.
const unsigned int _num_iterations
The maximum number of momentum-pressure iterations.
SIMPLESolverConfiguration _energy_linear_control
Options for the linear solver of the energy equation.
const bool _print_fields
Debug parameter which allows printing the coupling and solution vectors/matrices. ...
INSFVRhieChowInterpolatorSegregated * _rc_uo
Pointer to the segregated RhieChow interpolation object.
const bool _has_energy_system
Boolean for easy check if a fluid energy system shall be solved or not.
Moose::LineSearchType _line_search
const Real _passive_scalar_l_abs_tol
Absolute linear tolerance for the passive scalar equation(s).
std::vector< Real > _turbulence_field_min_limit
The user-defined lower limit for turbulent quantities e.g. k, eps/omega, etc..
std::vector< unsigned int > _turbulence_system_numbers
void setSolution(const NumericVector< Number > &soln)
const Real _turbulence_l_abs_tol
Absolute linear tolerance for the turbulence equation(s).
NonlinearSystemBase & _pressure_system
Reference to the nonlinear system corresponding to the pressure equation.
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.
const Real _pressure_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in pressure.
const Real _pressure_variable_relaxation
The user-defined relaxation parameter for the pressure variable.
const Real _momentum_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in momentum.
SIMPLESolverConfiguration _turbulence_linear_control
Options for the linear solver of the turbulence equation(s)
void computeFaceVelocity()
Update the values of the face velocities in the containers.
SIMPLESolverConfiguration _passive_scalar_linear_control
Options for the linear solver of the passive scalar equation(s)
virtual void execute(const ExecFlagType &exec_type)
Moose::PetscSupport::PetscOptions _energy_petsc_options
Options which hold the petsc settings for the fluid energy equation.
Moose::PetscSupport::PetscOptions _passive_scalar_petsc_options
Options which hold the petsc settings for the passive scalar equation(s)
const bool _has_turbulence_systems
Boolean for easy check if turbulence systems shall be solved or not.
Moose::PetscSupport::PetscOptions _momentum_petsc_options
Options which hold the petsc settings for the momentum equation.
const std::vector< Real > _passive_scalar_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in passive scalars.
Moose::SolveType _type
const Real _energy_l_abs_tol
Absolute linear tolerance for the energy equations.
std::pair< unsigned int, Real > solveSolidEnergySystem()
Solve the solid energy conservation equation.
void petscSetOptions(const PetscOptions &po, const SolverParams &solver_params, FEProblemBase *const problem=nullptr)
NonlinearSystemBase * _solid_energy_system
Pointer to the nonlinear system corresponding to the solid energy equation.
const std::vector< Real > _passive_scalar_equation_relaxation
The user-defined relaxation parameter(s) for the passive scalar equation(s)
NonlinearSystemBase * _energy_system
Pointer to the nonlinear system corresponding to the fluid energy equation.
const Real _energy_equation_relaxation
The user-defined relaxation parameter for the energy equation.
std::vector< NonlinearSystemBase * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
void computeCellVelocity()
Update the cell values of the velocity variables.
std::pair< unsigned int, Real > solveAdvectedSystem(const unsigned int system_num, NonlinearSystemBase &system, const Real relaxation_factor, libMesh::SolverConfiguration &solver_config, const Real abs_tol)
Solve an equation which contains an advection term that depends on the solution of the segregated Nav...
std::unique_ptr< NumericVector< Number > > current_local_solution
virtual const NumericVector< Number > * solutionPreviousNewton() const
const bool _has_passive_scalar_systems
Boolean for easy check if a passive scalar systems shall be solved or not.
const ConsoleStream _console
const Real _solid_energy_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in solid energy.
const bool _continue_on_max_its
If solve should continue if maximum number of iterations is hit.
Moose::PetscSupport::PetscOptions _turbulence_petsc_options
Options which hold the petsc settings for the turbulence equation(s)
const std::vector< Real > _turbulence_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in turbulence equations...
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 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}+ (u - u_{old})$...
const std::vector< Real > _turbulence_equation_relaxation
The user-defined relaxation parameter(s) for the turbulence equation(s)
void computeHbyA(bool verbose)
Computes the inverse of the digaonal (1/A) of the system matrix plus the H/A components for the press...
std::vector< NonlinearSystemBase * > _passive_scalar_systems
Pointer(s) to the system(s) corresponding to the passive scalar equation(s)
auto index_range(const T &sizable)
std::vector< NonlinearSystemBase * > _turbulence_systems
Pointer(s) to the system(s) corresponding to the turbulence equation(s)
std::vector< unsigned int > _passive_scalar_system_numbers
Moose::PetscSupport::PetscOptions _pressure_petsc_options
Options which hold the petsc settings for the pressure equation.
const bool _has_solid_energy_system
Boolean for easy check if a solid energy system shall be solved or not.
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 void residualSetup() override
virtual libMesh::System & system() override

◆ solveAdvectedSystem()

std::pair< unsigned int, Real > SIMPLESolveNonlinearAssembly::solveAdvectedSystem ( const unsigned int  system_num,
NonlinearSystemBase system,
const Real  relaxation_factor,
libMesh::SolverConfiguration solver_config,
const Real  abs_tol 
)
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
Returns
The normalized residual norm of the equation.

Definition at line 387 of file SIMPLESolveNonlinearAssembly.C.

Referenced by solve().

392 {
394 
395  // We will need some members from the implicit nonlinear system
396  NonlinearImplicitSystem & ni_system =
397  libMesh::cast_ref<NonlinearImplicitSystem &>(system.system());
398 
399  // We will need the solution, the right hand side and the matrix
400  NumericVector<Number> & current_local_solution = *(ni_system.current_local_solution);
401  NumericVector<Number> & solution = *(ni_system.solution);
402  SparseMatrix<Number> & mmat = *(ni_system.matrix);
403  NumericVector<Number> & rhs = *(ni_system.rhs);
404 
405  // We need a vector that stores the (diagonal_relaxed-original_diagonal) vector
406  auto diff_diagonal = solution.zero_clone();
407 
408  // Fetch the linear solver from the system
409  PetscLinearSolver<Real> & linear_solver =
410  libMesh::cast_ref<PetscLinearSolver<Real> &>(*ni_system.get_linear_solver());
411 
412  // We need a zero vector to be able to emulate the Ax=b system by evaluating the
413  // residual and jacobian. Unfortunately, this will leave us with the -b on the right hand side
414  // so we correct it by multiplying it with (-1)
415  auto zero_solution = current_local_solution.zero_clone();
416  _problem.computeResidualAndJacobian(*zero_solution, rhs, mmat);
417  rhs.scale(-1.0);
418 
419  // Go and relax the system matrix and the right hand side
420  NS::FV::relaxMatrix(mmat, relaxation_factor, *diff_diagonal);
421  NS::FV::relaxRightHandSide(rhs, solution, *diff_diagonal);
422 
423  if (_print_fields)
424  {
425  _console << system.name() << " system matrix" << std::endl;
426  mmat.print();
427  }
428 
429  // We compute the normalization factors based on the fluxes
430  Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
431 
432  // We need the non-preconditioned norm to be consistent with the norm factor
433  LibmeshPetscCall(KSPSetNormType(linear_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
434 
435  // Setting the linear tolerances and maximum iteration counts
436  solver_config.real_valued_data["abs_tol"] = absolute_tol * norm_factor;
437  linear_solver.set_solver_configuration(solver_config);
438 
439  // Solve the system and update current local solution
440  auto its_res_pair = linear_solver.solve(mmat, mmat, solution, rhs);
441  ni_system.update();
442 
443  if (_print_fields)
444  {
445  _console << " rhs when we solve " << system.name() << std::endl;
446  rhs.print();
447  _console << system.name() << " solution " << std::endl;
448  solution.print();
449  _console << " Norm factor " << norm_factor << std::endl;
450  }
451 
452  system.setSolution(current_local_solution);
453 
454  return std::make_pair(its_res_pair.first, linear_solver.get_initial_residual() / norm_factor);
455 }
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...
FEProblemBase & _problem
const bool _print_fields
Debug parameter which allows printing the coupling and solution vectors/matrices. ...
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...
virtual std::unique_ptr< NumericVector< T > > zero_clone() const=0
NumericVector< Number > * rhs
void setSolution(const NumericVector< Number > &soln)
virtual LinearSolver< Number > * get_linear_solver() const
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
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...
std::map< std::string, Real > real_valued_data
virtual const std::string & name() const
virtual void scale(const T factor)=0
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
std::unique_ptr< NumericVector< Number > > solution
virtual void print(std::ostream &os=libMesh::out) const
void set_solver_configuration(SolverConfiguration &solver_configuration)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SparseMatrix< Number > * matrix
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
std::unique_ptr< NumericVector< Number > > current_local_solution
const ConsoleStream _console
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
virtual libMesh::System & system() override

◆ solveMomentumPredictor()

std::vector< std::pair< unsigned int, Real > > SIMPLESolveNonlinearAssembly::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 241 of file SIMPLESolveNonlinearAssembly.C.

Referenced by solve().

242 {
243  // Temporary storage for the (flux-normalized) residuals form
244  // different momentum components
245  std::vector<std::pair<unsigned int, Real>> its_normalized_residuals;
246 
247  // We can create this here with the assumption that every momentum component has the same number
248  // of dofs
249  auto zero_solution = _momentum_systems[0]->system().current_local_solution->zero_clone();
250 
251  // Solve the momentum equations.
252  // TO DO: These equations are VERY similar. If we can store the differences (things coming from
253  // BCs for example) separately, it is enough to construct one matrix.
254  for (const auto system_i : index_range(_momentum_systems))
255  {
257 
258  // We will need the right hand side and the solution of the next component
259  NonlinearImplicitSystem & momentum_system =
260  libMesh::cast_ref<NonlinearImplicitSystem &>(_momentum_systems[system_i]->system());
261 
262  PetscLinearSolver<Real> & momentum_solver =
263  libMesh::cast_ref<PetscLinearSolver<Real> &>(*momentum_system.get_linear_solver());
264 
265  NumericVector<Number> & solution = *(momentum_system.solution);
266  NumericVector<Number> & rhs = *(momentum_system.rhs);
267  SparseMatrix<Number> & mmat = *(momentum_system.matrix);
268 
269  auto diff_diagonal = solution.zero_clone();
270 
271  // We plug zero in this to get the system matrix and the right hand side of the linear problem
272  _problem.computeResidualAndJacobian(*zero_solution, rhs, mmat);
273  // Sadly, this returns -b so we multiply with -1
274  rhs.scale(-1.0);
275 
276  // Still need to relax the right hand side with the same vector
277  NS::FV::relaxMatrix(mmat, _momentum_equation_relaxation, *diff_diagonal);
278  NS::FV::relaxRightHandSide(rhs, solution, *diff_diagonal);
279 
280  // The normalization factor depends on the right hand side so we need to recompute it for this
281  // component
282  Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
283 
284  // Very important, for deciding the convergence, we need the unpreconditioned
285  // norms in the linear solve
286  LibmeshPetscCall(KSPSetNormType(momentum_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
287  // Solve this component. We don't update the ghosted solution yet, that will come at the end
288  // of the corrector step. Also setting the linear tolerances and maximum iteration counts.
290  momentum_solver.set_solver_configuration(_momentum_linear_control);
291 
292  // We solve the equation
293  auto its_resid_pair = momentum_solver.solve(mmat, mmat, solution, rhs);
294  momentum_system.update();
295 
296  // Save the normalized residual
297  its_normalized_residuals.push_back(
298  std::make_pair(its_resid_pair.first, momentum_solver.get_initial_residual() / norm_factor));
299 
300  if (_print_fields)
301  {
302  _console << " matrix when we solve " << std::endl;
303  mmat.print();
304  _console << " rhs when we solve " << std::endl;
305  rhs.print();
306  _console << " velocity solution component " << system_i << std::endl;
307  solution.print();
308  _console << "Norm factor " << norm_factor << std::endl;
309  _console << Moose::stringify(momentum_solver.get_initial_residual()) << std::endl;
310  }
311  }
312 
313  for (const auto system_i : index_range(_momentum_systems))
314  {
315  NonlinearImplicitSystem & momentum_system =
316  libMesh::cast_ref<NonlinearImplicitSystem &>(_momentum_systems[system_i]->system());
317  _momentum_systems[system_i]->setSolution(*(momentum_system.current_local_solution));
318  _momentum_systems[system_i]->copyPreviousNonlinearSolutions();
319  }
320 
321  return its_normalized_residuals;
322 }
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...
FEProblemBase & _problem
SIMPLESolverConfiguration _momentum_linear_control
Options for the linear solver of the momentum equation.
const bool _print_fields
Debug parameter which allows printing the coupling and solution vectors/matrices. ...
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...
const Real _momentum_equation_relaxation
The user-defined relaxation parameter for the momentum equation.
NumericVector< Number > * rhs
const Real _momentum_l_abs_tol
Absolute linear tolerance for the momentum equation(s).
virtual LinearSolver< Number > * get_linear_solver() const
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...
std::map< std::string, Real > real_valued_data
virtual void scale(const T factor)=0
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
virtual std::unique_ptr< SparseMatrix< T > > zero_clone() const=0
std::unique_ptr< NumericVector< Number > > solution
virtual void print(std::ostream &os=libMesh::out) const
std::string stringify(const T &t)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SparseMatrix< Number > * matrix
std::vector< NonlinearSystemBase * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
std::unique_ptr< NumericVector< Number > > current_local_solution
const ConsoleStream _console
auto index_range(const T &sizable)
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
std::vector< unsigned int > _momentum_system_numbers
The number(s) of the system(s) corresponding to the momentum equation(s)

◆ solvePressureCorrector()

std::pair< unsigned int, Real > SIMPLESolveNonlinearAssembly::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 325 of file SIMPLESolveNonlinearAssembly.C.

Referenced by solve().

326 {
328 
329  // We will need some members from the implicit nonlinear system
330  NonlinearImplicitSystem & pressure_system =
331  libMesh::cast_ref<NonlinearImplicitSystem &>(_pressure_system.system());
332 
333  // We will need the solution, the right hand side and the matrix
334  NumericVector<Number> & current_local_solution = *(pressure_system.current_local_solution);
335  NumericVector<Number> & solution = *(pressure_system.solution);
336  SparseMatrix<Number> & mmat = *(pressure_system.matrix);
337  NumericVector<Number> & rhs = *(pressure_system.rhs);
338 
339  // Fetch the linear solver from the system
340  PetscLinearSolver<Real> & pressure_solver =
341  libMesh::cast_ref<PetscLinearSolver<Real> &>(*pressure_system.get_linear_solver());
342 
343  // We need a zero vector to be able to emulate the Ax=b system by evaluating the
344  // residual and jacobian. Unfortunately, this will leave us with the -b on the right hand side
345  // so we correct it by multiplying it with (-1)
346  auto zero_solution = current_local_solution.zero_clone();
347  _problem.computeResidualAndJacobian(*zero_solution, rhs, mmat);
348  rhs.scale(-1.0);
349 
350  if (_print_fields)
351  {
352  _console << "Pressure matrix" << std::endl;
353  mmat.print();
354  }
355 
356  // We compute the normalization factors based on the fluxes
357  Real norm_factor = NS::FV::computeNormalizationFactor(solution, mmat, rhs);
358 
359  // We need the non-preconditioned norm to be consistent with the norm factor
360  LibmeshPetscCall(KSPSetNormType(pressure_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
361 
362  // Setting the linear tolerances and maximum iteration counts
365 
366  if (_pin_pressure)
368 
369  auto its_res_pair = pressure_solver.solve(mmat, mmat, solution, rhs);
370  pressure_system.update();
371 
372  if (_print_fields)
373  {
374  _console << " rhs when we solve pressure " << std::endl;
375  rhs.print();
376  _console << " Pressure " << std::endl;
377  solution.print();
378  _console << "Norm factor " << norm_factor << std::endl;
379  }
380 
381  _pressure_system.setSolution(current_local_solution);
382 
383  return std::make_pair(its_res_pair.first, pressure_solver.get_initial_residual() / norm_factor);
384 }
FEProblemBase & _problem
const bool _print_fields
Debug parameter which allows printing the coupling and solution vectors/matrices. ...
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...
NumericVector< Number > * rhs
void setSolution(const NumericVector< Number > &soln)
virtual LinearSolver< Number > * get_linear_solver() const
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
NonlinearSystemBase & _pressure_system
Reference to the nonlinear system corresponding to the pressure equation.
std::map< std::string, Real > real_valued_data
virtual void scale(const T factor)=0
SIMPLESolverConfiguration _pressure_linear_control
Options for the linear solver of the pressure equation.
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
const Real _pressure_l_abs_tol
Absolute linear tolerance for the pressure equation.
std::unique_ptr< NumericVector< Number > > solution
dof_id_type _pressure_pin_dof
The dof ID where the pressure needs to be pinned.
virtual void print(std::ostream &os=libMesh::out) const
const bool _pin_pressure
If the pressure needs to be pinned.
void set_solver_configuration(SolverConfiguration &solver_configuration)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SparseMatrix< Number > * matrix
const Real _pressure_pin_value
The value we want to enforce for pressure.
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
std::unique_ptr< NumericVector< Number > > current_local_solution
const ConsoleStream _console
const unsigned int _pressure_sys_number
The number of the system corresponding to the pressure equation.
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...
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
virtual libMesh::System & system() override

◆ solveSolidEnergySystem()

std::pair< unsigned int, Real > SIMPLESolveNonlinearAssembly::solveSolidEnergySystem ( )
protected

Solve the solid energy conservation equation.

Returns
The normalized residual norm of the solid equation.

Definition at line 458 of file SIMPLESolveNonlinearAssembly.C.

Referenced by solve().

459 {
461 
462  // We will need some members from the implicit nonlinear system
463  NonlinearImplicitSystem & se_system =
464  libMesh::cast_ref<NonlinearImplicitSystem &>(_solid_energy_system->system());
465 
466  // We will need the solution, the right hand side and the matrix
467  NumericVector<Number> & current_local_solution = *(se_system.current_local_solution);
468  NumericVector<Number> & solution = *(se_system.solution);
469  SparseMatrix<Number> & mat = *(se_system.matrix);
470  NumericVector<Number> & rhs = *(se_system.rhs);
471 
472  // Fetch the linear solver from the system
473  PetscLinearSolver<Real> & se_solver =
474  libMesh::cast_ref<PetscLinearSolver<Real> &>(*se_system.get_linear_solver());
475 
476  // We need a zero vector to be able to emulate the Ax=b system by evaluating the
477  // residual and jacobian. Unfortunately, this will leave us with the -b on the righ hand side
478  // so we correct it by multiplying it with (-1)
479  auto zero_solution = current_local_solution.zero_clone();
480  _problem.computeResidualAndJacobian(*zero_solution, rhs, mat);
481  rhs.scale(-1.0);
482 
483  if (_print_fields)
484  {
485  _console << "Solid energy matrix" << std::endl;
486  mat.print();
487  }
488 
489  // We compute the normalization factors based on the fluxes
490  Real norm_factor = NS::FV::computeNormalizationFactor(solution, mat, rhs);
491 
492  // We need the non-preconditioned norm to be consistent with the norm factor
493  LibmeshPetscCall(KSPSetNormType(se_solver.ksp(), KSP_NORM_UNPRECONDITIONED));
494 
495  // Setting the linear tolerances and maximum iteration counts
498 
499  auto its_res_pair = se_solver.solve(mat, mat, solution, rhs);
500  se_system.update();
501 
502  if (_print_fields)
503  {
504  _console << " Solid energy rhs " << std::endl;
505  rhs.print();
506  _console << " Solid temperature " << std::endl;
507  solution.print();
508  _console << "Norm factor " << norm_factor << std::endl;
509  }
510 
511  _solid_energy_system->setSolution(current_local_solution);
512 
513  return std::make_pair(its_res_pair.first, se_solver.get_initial_residual() / norm_factor);
514 }
FEProblemBase & _problem
const bool _print_fields
Debug parameter which allows printing the coupling and solution vectors/matrices. ...
const Real _solid_energy_l_abs_tol
Absolute linear tolerance for the energy equations.
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...
NumericVector< Number > * rhs
const unsigned int _solid_energy_sys_number
The number of the system corresponding to the solid energy equation.
void setSolution(const NumericVector< Number > &soln)
virtual LinearSolver< Number > * get_linear_solver() const
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
std::map< std::string, Real > real_valued_data
virtual void scale(const T factor)=0
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
std::unique_ptr< NumericVector< Number > > solution
virtual void print(std::ostream &os=libMesh::out) const
void set_solver_configuration(SolverConfiguration &solver_configuration)
NonlinearSystemBase * _solid_energy_system
Pointer to the nonlinear system corresponding to the solid energy equation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SparseMatrix< Number > * matrix
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
std::unique_ptr< NumericVector< Number > > current_local_solution
const ConsoleStream _console
SIMPLESolverConfiguration _solid_energy_linear_control
Options for the linear solver of the energy equation.
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
virtual libMesh::System & system() override

◆ validParams()

InputParameters SIMPLESolveNonlinearAssembly::validParams ( )
static

Definition at line 20 of file SIMPLESolveNonlinearAssembly.C.

Referenced by SIMPLENonlinearAssembly::validParams().

21 {
23 
24  params.addParam<TagName>("pressure_gradient_tag",
25  "pressure_momentum_kernels",
26  "The name of the tags associated with the kernels in the momentum "
27  "equations which are not related to the pressure gradient.");
28 
29  /*
30  * The names of the different systems in the segregated solver
31  */
32  params.addParam<std::vector<SolverSystemName>>(
33  "turbulence_systems", {}, "The solver system(s) for the turbulence equation(s).");
34 
35  /*
36  * Relaxation parameters for the different system
37  */
38  params.addParam<std::vector<Real>>(
39  "turbulence_equation_relaxation",
40  std::vector<Real>(),
41  "The relaxation which should be used for the turbulence equations "
42  "equations. (=1 for no relaxation, "
43  "diagonal dominance will still be enforced)");
44 
45  params.addParam<std::vector<Real>>(
46  "turbulence_field_min_limit",
47  std::vector<Real>(),
48  "The lower limit imposed on turbulent quantities. The recommended value for robustness "
49  "is 1e-8.");
50 
51  params.addParamNamesToGroup("turbulence_equation_relaxation", "Relaxation");
52 
53  /*
54  * Petsc options for every equations in the system
55  */
56  params.addParam<MultiMooseEnum>("turbulence_petsc_options",
58  "Singleton PETSc options for the turbulence equation(s)");
59  params.addParam<MultiMooseEnum>("turbulence_petsc_options_iname",
61  "Names of PETSc name/value pairs for the turbulence equation(s)");
62  params.addParam<std::vector<std::string>>(
63  "turbulence_petsc_options_value",
64  "Values of PETSc name/value pairs (must correspond with \"petsc_options_iname\" for the "
65  "turbulence equation");
66 
67  params.addParamNamesToGroup(
68  "turbulence_petsc_options turbulence_petsc_options_iname turbulence_petsc_options_value",
69  "PETSc Control");
70 
71  /*
72  * Iteration tolerances for the different equations
73  */
74 
75  params.addParam<std::vector<Real>>(
76  "turbulence_absolute_tolerance",
77  std::vector<Real>(),
78  "The absolute tolerance(s) on the normalized residual(s) of the turbulence equation(s).");
79 
80  params.addParamNamesToGroup("solid_energy_absolute_tolerance turbulence_absolute_tolerance",
81  "Iteration Control");
82  /*
83  * Linear iteration tolerances for the different equations
84  */
85  params.addRangeCheckedParam<Real>("turbulence_l_tol",
86  1e-5,
87  "0.0<=turbulence_l_tol & turbulence_l_tol<1.0",
88  "The relative tolerance on the normalized residual in the "
89  "linear solver of the turbulence equation(s).");
90  params.addRangeCheckedParam<Real>("turbulence_l_abs_tol",
91  1e-10,
92  "0.0<turbulence_l_abs_tol",
93  "The absolute tolerance on the normalized residual in the "
94  "linear solver of the turbulence equation(s).");
95  params.addParam<unsigned int>(
96  "turbulence_l_max_its",
97  10000,
98  "The maximum allowed iterations in the linear solver of the turbulence equation(s).");
99 
100  params.addParamNamesToGroup("turbulence_l_tol "
101  "turbulence_l_abs_tol turbulence_l_max_its",
102  "Linear Iteration Control");
103 
104  return params;
105 }
MultiMooseEnum getCommonPetscKeys()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
MultiMooseEnum getCommonPetscFlags()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Data Documentation

◆ _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 202 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve::solve(), and 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 190 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::solve().

◆ _energy_sys_number

const unsigned int SIMPLESolveNonlinearAssembly::_energy_sys_number
protected

The number of the system corresponding to the energy equation.

Definition at line 82 of file SIMPLESolveNonlinearAssembly.h.

Referenced by solve().

◆ _energy_system

NonlinearSystemBase* SIMPLESolveNonlinearAssembly::_energy_system
protected

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

Definition at line 85 of file SIMPLESolveNonlinearAssembly.h.

Referenced by checkIntegrity(), 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_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 checkIntegrity(), LinearAssemblySegregatedSolve::LinearAssemblySegregatedSolve(), SIMPLESolveBase::SIMPLESolveBase(), solve(), and LinearAssemblySegregatedSolve::solve().

◆ _has_turbulence_systems

const bool SIMPLESolveNonlinearAssembly::_has_turbulence_systems
protected

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

Definition at line 77 of file SIMPLESolveNonlinearAssembly.h.

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

◆ _momentum_absolute_tolerance

const Real SIMPLESolveBase::_momentum_absolute_tolerance
protectedinherited

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

Definition at line 184 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::solve().

◆ _momentum_system_names

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

◆ _momentum_system_numbers

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

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

Definition at line 63 of file SIMPLESolveNonlinearAssembly.h.

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

◆ _momentum_systems

std::vector<NonlinearSystemBase *> SIMPLESolveNonlinearAssembly::_momentum_systems
protected

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

Definition at line 66 of file SIMPLESolveNonlinearAssembly.h.

Referenced by checkIntegrity(), linkRhieChowUserObject(), SIMPLESolveNonlinearAssembly(), solve(), and solveMomentumPredictor().

◆ _num_iterations

const unsigned int SIMPLESolveBase::_num_iterations
protectedinherited

The maximum number of momentum-pressure iterations.

Definition at line 199 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve::solve(), and 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 196 of file SIMPLESolveBase.h.

Referenced by SIMPLESolveBase::SIMPLESolveBase(), solve(), and LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::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<NonlinearSystemBase *> SIMPLESolveNonlinearAssembly::_passive_scalar_systems
protected

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

Definition at line 98 of file SIMPLESolveNonlinearAssembly.h.

Referenced by checkIntegrity(), SIMPLESolveNonlinearAssembly(), 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 LinearAssemblySegregatedSolve::solvePressureCorrector().

◆ _pressure_absolute_tolerance

const Real SIMPLESolveBase::_pressure_absolute_tolerance
protectedinherited

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

Definition at line 187 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::correctVelocity(), SIMPLESolveBase::SIMPLESolveBase(), and 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 LinearAssemblySegregatedSolve::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 LinearAssemblySegregatedSolve::solvePressureCorrector().

◆ _pressure_sys_number

const unsigned int SIMPLESolveNonlinearAssembly::_pressure_sys_number
protected

The number of the system corresponding to the pressure equation.

Definition at line 69 of file SIMPLESolveNonlinearAssembly.h.

Referenced by solvePressureCorrector().

◆ _pressure_system

NonlinearSystemBase& SIMPLESolveNonlinearAssembly::_pressure_system
protected

Reference to the nonlinear system corresponding to the pressure equation.

Definition at line 72 of file SIMPLESolveNonlinearAssembly.h.

Referenced by checkIntegrity(), SIMPLESolveNonlinearAssembly(), solve(), and solvePressureCorrector().

◆ _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_tag_id

const TagID SIMPLESolveNonlinearAssembly::_pressure_tag_id
protected

The ID of the tag which corresponds to the pressure gradient terms in the momentum equation.

Definition at line 143 of file SIMPLESolveNonlinearAssembly.h.

Referenced by linkRhieChowUserObject(), and SIMPLESolveNonlinearAssembly().

◆ _pressure_tag_name

const TagName SIMPLESolveNonlinearAssembly::_pressure_tag_name
protected

The name of the vector tag which corresponds to the pressure gradient terms in the momentum equation.

Definition at line 139 of file SIMPLESolveNonlinearAssembly.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 LinearAssemblySegregatedSolve::correctVelocity(), and solve().

◆ _print_fields

const bool SIMPLESolveBase::_print_fields
protectedinherited

◆ _rc_uo

INSFVRhieChowInterpolatorSegregated* SIMPLESolveNonlinearAssembly::_rc_uo
protected

Pointer to the segregated RhieChow interpolation object.

Definition at line 135 of file SIMPLESolveNonlinearAssembly.h.

Referenced by linkRhieChowUserObject(), and solve().

◆ _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 193 of file SIMPLESolveBase.h.

Referenced by LinearAssemblySegregatedSolve::solve(), and 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 LinearAssemblySegregatedSolve::solveSolidEnergy(), and 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(), LinearAssemblySegregatedSolve::solveSolidEnergy(), and solveSolidEnergySystem().

◆ _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 LinearAssemblySegregatedSolve::solve().

◆ _solid_energy_sys_number

const unsigned int SIMPLESolveNonlinearAssembly::_solid_energy_sys_number
protected

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

Definition at line 90 of file SIMPLESolveNonlinearAssembly.h.

Referenced by solveSolidEnergySystem().

◆ _solid_energy_system

NonlinearSystemBase* SIMPLESolveNonlinearAssembly::_solid_energy_system
protected

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

Definition at line 93 of file SIMPLESolveNonlinearAssembly.h.

Referenced by checkIntegrity(), solve(), and solveSolidEnergySystem().

◆ _turbulence_absolute_tolerance

const std::vector<Real> SIMPLESolveNonlinearAssembly::_turbulence_absolute_tolerance
protected

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

Definition at line 130 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly(), and solve().

◆ _turbulence_equation_relaxation

const std::vector<Real> SIMPLESolveNonlinearAssembly::_turbulence_equation_relaxation
protected

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

Definition at line 112 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly(), and solve().

◆ _turbulence_field_min_limit

std::vector<Real> SIMPLESolveNonlinearAssembly::_turbulence_field_min_limit
protected

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

Definition at line 115 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly(), and solve().

◆ _turbulence_l_abs_tol

const Real SIMPLESolveNonlinearAssembly::_turbulence_l_abs_tol
protected

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 125 of file SIMPLESolveNonlinearAssembly.h.

Referenced by solve().

◆ _turbulence_linear_control

SIMPLESolverConfiguration SIMPLESolveNonlinearAssembly::_turbulence_linear_control
protected

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

Definition at line 121 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly(), and solve().

◆ _turbulence_petsc_options

Moose::PetscSupport::PetscOptions SIMPLESolveNonlinearAssembly::_turbulence_petsc_options
protected

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

Definition at line 118 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly(), and solve().

◆ _turbulence_system_names

const std::vector<SolverSystemName>& SIMPLESolveNonlinearAssembly::_turbulence_system_names
protected

The names of the turbulence scalar systems.

Definition at line 103 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly().

◆ _turbulence_system_numbers

std::vector<unsigned int> SIMPLESolveNonlinearAssembly::_turbulence_system_numbers
protected

Definition at line 106 of file SIMPLESolveNonlinearAssembly.h.

Referenced by SIMPLESolveNonlinearAssembly(), and solve().

◆ _turbulence_systems

std::vector<NonlinearSystemBase *> SIMPLESolveNonlinearAssembly::_turbulence_systems
protected

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

Definition at line 109 of file SIMPLESolveNonlinearAssembly.h.

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


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