https://mooseframework.inl.gov
LinearAssemblySegregatedSolve.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 // Moose includes
13 #include "RhieChowMassFlux.h"
14 #include "SIMPLESolveBase.h"
15 
23 {
24 public:
26 
28 
29  virtual void linkRhieChowUserObject() override;
30 
35  virtual bool solve() override;
36 
38  const std::vector<LinearSystem *> systemsToSolve() const { return _systems_to_solve; }
39 
40 protected:
41  virtual std::vector<std::pair<unsigned int, Real>> solveMomentumPredictor() override;
42  virtual std::pair<unsigned int, Real> solvePressureCorrector() override;
43 
49  virtual std::pair<unsigned int, Real> correctVelocity(const bool subtract_updated_pressure,
50  const bool recompute_face_mass_flux,
51  const SolverParams & solver_params);
52 
61  std::pair<unsigned int, Real> solveAdvectedSystem(const unsigned int system_num,
62  LinearSystem & system,
63  const Real relaxation_factor,
64  libMesh::SolverConfiguration & solver_config,
65  const Real abs_tol);
66 
68  std::pair<unsigned int, Real> solveSolidEnergy();
69 
71  std::vector<unsigned int> _momentum_system_numbers;
72 
74  std::vector<LinearSystem *> _momentum_systems;
75 
77  const unsigned int _pressure_sys_number;
78 
81 
83  const unsigned int _energy_sys_number;
84 
87 
89  const unsigned int _solid_energy_sys_number;
90 
93 
95  std::vector<LinearSystem *> _passive_scalar_systems;
96 
98  std::vector<LinearSystem *> _active_scalar_systems;
99 
102 
104  std::vector<LinearSystem *> _systems_to_solve;
105 
106  // ************************ Active Scalar Variables ************************ //
107 
109  const std::vector<SolverSystemName> & _active_scalar_system_names;
110 
113 
114  // The number(s) of the system(s) corresponding to the active scalar equation(s)
115  std::vector<unsigned int> _active_scalar_system_numbers;
116 
118  const std::vector<Real> _active_scalar_equation_relaxation;
119 
122 
125 
129 
131  const std::vector<Real> _active_scalar_absolute_tolerance;
132 };
const std::vector< LinearSystem * > systemsToSolve() const
Return pointers to the systems which are solved for within this object.
const std::vector< Real > _active_scalar_equation_relaxation
The user-defined relaxation parameter(s) for the active scalar equation(s)
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
Common base class for segregated solvers for the Navier-Stokes equations with linear FV assembly rout...
SIMPLESolverConfiguration _active_scalar_linear_control
Options for the linear solver of the active scalar equation(s)
std::pair< unsigned int, Real > solveSolidEnergy()
Solve an equation which contains the solid energy conservation.
std::vector< LinearSystem * > _passive_scalar_systems
Pointer(s) to the system(s) corresponding to the passive scalar equation(s)
LinearSystem * _solid_energy_system
Pointer to the nonlinear system corresponding to the solid energy equation.
const bool _has_active_scalar_systems
Boolean for easy check if a active scalar systems shall be solved or not.
const Real _active_scalar_l_abs_tol
Absolute linear tolerance for the active scalar equation(s).
RhieChowMassFlux * _rc_uo
Pointer to the segregated RhieChow interpolation object.
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.
const unsigned int _solid_energy_sys_number
The number of the system corresponding to the solid energy equation.
std::vector< LinearSystem * > _active_scalar_systems
Pointer(s) to the system(s) corresponding to the active scalar equation(s)
LinearSystem & _pressure_system
Reference to the nonlinear system corresponding to the pressure equation.
std::vector< unsigned int > _momentum_system_numbers
The number(s) of the system(s) corresponding to the momentum equation(s)
LinearSystem * _energy_system
Pointer to the nonlinear system corresponding to the fluid energy equation.
const unsigned int _energy_sys_number
The number of the system corresponding to the energy equation.
virtual bool solve() override
Performs the momentum pressure coupling.
virtual void linkRhieChowUserObject() override
Fetch the Rhie Chow user object that is reponsible for determining face velocities and mass flux...
Solver configuration class used with the linear solvers in a SIMPLE solver.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::vector< SolverSystemName > & _active_scalar_system_names
The names of the active scalar systems.
std::vector< LinearSystem * > _systems_to_solve
Shortcut to every linear system that we solve for here.
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.
Moose::PetscSupport::PetscOptions _active_scalar_petsc_options
Options which hold the petsc settings for the active scalar equation(s)
Solve class serving as a base class for the two SIMPLE solvers that operate with different assembly a...
const std::vector< Real > _active_scalar_absolute_tolerance
The user-defined absolute tolerance for determining the convergence in active scalars.
std::vector< unsigned int > _active_scalar_system_numbers
std::vector< LinearSystem * > _momentum_systems
Pointer(s) to the system(s) corresponding to the momentum equation(s)
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)
Solve an equation which contains an advection term that depends on the solution of the segregated Nav...
const unsigned int _pressure_sys_number
The number of the system corresponding to the pressure equation.