Documentation a537f1bdf2
Loading...
Searching...
No Matches
CDiscAdjFluidIteration.hpp
Go to the documentation of this file.
1/*!
2 * \file CDiscAdjFluidIteration.hpp
3 * \brief Headers of the iteration classes used by SU2_CFD.
4 * Each CIteration class represents an available physics package.
5 * \author F. Palacios, T. Economon
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 "CIteration.hpp"
32
33class CFluidIteration;
34
35/*!
36 * \class CDiscAdjFluidIteration
37 * \ingroup DiscAdj
38 * \brief Class for driving an iteration of the discrete adjoint fluid system.
39 * \author T. Economon
40 */
41class CDiscAdjFluidIteration final : public CIteration {
42 private:
43 const bool turbulent; /*!< \brief Stores the turbulent flag. */
44
45 /*!
46 * \brief load unsteady solution for unsteady problems
47 * \param[in] geometry - Geometrical definition of the problem.
48 * \param[in] solver - Container vector with all the solutions.
49 * \param[in] config - Definition of the particular problem.
50 * \param[in] val_iZone - Index of the zone.
51 * \param[in] val_iInst - Index of the instance.
52 * \param[in] val_DirectIter - Direct iteration to load.
53 */
54 void LoadUnsteady_Solution(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone,
55 unsigned short val_iInst, int val_DirectIter);
56
57 public:
58 /*!
59 * \brief Constructor of the class.
60 * \param[in] config - Definition of the particular problem.
61 */
62 explicit CDiscAdjFluidIteration(const CConfig *config) : CIteration(config),
63 turbulent(config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS || config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_INC_RANS) {}
64
65 /*!
66 * \brief Preprocessing to prepare for an iteration of the physics.
67 * \brief Perform a single iteration of the adjoint fluid system.
68 * \param[in] output - Pointer to the COutput class.
69 * \param[in] integration - Container vector with all the integration methods.
70 * \param[in] geometry - Geometrical definition of the problem.
71 * \param[in] solver - Container vector with all the solutions.
72 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
73 * \param[in] config - Definition of the particular problem.
74 * \param[in] surface_movement - Surface movement classes of the problem.
75 * \param[in] grid_movement - Volume grid movement classes of the problem.
76 * \param[in] FFDBox - FFD FFDBoxes of the problem.
77 * \param[in] val_iZone - Index of the zone.
78 * \param[in] val_iInst - Index of the instance
79 */
80 void Preprocess(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
81 CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
82 CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
83 unsigned short val_iInst) override;
84
85 /*!
86 * \brief Perform a single iteration of the adjoint fluid system.
87 * \param[in] geometry - Geometrical definition of the problem.
88 * \param[in] solver - Container vector with all the solutions.
89 * \param[in] config - Definition of the particular problem.
90 * \param[in] val_iZone - Index of the zone.
91 * \param[in] val_iInst - Index of the instance.
92 * \param[in] CrossTerm - Boolean for CrossTerm.
93 */
94 void IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config,
95 unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override;
96
97 /*!
98 * \brief Monitors the convergence and other metrics for the discrete adjoint fluid system.
99 * \param[in] output - Pointer to the COutput class.
100 * \param[in] integration - Container vector with all the integration methods.
101 * \param[in] geometry - Geometrical definition of the problem.
102 * \param[in] solver - Container vector with all the solutions.
103 * \param[in] numerics - Description of the numerical method (the way in which the equations are solved).
104 * \param[in] config - Definition of the particular problem.
105 * \param[in] surface_movement - Surface movement classes of the problem.
106 * \param[in] grid_movement - Volume grid movement classes of the problem.
107 * \param[in] FFDBox - FFD FFDBoxes of the problem.
108 * \param[in] val_iZone - Index of the zone.
109 * \param[in] val_iInst - Index of the instance
110 */
111 bool Monitor(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver,
112 CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement,
113 CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone,
114 unsigned short val_iInst) override;
115
116 /*!
117 * \brief Registers all input variables of the fluid iteration.
118 * \param[in] solver - Container vector with all the solutions.
119 * \param[in] geometry - Geometrical definition of the problem.
120 * \param[in] config - Definition of the particular problem.
121 * \param[in] iZone - Index of the zone.
122 * \param[in] iInst - Index of the instance.
123 */
124 void InitializeAdjoint(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone,
125 unsigned short iInst) override;
126
127 /*!
128 * \brief Registers all output variables of the fluid iteration.
129 * \param[in] solver - Container vector with all the solutions.
130 * \param[in] geometry - Geometrical definition of the problem.
131 * \param[in] config - Definition of the particular problem.
132 * \param[in] iZone - Index of the zone.
133 * \param[in] iInst - Index of the instance.
134 * \param[in] kind_recording - Kind of recording, either FLOW_SOLUTION_VARIABLES or MESH_COORDS
135 */
136 void RegisterInput(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone,
137 unsigned short iInst, RECORDING kind_recording) override;
138
139 /*!
140 * \brief Initializes the adjoints of the output variables of the fluid iteration.
141 * \param[in] solver - Container vector with all the solutions.
142 * \param[in] geometry - Geometrical definition of the problem.
143 * \param[in] config - Definition of the particular problem.
144 * \param[in] iZone - Index of the zone.
145 * \param[in] iInst - Index of the instance.
146 */
147 void RegisterOutput(CSolver***** solver, CGeometry**** geometry, CConfig** config,
148 unsigned short iZone, unsigned short iInst) override;
149
150 /*!
151 * \brief Compute necessary variables that depend on the conservative variables or the mesh node positions
152 * (e.g. turbulent variables, normals, volumes).
153 * \param[in] solver - Container vector with all the solutions.
154 * \param[in] geometry - Geometrical definition of the problem.
155 * \param[in] config - Definition of the particular problem.
156 * \param[in] iZone - Index of the zone.
157 * \param[in] iInst - Index of the zone.
158 * \param[in] kind_recording - The kind of recording (geometry or flow).
159 */
160 void SetDependencies(CSolver***** solver, CGeometry**** geometry, CNumerics****** numerics, CConfig** config,
161 unsigned short iZone, unsigned short iInst, RECORDING kind_recording) override;
162
163};
Headers of the iteration classes used by SU2_CFD. Each CIteration class represents an available physi...
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Class for driving an iteration of the discrete adjoint fluid system.
Definition CDiscAdjFluidIteration.hpp:41
void RegisterOutput(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short iInst) override
Initializes the adjoints of the output variables of the fluid iteration.
Definition CDiscAdjFluidIteration.cpp:531
void IterateDiscAdj(CGeometry ****geometry, CSolver *****solver, CConfig **config, unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override
Perform a single iteration of the adjoint fluid system.
Definition CDiscAdjFluidIteration.cpp:327
void SetDependencies(CSolver *****solver, CGeometry ****geometry, CNumerics ******numerics, CConfig **config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) override
Compute necessary variables that depend on the conservative variables or the mesh node positions (e....
Definition CDiscAdjFluidIteration.cpp:465
void RegisterInput(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) override
Registers all output variables of the fluid iteration.
Definition CDiscAdjFluidIteration.cpp:404
void Preprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, CNumerics ******numerics, CConfig **config, CSurfaceMovement **surface_movement, CVolumetricMovement ***grid_movement, CFreeFormDefBox ***FFDBox, unsigned short val_iZone, unsigned short val_iInst) override
Preprocessing to prepare for an iteration of the physics.
Definition CDiscAdjFluidIteration.cpp:31
CDiscAdjFluidIteration(const CConfig *config)
Constructor of the class.
Definition CDiscAdjFluidIteration.hpp:62
void InitializeAdjoint(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short iInst) override
Registers all input variables of the fluid iteration.
Definition CDiscAdjFluidIteration.cpp:361
bool Monitor(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, CNumerics ******numerics, CConfig **config, CSurfaceMovement **surface_movement, CVolumetricMovement ***grid_movement, CFreeFormDefBox ***FFDBox, unsigned short val_iZone, unsigned short val_iInst) override
Monitors the convergence and other metrics for the discrete adjoint fluid system.
Definition CDiscAdjFluidIteration.cpp:564
Class for driving an iteration of the fluid system.
Definition CFluidIteration.hpp:39
Class for defining the free form FFDBox structure.
Definition CFreeFormDefBox.hpp:38
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Main class for doing the space integration, time integration, and monitoring of a system of Partial D...
Definition CIntegration.hpp:47
Parent class for defining a single iteration of a physics problem.
Definition CIteration.hpp:50
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Class for writing the convergence history and to write solution data to file.
Definition COutput.hpp:68
Definition CSolver.hpp:71
Class for moving the surface numerical grid.
Definition CSurfaceMovement.hpp:38
Class for moving the volumetric numerical grid.
Definition CVolumetricMovement.hpp:37
MAIN_SOLVER
different solver types for the CFD component
Definition option_structure.hpp:302
@ DISC_ADJ_RANS
Definition of the discrete adjoint Reynolds-averaged Navier-Stokes' (RANS) solver.
@ DISC_ADJ_INC_RANS
Definition of the discrete adjoint incompressible Reynolds-averaged Navier-Stokes' (RANS) solver.
RECORDING
Definition option_structure.hpp:2820