Documentation 6b54b78464
Loading...
Searching...
No Matches
CMultizoneDriver.hpp
Go to the documentation of this file.
1/*!
2 * \file CMultizoneDriver.hpp
3 * \brief Headers of the main subroutines for driving single or multi-zone problems.
4 * The subroutines and functions are in the <i>driver_structure.cpp</i> file.
5 * \author T. Economon, H. Kline, R. Sanchez
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30
31#include "CDriver.hpp"
32
33/*!
34 * \class CMultizoneDriver
35 * \ingroup Drivers
36 * \brief Class for driving zone-specific iterations.
37 * \author R. Sanchez, O. Burghardt
38 * \version 8.5.0 "Harrier"
39 */
40class CMultizoneDriver : public CDriver {
41protected:
42
43 bool fsi;
44 bool cht;
45
46 unsigned long TimeIter;
47
48 unsigned short *nVarZone;
49 su2double **init_res, /*!< \brief Stores the initial residual. */
50 **residual, /*!< \brief Stores the current residual. */
51 **residual_rel; /*!< \brief Stores the residual relative to the initial. */
52
57
58 bool *prefixed_motion; /*!< \brief Determines if a fixed motion is imposed in the config file. */
59
60 /*!
61 * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure.
62 */
63 void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter);
64
65 /*!
66 * \brief Use a corrector step to prevent convergence issues.
67 */
68 void Corrector(unsigned short val_iZone);
69
70 /*!
71 * \brief Run a Block Gauss-Seidel iteration in all physical zones.
72 */
73 void RunGaussSeidel();
74
75 /*!
76 * \brief Run a Block-Jacobi iteration in all physical zones.
77 */
78 void RunJacobi();
79
80 /*!
81 * \brief Routine to provide all the desired physical transfers between the different zones during one iteration.
82 * \return Boolean that determines whether the mesh needs to be updated for this particular transfer
83 */
84 bool TransferData(unsigned short donorZone, unsigned short targetZone);
85
86 /*!
87 * \brief Check the convergence at the outer level.
88 */
89 bool OuterConvergence(unsigned long OuterIter);
90
91 /*!
92 * \brief Returns whether all specified windowed-time-averaged ouputs have been converged
93 * \return Boolean indicating whether the problem is converged.
94 */
95 virtual bool GetTimeConvergence() const;
96
97public:
98
99 /*!
100 * \brief Constructor of the class.
101 * \param[in] confFile - Configuration file name.
102 * \param[in] val_nZone - Total number of zones.
103 * \param[in] MPICommunicator - MPI communicator for SU2.
104 */
105 CMultizoneDriver(char* confFile,
106 unsigned short val_nZone,
107 SU2_Comm MPICommunicator);
108
109 /*!
110 * \brief Destructor of the class.
111 */
112 ~CMultizoneDriver() override;
113
114 /*!
115 * \brief [Overload] Launch the computation for multizone problems.
116 */
117 void StartSolver() override;
118
119 /*!
120 * \brief Preprocess the multizone iteration.
121 */
122 void Preprocess(unsigned long TimeIter) override;
123
124 /*!
125 * \brief Solves one time iteration.
126 */
127 void Run() override {
129 case ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL: RunGaussSeidel(); break; // Block Gauss-Seidel iteration
130 case ENUM_MULTIZONE::MZ_BLOCK_JACOBI: RunJacobi(); break; // Block-Jacobi iteration
131 }
132 }
133
134 /*!
135 * \brief Placeholder for post processing operations to make the interface
136 * of this driver identical to CSinglezoneDriver.
137 */
138 void Postprocess() {}
139
140 /*!
141 * \brief Update the dual-time solution within multiple zones.
142 */
143 void Update() override;
144
145 /*!
146 * \brief Output the solution in solution file.
147 */
148 void Output(unsigned long TimeIter) override;
149
150 /*!
151 * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure (multiple zone).
152 */
153 void DynamicMeshUpdate(unsigned long TimeIter) override;
154
155 /*!
156 * \brief Check if simulation converged and return appropriate boolean.
157 * \param[in] TimeIter - Current time iteration.
158 * \return Boolean that indicates to stop the iteration loop.
159 */
160 bool Monitor(unsigned long TimeIter) override;
161};
Headers of the main subroutines for driving single or multi-zone problems. The subroutines and functi...
ENUM_MULTIZONE GetKind_MZSolver(void) const
Kind of Multizone Solver.
Definition CConfig.hpp:4019
CConfig * driver_config
Definition of the driver configuration.
Definition CDriverBase.hpp:65
Parent class for driving an iteration of a single or multi-zone problem.
Definition CDriver.hpp:51
Class for driving zone-specific iterations.
Definition CMultizoneDriver.hpp:40
su2double ** init_res
Stores the initial residual.
Definition CMultizoneDriver.hpp:49
void Update() override
Update the dual-time solution within multiple zones.
Definition CMultizoneDriver.cpp:443
bool fsi
Definition CMultizoneDriver.hpp:43
void RunGaussSeidel()
Run a Block Gauss-Seidel iteration in all physical zones.
Definition CMultizoneDriver.cpp:289
unsigned short * nVarZone
Definition CMultizoneDriver.hpp:48
void Corrector(unsigned short val_iZone)
Use a corrector step to prevent convergence issues.
Definition CMultizoneDriver.cpp:401
void StartSolver() override
[Overload] Launch the computation for multizone problems.
Definition CMultizoneDriver.cpp:144
su2double structure_criteria_rel
Definition CMultizoneDriver.hpp:56
su2double flow_criteria_rel
Definition CMultizoneDriver.hpp:54
unsigned long TimeIter
Definition CMultizoneDriver.hpp:46
void RunJacobi()
Run a Block-Jacobi iteration in all physical zones.
Definition CMultizoneDriver.cpp:340
~CMultizoneDriver() override
Destructor of the class.
Definition CMultizoneDriver.cpp:126
void Postprocess()
Placeholder for post processing operations to make the interface of this driver identical to CSinglez...
Definition CMultizoneDriver.hpp:138
bool cht
Definition CMultizoneDriver.hpp:44
su2double ** residual_rel
Stores the residual relative to the initial.
Definition CMultizoneDriver.hpp:51
virtual bool GetTimeConvergence() const
Returns whether all specified windowed-time-averaged ouputs have been converged.
Definition CMultizoneDriver.cpp:691
void Preprocess(unsigned long TimeIter) override
Preprocess the multizone iteration.
Definition CMultizoneDriver.cpp:216
void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter)
Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid s...
Definition CMultizoneDriver.cpp:524
void Run() override
Solves one time iteration.
Definition CMultizoneDriver.hpp:127
bool TransferData(unsigned short donorZone, unsigned short targetZone)
Routine to provide all the desired physical transfers between the different zones during one iteratio...
Definition CMultizoneDriver.cpp:550
su2double ** residual
Stores the current residual.
Definition CMultizoneDriver.hpp:50
bool Monitor(unsigned long TimeIter) override
Check if simulation converged and return appropriate boolean.
Definition CMultizoneDriver.cpp:643
void Output(unsigned long TimeIter) override
Output the solution in solution file.
Definition CMultizoneDriver.cpp:469
bool OuterConvergence(unsigned long OuterIter)
Check the convergence at the outer level.
Definition CMultizoneDriver.cpp:410
su2double structure_criteria
Definition CMultizoneDriver.hpp:55
su2double flow_criteria
Definition CMultizoneDriver.hpp:53
bool * prefixed_motion
Determines if a fixed motion is imposed in the config file.
Definition CMultizoneDriver.hpp:58
passivedouble su2double
Definition code_config.hpp:181
int SU2_Comm
Definition mpi_structure.hpp:619
@ MZ_BLOCK_JACOBI
Definition of a Block-Jacobi solver.
@ MZ_BLOCK_GAUSS_SEIDEL
Definition of a Block-Gauss-Seidel multizone solver.