Documentation 6b54b78464
Loading...
Searching...
No Matches
CAdjEulerSolver.hpp
Go to the documentation of this file.
1/*!
2 * \file CAdjEulerSolver.hpp
3 * \brief Headers of the CAdjEulerSolver class
4 * \author F. Palacios
5 * \version 8.5.0 "Harrier"
6 *
7 * SU2 Project Website: https://su2code.github.io
8 *
9 * The SU2 Project is maintained by the SU2 Foundation
10 * (http://su2foundation.org)
11 *
12 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
13 *
14 * SU2 is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * SU2 is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
26 */
27
28#pragma once
29
30#include "CSolver.hpp"
31#include "../variables/CAdjEulerVariable.hpp"
32
33/*!
34 * \class CAdjEulerSolver
35 * \brief Main class for defining the Euler's adjoint flow solver.
36 * \ingroup Euler_Equations
37 * \author F. Palacios
38 */
39class CAdjEulerSolver : public CSolver {
40protected:
42 PsiRho_Inf, /*!< \brief PsiRho variable at the infinity. */
43 PsiE_Inf, /*!< \brief PsiE variable at the infinity. */
44 *Phi_Inf; /*!< \brief Phi vector at the infinity. */
46 *Sens_Mach, /*!< \brief Mach sensitivity coefficient for each boundary. */
47 *Sens_AoA, /*!< \brief Angle of attack sensitivity coefficient for each boundary. */
48 *Sens_Geo, /*!< \brief Shape sensitivity coefficient for each boundary. */
49 *Sens_Press, /*!< \brief Pressure sensitivity coefficient for each boundary. */
50 *Sens_Temp, /*!< \brief Temperature sensitivity coefficient for each boundary. */
51 *Sens_BPress, /*!< \brief Back pressure sensitivity coefficient for each boundary. */
52 **CSensitivity; /*!< \brief Shape sensitivity coefficient for each boundary and vertex. */
53 vector<vector<vector<su2double>>> DonorAdjVar; /*!< \brief Value of the donor variables at each boundary. */
54 su2double Total_Sens_Mach; /*!< \brief Total mach sensitivity coefficient for all the boundaries. */
55 su2double Total_Sens_AoA; /*!< \brief Total angle of attack sensitivity coefficient for all the boundaries. */
56 su2double Total_Sens_Geo; /*!< \brief Total shape sensitivity coefficient for all the boundaries. */
57 su2double Total_Sens_Press; /*!< \brief Total farfield sensitivity to pressure. */
58 su2double Total_Sens_Temp; /*!< \brief Total farfield sensitivity to temperature. */
59 su2double Total_Sens_BPress; /*!< \brief Total sensitivity to back pressure. */
60 bool space_centered; /*!< \brief True if space centered scheeme used. */
61 su2double **Jacobian_Axisymmetric; /*!< \brief Storage for axisymmetric Jacobian. */
62 su2double Gamma; /*!< \brief Fluid's Gamma constant (ratio of specific heats). */
63 su2double Gamma_Minus_One; /*!< \brief Fluids's Gamma - 1.0 . */
64 su2double *FlowPrimVar_i, /*!< \brief Store the flow solution at point i. */
65 *FlowPrimVar_j; /*!< \brief Store the flow solution at point j. */
66 vector<vector<unsigned long>> DonorGlobalIndex; /*!< \brief Value of the donor global index. */
67
69 Area_Monitored; /*!< \brief Store the total area of the monitored outflow surface (used for normalization in continuous adjoint outflow conditions) */
70
73
74 CAdjEulerVariable* nodes = nullptr; /*!< \brief The highest level in the variable hierarchy this solver can safely use. */
75
76 /*!
77 * \brief Return nodes to allow CSolver::base_nodes to be set.
78 */
79 inline CVariable* GetBaseClassPointerToNodes() override { return nodes; }
80
81 /*!
82 * \brief Compute the Least Squares gradient of an auxiliar variable on the profile surface.
83 * \param[in] geometry - Geometrical definition of the problem.
84 * \param[in] config - Definition of the particular problem.
85 */
86 void SetAuxVar_Surface_Gradient(CGeometry *geometry, const CConfig *config);
87
88public:
89
90 /*!
91 * \brief Constructor of the class.
92 */
93 CAdjEulerSolver(void);
94
95 /*!
96 * \overload
97 * \param[in] geometry - Geometrical definition of the problem.
98 * \param[in] config - Definition of the particular problem.
99 * \param[in] iMesh - Index of the mesh in multigrid computations.
100 */
101 CAdjEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh);
102
103 /*!
104 * \brief Destructor of the class.
105 */
106 ~CAdjEulerSolver(void) override;
107
108 /*!
109 * \brief A virtual member.
110 * \param[in] geometry - Geometrical definition of the problem.
111 * \param[in] solver_container - Container vector with all the solutions.
112 * \param[in] config - Definition of the particular problem.
113 * \param[in] iMesh - Index of the mesh in multigrid computations.
114 * \param[in] Iteration - Index of the current iteration.
115 */
116 void SetTime_Step(CGeometry *geometry,
117 CSolver **solver_container,
118 CConfig *config,
119 unsigned short iMesh,
120 unsigned long Iteration) override;
121
122 /*!
123 * \brief Parallelization of Undivided Laplacian.
124 * \param[in] geometry - Geometrical definition of the problem.
125 * \param[in] config - Definition of the particular problem.
126 */
127 void Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config);
128
129 /*!
130 * \brief Created the force projection vector for adjoint boundary conditions.
131 * \param[in] geometry - Geometrical definition of the problem.
132 * \param[in] solver_container - Container vector with all the solutions.
133 * \param[in] config - Definition of the particular problem.
134 */
135 void SetForceProj_Vector(CGeometry *geometry,
136 CSolver **solver_container,
137 CConfig *config) final;
138
139 /*!
140 * \brief Compute adjoint density at the infinity.
141 * \return Value of the adjoint density at the infinity.
142 */
143 inline su2double GetPsiRho_Inf(void) const final { return PsiRho_Inf; }
144
145 /*!
146 * \brief Compute the adjoint energy at the infinity.
147 * \return Value of the adjoint energy at the infinity.
148 */
149 inline su2double GetPsiE_Inf(void) const final { return PsiE_Inf; }
150
151 /*!
152 * \brief Compute Phi (adjoint velocity) at the infinity.
153 * \param[in] val_dim - Index of the adjoint velocity vector.
154 * \return Value of the adjoint velocity vector at the infinity.
155 */
156 inline su2double GetPhi_Inf(unsigned short val_dim) const final { return Phi_Inf[val_dim]; }
157
158 /*!
159 * \brief Compute the spatial integration using a centered scheme for the adjoint equations.
160 * \param[in] geometry - Geometrical definition of the problem.
161 * \param[in] solver_container - Container vector with all the solutions.
162 * \param[in] numerics_container - Description of the numerical method.
163 * \param[in] config - Definition of the particular problem.
164 * \param[in] iMesh - Index of the mesh in multigrid computations.
165 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
166 */
167 void Centered_Residual(CGeometry *geometry,
168 CSolver **solver_container,
169 CNumerics **numerics_container,
170 CConfig *config,
171 unsigned short iMesh,
172 unsigned short iRKStep) final;
173
174 /*!
175 * \brief Compute the spatial integration using a upwind scheme.
176 * \param[in] geometry - Geometrical definition of the problem.
177 * \param[in] solver_container - Container vector with all the solutions.
178 * \param[in] numerics_container - Description of the numerical method.
179 * \param[in] config - Definition of the particular problem.
180 * \param[in] iMesh - Index of the mesh in multigrid computations.
181 */
182 void Upwind_Residual(CGeometry *geometry,
183 CSolver **solver_container,
184 CNumerics **numerics_container,
185 CConfig *config,
186 unsigned short iMesh) final;
187
188 /*!
189 * \brief Source term integration.
190 * \param[in] geometry - Geometrical definition of the problem.
191 * \param[in] solver_container - Container vector with all the solutions.
192 * \param[in] numerics_container - Description of the numerical method.
193 * \param[in] config - Definition of the particular problem.
194 * \param[in] iMesh - Index of the mesh in multigrid computations.
195 */
196 void Source_Residual(CGeometry *geometry,
197 CSolver **solver_container,
198 CNumerics **numerics_container,
199 CConfig *config,
200 unsigned short iMesh) override;
201
202 /*!
203 * \brief Source term integration.
204 * \param[in] geometry - Geometrical definition of the problem.
205 * \param[in] solver_container - Container vector with all the solutions.
206 * \param[in] numerics - Description of the numerical method.
207 * \param[in] config - Definition of the particular problem.
208 * \param[in] iMesh - Index of the mesh in multigrid computations.
209 */
210 void Source_Template(CGeometry *geometry,
211 CSolver **solver_container,
212 CNumerics *numerics,
213 CConfig *config,
214 unsigned short iMesh) final;
215
216 /*!
217 * \brief Value of the characteristic variables at the boundaries.
218 * \param[in] val_marker - Surface marker where the coefficient is computed.
219 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
220 * \return Value of the pressure coefficient.
221 */
222 inline const su2double* GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex) const {
223 return DonorAdjVar[val_marker][val_vertex].data();
224 }
225
226 /*!
227 * \brief Value of the characteristic variables at the boundaries.
228 * \param[in] val_marker - Surface marker where the coefficient is computed.
229 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
230 * \return Value of the pressure coefficient.
231 */
232 inline void SetDonorAdjVar(unsigned short val_marker,
233 unsigned long val_vertex,
234 unsigned short val_var,
235 su2double val_value) {
236 DonorAdjVar[val_marker][val_vertex][val_var] = val_value;
237 }
238
239 /*!
240 * \brief Value of the characteristic variables at the boundaries.
241 * \param[in] val_marker - Surface marker where the coefficient is computed.
242 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
243 * \return Value of the pressure coefficient.
244 */
245 inline su2double GetDonorAdjVar(unsigned short val_marker,
246 unsigned long val_vertex,
247 unsigned short val_var) const {
248 return DonorAdjVar[val_marker][val_vertex][val_var];
249 }
250
251 /*!
252 * \brief Value of the characteristic global index at the boundaries.
253 * \param[in] val_marker - Surface marker where the coefficient is computed.
254 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
255 * \return Value of the pressure coefficient.
256 */
257 inline unsigned long GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex) const final { return DonorGlobalIndex[val_marker][val_vertex]; }
258
259 /*!
260 * \brief Value of the characteristic global index at the boundaries.
261 * \param[in] val_marker - Surface marker where the coefficient is computed.
262 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
263 * \return Value of the pressure coefficient.
264 */
265 inline void SetDonorGlobalIndex(unsigned short val_marker,
266 unsigned long val_vertex,
267 unsigned long val_index) final {
268 DonorGlobalIndex[val_marker][val_vertex] = val_index;
269 }
270
271 /*!
272 * \brief Compute the sensor for higher order dissipation control in rotating problems.
273 * \param[in] geometry - Geometrical definition of the problem.
274 * \param[in] solver_container - Container vector with all the solutions.
275 * \param[in] config - Definition of the particular problem.
276 */
277 void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config);
278
279 /*!
280 * \brief Update the AoA and freestream velocity at the farfield.
281 * \param[in] geometry - Geometrical definition of the problem.
282 * \param[in] solver_container - Container vector with all the solutions.
283 * \param[in] config - Definition of the particular problem.
284 * \param[in] iMesh - current mesh level for the multigrid.
285 * \param[in] Output - boolean to determine whether to print output.
286 */
287 void SetFarfield_AoA(CGeometry *geometry,
288 CSolver **solver_container,
289 CConfig *config,
290 unsigned short iMesh,
291 bool Output);
292
293 /*!
294 * \brief Impose via the residual the adjoint Euler wall boundary condition.
295 * \param[in] geometry - Geometrical definition of the problem.
296 * \param[in] solver_container - Container vector with all the solutions.
297 * \param[in] numerics - Description of the numerical method.
298 * \param[in] config - Definition of the particular problem.
299 * \param[in] val_marker - Surface marker where the boundary condition is applied.
300 */
301 void BC_Euler_Wall(CGeometry *geometry,
302 CSolver **solver_container,
303 CNumerics *conv_numerics,
304 CNumerics *visc_numerics,
305 CConfig *config,
306 unsigned short val_marker) override;
307
308 /*!
309 * \brief Impose an actuator disk inlet boundary condition.
310 * \param[in] geometry - Geometrical definition of the problem.
311 * \param[in] solver_container - Container vector with all the solutions.
312 * \param[in] conv_numerics - Description of the numerical method.
313 * \param[in] visc_numerics - Description of the numerical method.
314 * \param[in] config - Definition of the particular problem.
315 * \param[in] val_marker - Surface marker where the boundary condition is applied.
316 */
317 void BC_ActDisk_Inlet(CGeometry *geometry,
318 CSolver **solver_container,
319 CNumerics *conv_numerics,
320 CNumerics *visc_numerics,
321 CConfig *config,
322 unsigned short val_marker) final;
323
324 /*!
325 * \brief Impose an actuator disk outlet boundary condition.
326 * \param[in] geometry - Geometrical definition of the problem.
327 * \param[in] solver_container - Container vector with all the solutions.
328 * \param[in] conv_numerics - Description of the numerical method.
329 * \param[in] visc_numerics - Description of the numerical method.
330 * \param[in] config - Definition of the particular problem.
331 * \param[in] val_marker - Surface marker where the boundary condition is applied.
332 */
333 void BC_ActDisk_Outlet(CGeometry *geometry,
334 CSolver **solver_container,
335 CNumerics *conv_numerics,
336 CNumerics *visc_numerics,
337 CConfig *config,
338 unsigned short val_marker) final;
339
340 /*!
341 * \brief Impose an actuator disk inlet boundary condition.
342 * \param[in] geometry - Geometrical definition of the problem.
343 * \param[in] solver_container - Container vector with all the solutions.
344 * \param[in] conv_numerics - Description of the numerical method.
345 * \param[in] visc_numerics - Description of the numerical method.
346 * \param[in] config - Definition of the particular problem.
347 * \param[in] val_marker - Surface marker where the boundary condition is applied.
348 * \param[in] val_inlet_surface - Boolean for whether val_marker is an inlet
349 */
350 void BC_ActDisk(CGeometry *geometry,
351 CSolver **solver_container,
352 CNumerics *conv_numerics,
353 CNumerics *visc_numerics,
354 CConfig *config,
355 unsigned short val_marker,
356 bool val_inlet_surface) final;
357
358 /*!
359 * \brief Impose via the residual the adjoint symmetry boundary condition.
360 * \param[in] geometry - Geometrical definition of the problem.
361 * \param[in] solver_container - Container vector with all the solutions.
362 * \param[in] conv_numerics - Description of the numerical method.
363 * \param[in] visc_numerics - Description of the numerical method.
364 * \param[in] config - Definition of the particular problem.
365 * \param[in] val_marker - Surface marker where the boundary condition is applied.
366 */
367 void BC_Sym_Plane(CGeometry *geometry,
368 CSolver **solver_container,
369 CNumerics *conv_numerics,
370 CNumerics *visc_numerics,
371 CConfig *config,
372 unsigned short val_marker) final;
373
374 /*!
375 * \brief Impose the boundary condition to the far field using characteristics.
376 * \param[in] geometry - Geometrical definition of the problem.
377 * \param[in] solver_container - Container vector with all the solutions.
378 * \param[in] conv_numerics - Description of the numerical method.
379 * \param[in] visc_numerics - Description of the numerical method.
380 * \param[in] config - Definition of the particular problem.
381 * \param[in] val_marker - Surface marker where the boundary condition is applied.
382 */
383 void BC_Far_Field(CGeometry *geometry,
384 CSolver **solver_container,
385 CNumerics *conv_numerics,
386 CNumerics *visc_numerics,
387 CConfig *config,
388 unsigned short val_marker) final;
389
390 /*!
391 * \brief Impose the inlet boundary condition.
392 * \param[in] geometry - Geometrical definition of the problem.
393 * \param[in] solver_container - Container vector with all the solutions.
394 * \param[in] conv_numerics - Description of the numerical method.
395 * \param[in] visc_numerics - Description of the numerical method.
396 * \param[in] config - Definition of the particular problem.
397 * \param[in] val_marker - Surface marker where the boundary condition is applied.
398 */
399 void BC_Inlet(CGeometry *geometry,
400 CSolver **solver_container,
401 CNumerics *conv_numerics,
402 CNumerics *visc_numerics,
403 CConfig *config,
404 unsigned short val_marker) final;
405
406
407 /*!
408 * \brief Impose the supersonic inlet boundary condition.
409 * \param[in] geometry - Geometrical definition of the problem.
410 * \param[in] solver_container - Container vector with all the solutions.
411 * \param[in] solver - Description of the numerical method.
412 * \param[in] config - Definition of the particular problem.
413 * \param[in] val_marker - Surface marker where the boundary condition is applied.
414 */
415 void BC_Supersonic_Inlet(CGeometry *geometry,
416 CSolver **solver_container,
417 CNumerics *conv_numerics,
418 CNumerics *visc_numerics,
419 CConfig *config,
420 unsigned short val_marker) final;
421
422 /*!
423 * \brief Impose the supersonic outlet boundary condition.
424 * \param[in] geometry - Geometrical definition of the problem.
425 * \param[in] solver_container - Container vector with all the solutions.
426 * \param[in] solver - Description of the numerical method.
427 * \param[in] config - Definition of the particular problem.
428 * \param[in] val_marker - Surface marker where the boundary condition is applied.
429 */
430 void BC_Supersonic_Outlet(CGeometry *geometry,
431 CSolver **solver_container,
432 CNumerics *conv_numerics,
433 CNumerics *visc_numerics,
434 CConfig *config,
435 unsigned short val_marker) final;
436
437 /*!
438 * \brief Impose the outlet boundary condition.
439 * \param[in] geometry - Geometrical definition of the problem.
440 * \param[in] solver_container - Container vector with all the solutions.
441 * \param[in] conv_numerics - Description of the numerical method.
442 * \param[in] visc_numerics - Description of the numerical method.
443 * \param[in] config - Definition of the particular problem.
444 * \param[in] val_marker - Surface marker where the boundary condition is applied.
445 */
446 void BC_Outlet(CGeometry *geometry,
447 CSolver **solver_container,
448 CNumerics *conv_numerics,
449 CNumerics *visc_numerics,
450 CConfig *config,
451 unsigned short val_marker) final;
452
453
454 /*!
455 * \brief Impose the engine inflow adjoint boundary condition.
456 * \param[in] geometry - Geometrical definition of the problem.
457 * \param[in] solver_container - Container vector with all the solutions.
458 * \param[in] conv_numerics - Description of the numerical method.
459 * \param[in] visc_numerics - Description of the numerical method.
460 * \param[in] config - Definition of the particular problem.
461 * \param[in] val_marker - Surface marker where the boundary condition is applied.
462 */
463 void BC_Engine_Inflow(CGeometry *geometry,
464 CSolver **solver_container,
465 CNumerics *conv_numerics,
466 CNumerics *visc_numerics,
467 CConfig *config,
468 unsigned short val_marker) final;
469
470 /*!
471 * \brief Impose the engine exhaust boundary condition.
472 * \param[in] geometry - Geometrical definition of the problem.
473 * \param[in] solver_container - Container vector with all the solutions.
474 * \param[in] conv_numerics - Description of the numerical method.
475 * \param[in] visc_numerics - Description of the numerical method.
476 * \param[in] config - Definition of the particular problem.
477 * \param[in] val_marker - Surface marker where the boundary condition is applied.
478 */
479 void BC_Engine_Exhaust(CGeometry *geometry,
480 CSolver **solver_container,
481 CNumerics *conv_numerics,
482 CNumerics *visc_numerics,
483 CConfig *config,
484 unsigned short val_marker) final;
485
486 /*!
487 * \brief Update the solution using a Runge-Kutta strategy.
488 * \param[in] geometry - Geometrical definition of the problem.
489 * \param[in] solver_container - Container vector with all the solutions.
490 * \param[in] config - Definition of the particular problem.
491 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
492 */
493 void ExplicitRK_Iteration(CGeometry *geometry,
494 CSolver **solver_container,
495 CConfig *config,
496 unsigned short iRKStep) final;
497
498 /*!
499 * \brief Update the solution using a explicit Euler scheme.
500 * \param[in] geometry - Geometrical definition of the problem.
501 * \param[in] solver_container - Container vector with all the solutions.
502 * \param[in] config - Definition of the particular problem.
503 */
504 void ExplicitEuler_Iteration(CGeometry *geometry,
505 CSolver **solver_container,
506 CConfig *config) final;
507
508 /*!
509 * \brief Update the solution using an implicit solver.
510 * \param[in] geometry - Geometrical definition of the problem.
511 * \param[in] solver_container - Container vector with all the solutions.
512 * \param[in] config - Definition of the particular problem.
513 */
514 void ImplicitEuler_Iteration(CGeometry *geometry,
515 CSolver **solver_container,
516 CConfig *config) final;
517
518 /*!
519 * \brief Initialize the residual vectors.
520 * \param[in] geometry - Geometrical definition of the problem.
521 * \param[in] solver_container - Container vector with all the solutions.
522 * \param[in] config - Definition of the particular problem.
523 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
524 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
525 * \param[in] Output - boolean to determine whether to print output.
526 */
527 void Preprocessing(CGeometry *geometry,
528 CSolver **solver_container,
529 CConfig *config,
530 unsigned short iMesh,
531 unsigned short iRKStep,
532 unsigned short RunTime_EqSystem,
533 bool Output) override;
534
535 /*!
536 * \brief Compute the inviscid sensitivity of the functional.
537 * \param[in] geometry - Geometrical definition of the problem.
538 * \param[in] solver_container - Container vector with all the solutions.
539 * \param[in] numerics - Description of the numerical method.
540 * \param[in] config - Definition of the particular problem.
541 */
542 void Inviscid_Sensitivity(CGeometry *geometry,
543 CSolver **solver_container,
544 CNumerics *numerics,
545 CConfig *config) final;
546
547 /*!
548 * \brief Smooth the inviscid sensitivity of the functional.
549 * \param[in] geometry - Geometrical definition of the problem.
550 * \param[in] solver_container - Container vector with all the solutions.
551 * \param[in] numerics - Description of the numerical method.
552 * \param[in] config - Definition of the particular problem.
553 */
554 void Smooth_Sensitivity(CGeometry *geometry,
555 CSolver **solver_container,
556 CNumerics *numerics,
557 CConfig *config) final;
558
559 /*!
560 * \brief Get the shape sensitivity coefficient.
561 * \param[in] val_marker - Surface marker where the coefficient is computed.
562 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
563 * \return Value of the sensitivity coefficient.
564 */
565 inline su2double GetCSensitivity(unsigned short val_marker,
566 unsigned long val_vertex) const final{
567 return CSensitivity[val_marker][val_vertex];
568 }
569
570 /*!
571 * \brief Set the shape sensitivity coefficient.
572 * \param[in] val_marker - Surface marker where the coefficient is computed.
573 * \param[in] val_vertex - Vertex of the marker <i>val_marker</i> where the coefficient is evaluated.
574 * \param[in] val_sensitivity - Value of the sensitivity coefficient.
575 */
576 inline void SetCSensitivity(unsigned short val_marker,
577 unsigned long val_vertex,
578 su2double val_sensitivity) final {
579 CSensitivity[val_marker][val_vertex] = val_sensitivity;
580 }
581
582 /*!
583 * \brief Provide the total shape sensitivity coefficient.
584 * \return Value of the geometrical sensitivity coefficient
585 * (inviscid + viscous contribution).
586 */
587 inline su2double GetTotal_Sens_Geo() const final { return Total_Sens_Geo; }
588
589 /*!
590 * \brief Set the total Mach number sensitivity coefficient.
591 * \return Value of the Mach sensitivity coefficient
592 * (inviscid + viscous contribution).
593 */
594 inline su2double GetTotal_Sens_Mach() const final { return Total_Sens_Mach; }
595
596 /*!
597 * \brief Set the total angle of attack sensitivity coefficient.
598 * \return Value of the angle of attack sensitivity coefficient
599 * (inviscid + viscous contribution).
600 */
601 inline su2double GetTotal_Sens_AoA() const final { return Total_Sens_AoA; }
602
603 /*!
604 * \brief Set the total farfield pressure sensitivity coefficient.
605 * \return Value of the farfield pressure sensitivity coefficient
606 * (inviscid + viscous contribution).
607 */
608 inline su2double GetTotal_Sens_Press() const final { return Total_Sens_Press; }
609
610 /*!
611 * \brief Set the total farfield temperature sensitivity coefficient.
612 * \return Value of the farfield temperature sensitivity coefficient
613 * (inviscid + viscous contribution).
614 */
615 inline su2double GetTotal_Sens_Temp() const final { return Total_Sens_Temp; }
616
617 /*!
618 * \author H. Kline
619 * \brief Get the total Back pressure number sensitivity coefficient.
620 * \return Value of the Back sensitivity coefficient
621 * (inviscid + viscous contribution).
622 */
623 inline su2double GetTotal_Sens_BPress() const final { return Total_Sens_BPress; }
624
625 /*!
626 * \brief Set the total residual adding the term that comes from the Dual Time Strategy.
627 * \param[in] geometry - Geometrical definition of the problem.
628 * \param[in] solver_container - Container vector with all the solutions.
629 * \param[in] config - Definition of the particular problem.
630 * \param[in] iRKStep - Current step of the Runge-Kutta iteration.
631 * \param[in] iMesh - Index of the mesh in multigrid computations.
632 * \param[in] RunTime_EqSystem - System of equations which is going to be solved.
633 */
634 void SetResidual_DualTime(CGeometry *geometry,
635 CSolver **solver_container,
636 CConfig *config,
637 unsigned short iRKStep,
638 unsigned short iMesh,
639 unsigned short RunTime_EqSystem) final;
640
641 /*!
642 * \brief Set the initial condition for the Euler Equations.
643 * \param[in] geometry - Geometrical definition of the problem.
644 * \param[in] solver_container - Container with all the solutions.
645 * \param[in] config - Definition of the particular problem.
646 * \param[in] ExtIter - External iteration.
647 */
648 void SetInitialCondition(CGeometry **geometry,
649 CSolver ***solver_container,
650 CConfig *config,
651 unsigned long TimeIter) final;
652
653 /*!
654 * \brief Load a solution from a restart file.
655 * \param[in] geometry - Geometrical definition of the problem.
656 * \param[in] solver - Container vector with all of the solvers.
657 * \param[in] config - Definition of the particular problem.
658 * \param[in] val_iter - Current external iteration number.
659 * \param[in] val_update_geo - Flag for updating coords and grid velocity.
660 */
661 void LoadRestart(CGeometry **geometry,
662 CSolver ***solver,
663 CConfig *config,
664 int val_iter,
665 bool val_update_geo) final;
666
667};
Headers of the CSolver class which is inherited by all of the other solvers.
Main class for defining the Euler's adjoint flow solver.
Definition CAdjEulerSolver.hpp:39
void SetAuxVar_Surface_Gradient(CGeometry *geometry, const CConfig *config)
Compute the Least Squares gradient of an auxiliar variable on the profile surface.
Definition CAdjEulerSolver.cpp:3936
su2double * FlowPrimVar_i
Store the flow solution at point i.
Definition CAdjEulerSolver.hpp:64
void BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the engine inflow adjoint boundary condition.
Definition CAdjEulerSolver.cpp:3345
su2double PsiRho_Inf
PsiRho variable at the infinity.
Definition CAdjEulerSolver.hpp:42
su2double GetTotal_Sens_Mach() const final
Set the total Mach number sensitivity coefficient.
Definition CAdjEulerSolver.hpp:594
su2double GetTotal_Sens_Temp() const final
Set the total farfield temperature sensitivity coefficient.
Definition CAdjEulerSolver.hpp:615
su2double GetPsiRho_Inf(void) const final
Compute adjoint density at the infinity.
Definition CAdjEulerSolver.hpp:143
void BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose via the residual the adjoint symmetry boundary condition.
Definition CAdjEulerSolver.cpp:2369
void Upwind_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) final
Compute the spatial integration using a upwind scheme.
Definition CAdjEulerSolver.cpp:1077
su2double GetPhi_Inf(unsigned short val_dim) const final
Compute Phi (adjoint velocity) at the infinity.
Definition CAdjEulerSolver.hpp:156
void BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the supersonic outlet boundary condition.
Definition CAdjEulerSolver.cpp:2755
void Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep) final
Compute the spatial integration using a centered scheme for the adjoint equations.
Definition CAdjEulerSolver.cpp:1002
su2double * Phi_Inf
Phi vector at the infinity.
Definition CAdjEulerSolver.hpp:44
~CAdjEulerSolver(void) override
Destructor of the class.
Definition CAdjEulerSolver.cpp:339
su2double * Sens_AoA
Angle of attack sensitivity coefficient for each boundary.
Definition CAdjEulerSolver.hpp:47
void BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the supersonic inlet boundary condition.
Definition CAdjEulerSolver.cpp:2636
su2double * Sens_BPress
Back pressure sensitivity coefficient for each boundary.
Definition CAdjEulerSolver.hpp:51
su2double * Sens_Press
Pressure sensitivity coefficient for each boundary.
Definition CAdjEulerSolver.hpp:49
void BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the engine exhaust boundary condition.
Definition CAdjEulerSolver.cpp:3468
unsigned long GetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex) const final
Value of the characteristic global index at the boundaries.
Definition CAdjEulerSolver.hpp:257
su2double PsiE_Inf
PsiE variable at the infinity.
Definition CAdjEulerSolver.hpp:43
void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) final
Load a solution from a restart file.
Definition CAdjEulerSolver.cpp:3834
void SetFarfield_AoA(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, bool Output)
Update the AoA and freestream velocity at the farfield.
Definition CAdjEulerSolver.cpp:2118
su2double GetTotal_Sens_Geo() const final
Provide the total shape sensitivity coefficient.
Definition CAdjEulerSolver.hpp:587
su2double Total_Sens_Geo
Total shape sensitivity coefficient for all the boundaries.
Definition CAdjEulerSolver.hpp:56
su2double ** CSensitivity
Shape sensitivity coefficient for each boundary and vertex.
Definition CAdjEulerSolver.hpp:52
void BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the outlet boundary condition.
Definition CAdjEulerSolver.cpp:3054
su2double * Sens_Geo
Shape sensitivity coefficient for each boundary.
Definition CAdjEulerSolver.hpp:48
void Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override
Initialize the residual vectors.
Definition CAdjEulerSolver.cpp:913
void BC_ActDisk_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose an actuator disk inlet boundary condition.
Definition CAdjEulerSolver.cpp:3546
void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem) final
Set the total residual adding the term that comes from the Dual Time Strategy.
Definition CAdjEulerSolver.cpp:3773
su2double Total_Sens_BPress
Total sensitivity to back pressure.
Definition CAdjEulerSolver.hpp:59
void SetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var, su2double val_value)
Value of the characteristic variables at the boundaries.
Definition CAdjEulerSolver.hpp:232
su2double ** Jacobian_Axisymmetric
Storage for axisymmetric Jacobian.
Definition CAdjEulerSolver.hpp:61
su2double GetCSensitivity(unsigned short val_marker, unsigned long val_vertex) const final
Get the shape sensitivity coefficient.
Definition CAdjEulerSolver.hpp:565
su2double Gamma
Fluid's Gamma constant (ratio of specific heats).
Definition CAdjEulerSolver.hpp:62
void ExplicitRK_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep) final
Update the solution using a Runge-Kutta strategy.
Definition CAdjEulerSolver.cpp:1364
vector< vector< vector< su2double > > > DonorAdjVar
Value of the donor variables at each boundary.
Definition CAdjEulerSolver.hpp:53
bool Update_ACoeff
Definition CAdjEulerSolver.hpp:72
su2double ACoeff_old
Definition CAdjEulerSolver.hpp:71
void Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geometry, CConfig *config)
Parallelization of Undivided Laplacian.
Definition CAdjEulerSolver.cpp:378
su2double Total_Sens_Press
Total farfield sensitivity to pressure.
Definition CAdjEulerSolver.hpp:57
CAdjEulerVariable * nodes
The highest level in the variable hierarchy this solver can safely use.
Definition CAdjEulerSolver.hpp:74
su2double GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex, unsigned short val_var) const
Value of the characteristic variables at the boundaries.
Definition CAdjEulerSolver.hpp:245
su2double * FlowPrimVar_j
Store the flow solution at point j.
Definition CAdjEulerSolver.hpp:65
void BC_Euler_Wall(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) override
Impose via the residual the adjoint Euler wall boundary condition.
Definition CAdjEulerSolver.cpp:2225
su2double pnorm
Definition CAdjEulerSolver.hpp:68
void BC_ActDisk_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose an actuator disk outlet boundary condition.
Definition CAdjEulerSolver.cpp:3677
void Source_Template(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config, unsigned short iMesh) final
Source term integration.
Definition CAdjEulerSolver.cpp:1324
void Inviscid_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) final
Compute the inviscid sensitivity of the functional.
Definition CAdjEulerSolver.cpp:1516
vector< vector< unsigned long > > DonorGlobalIndex
Value of the donor global index.
Definition CAdjEulerSolver.hpp:66
su2double Total_Sens_Mach
Total mach sensitivity coefficient for all the boundaries.
Definition CAdjEulerSolver.hpp:54
su2double GetTotal_Sens_BPress() const final
Get the total Back pressure number sensitivity coefficient.
Definition CAdjEulerSolver.hpp:623
void Smooth_Sensitivity(CGeometry *geometry, CSolver **solver_container, CNumerics *numerics, CConfig *config) final
Smooth the inviscid sensitivity of the functional.
Definition CAdjEulerSolver.cpp:1986
void ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) final
Update the solution using an implicit solver.
Definition CAdjEulerSolver.cpp:1437
void SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned long Iteration) override
A virtual member.
Definition CAdjEulerSolver.cpp:368
void SetDonorGlobalIndex(unsigned short val_marker, unsigned long val_vertex, unsigned long val_index) final
Value of the characteristic global index at the boundaries.
Definition CAdjEulerSolver.hpp:265
su2double GetTotal_Sens_Press() const final
Set the total farfield pressure sensitivity coefficient.
Definition CAdjEulerSolver.hpp:608
const su2double * GetDonorAdjVar(unsigned short val_marker, unsigned long val_vertex) const
Value of the characteristic variables at the boundaries.
Definition CAdjEulerSolver.hpp:222
void SetForceProj_Vector(CGeometry *geometry, CSolver **solver_container, CConfig *config) final
Created the force projection vector for adjoint boundary conditions.
Definition CAdjEulerSolver.cpp:661
void ExplicitEuler_Iteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) final
Update the solution using a explicit Euler scheme.
Definition CAdjEulerSolver.cpp:1402
su2double ACoeff
Definition CAdjEulerSolver.hpp:71
su2double Gamma_Minus_One
Fluids's Gamma - 1.0 .
Definition CAdjEulerSolver.hpp:63
su2double Total_Sens_AoA
Total angle of attack sensitivity coefficient for all the boundaries.
Definition CAdjEulerSolver.hpp:55
void BC_Far_Field(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the boundary condition to the far field using characteristics.
Definition CAdjEulerSolver.cpp:2528
su2double * Sens_Mach
Mach sensitivity coefficient for each boundary.
Definition CAdjEulerSolver.hpp:46
su2double ACoeff_inc
Definition CAdjEulerSolver.hpp:71
su2double Total_Sens_Temp
Total farfield sensitivity to temperature.
Definition CAdjEulerSolver.hpp:58
CVariable * GetBaseClassPointerToNodes() override
Return nodes to allow CSolver::base_nodes to be set.
Definition CAdjEulerSolver.hpp:79
CAdjEulerSolver(void)
Constructor of the class.
Definition CAdjEulerSolver.cpp:32
void Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) override
Source term integration.
Definition CAdjEulerSolver.cpp:1218
void BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) final
Impose the inlet boundary condition.
Definition CAdjEulerSolver.cpp:2874
su2double GetPsiE_Inf(void) const final
Compute the adjoint energy at the infinity.
Definition CAdjEulerSolver.hpp:149
void SetCSensitivity(unsigned short val_marker, unsigned long val_vertex, su2double val_sensitivity) final
Set the shape sensitivity coefficient.
Definition CAdjEulerSolver.hpp:576
su2double * Sens_Temp
Temperature sensitivity coefficient for each boundary.
Definition CAdjEulerSolver.hpp:50
void BC_ActDisk(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker, bool val_inlet_surface) final
Impose an actuator disk inlet boundary condition.
Definition CAdjEulerSolver.cpp:3767
bool space_centered
True if space centered scheeme used.
Definition CAdjEulerSolver.hpp:60
void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) final
Set the initial condition for the Euler Equations.
Definition CAdjEulerSolver.cpp:885
void SetCentered_Dissipation_Sensor(CGeometry *geometry, CConfig *config)
Compute the sensor for higher order dissipation control in rotating problems.
Definition CAdjEulerSolver.cpp:1329
su2double Area_Monitored
Store the total area of the monitored outflow surface (used for normalization in continuous adjoint o...
Definition CAdjEulerSolver.hpp:69
su2double GetTotal_Sens_AoA() const final
Set the total angle of attack sensitivity coefficient.
Definition CAdjEulerSolver.hpp:601
Main class for defining the variables of the adjoint Euler solver.
Definition CAdjEulerVariable.hpp:38
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Definition CSolver.hpp:71
Main class for defining the variables.
Definition CVariable.hpp:50
passivedouble su2double
Definition code_config.hpp:181