SU2
driver_structure.hpp
Go to the documentation of this file.
1 
35 #pragma once
36 
37 #include "../../Common/include/mpi_structure.hpp"
38 #include "iteration_structure.hpp"
39 #include "solver_structure.hpp"
41 #include "output_structure.hpp"
42 #include "numerics_structure.hpp"
43 #include "transfer_structure.hpp"
44 #include "../../Common/include/geometry_structure.hpp"
45 #include "../../Common/include/grid_movement_structure.hpp"
46 #include "../../Common/include/config_structure.hpp"
47 #include "../../Common/include/interpolation_structure.hpp"
48 
49 using namespace std;
50 
57 class CDriver {
58 protected:
60  char runtime_file_name[MAX_STRING_SIZE];
61  su2double StartTime,
62  StopTime,
63  UsedTime;
64  unsigned long ExtIter;
65  ofstream ConvHist_file;
66  unsigned short iMesh,
67  iZone,
68  nZone,
69  nDim;
70  bool StopCalc,
71  fsi;
84  su2double APIVarCoord[3];
85  su2double APINodalForce[3];
86  su2double APINodalForceDensity[3];
88 public:
89 
97  CDriver(char* confFile,
98  unsigned short val_nZone,
99  unsigned short val_nDim,
100  SU2_Comm MPICommunicator);
101 
105  virtual ~CDriver(void);
106 
110  virtual void Run() { };
111 
115  void Geometrical_Preprocessing();
116 
123  void Iteration_Preprocessing();
124 
131  void Solver_Preprocessing(CSolver ***solver_container, CGeometry **geometry, CConfig *config);
132 
139  void Solver_Postprocessing(CSolver ***solver_container, CGeometry **geometry, CConfig *config);
140 
147  void Integration_Preprocessing(CIntegration **integration_container, CGeometry **geometry, CConfig *config);
148 
155  void Integration_Postprocessing(CIntegration **integration_container, CGeometry **geometry, CConfig *config);
156 
160  void Interface_Preprocessing();
161 
169  void Numerics_Preprocessing(CNumerics ****numerics_container, CSolver ***solver_container, CGeometry **geometry, CConfig *config);
170 
178  void Numerics_Postprocessing(CNumerics ****numerics_container, CSolver ***solver_container, CGeometry **geometry, CConfig *config);
179 
183  void Postprocessing();
184 
190  virtual void Predict_Displacements(unsigned short donorZone, unsigned short targetZone) {};
191 
197  virtual void Predict_Tractions(unsigned short donorZone, unsigned short targetZone) {};
198 
204  virtual void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) {};
205 
211  virtual void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) {};
212 
219  virtual void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iFSIIter) {};
220 
227  virtual void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iFSIIter) {};
228 
232  virtual void Update() {};
233 
237  void StartSolver();
238 
242  virtual void ResetConvergence() { };
243 
247  void PreprocessExtIter(unsigned long ExtIter);
248 
252  bool Monitor(unsigned long ExtIter);
253 
257  void Output(unsigned long ExtIter);
258 
262  virtual void DynamicMeshUpdate(unsigned long ExtIter) { };
263 
267  virtual void StaticMeshUpdate() { };
268 
272  virtual void SetInitialMesh() { };
273 
278  su2double Get_Drag();
279 
284  su2double Get_Lift();
285 
290  su2double Get_Mx();
291 
296  su2double Get_My();
297 
302  su2double Get_Mz();
303 
308  su2double Get_DragCoeff();
309 
314  su2double Get_LiftCoeff();
315 
320  unsigned short GetMovingMarker();
321 
327  unsigned long GetNumberVertices(unsigned short iMarker);
328 
334  unsigned long GetNumberHaloVertices(unsigned short iMarker);
335 
342  bool IsAHaloNode(unsigned short iMarker, unsigned short iVertex);
343 
348  unsigned long GetnExtIter();
349 
356  unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned short iVertex);
357 
364  su2double GetVertexCoordX(unsigned short iMarker, unsigned short iVertex);
365 
372  su2double GetVertexCoordY(unsigned short iMarker, unsigned short iVertex);
373 
380  su2double GetVertexCoordZ(unsigned short iMarker, unsigned short iVertex);
381 
388  bool ComputeVertexForces(unsigned short iMarker, unsigned short iVertex);
389 
396  su2double GetVertexForceX(unsigned short iMarker, unsigned short iVertex);
397 
404  su2double GetVertexForceY(unsigned short iMarker, unsigned short iVertex);
405 
412  su2double GetVertexForceZ(unsigned short iMarker, unsigned short iVertex);
413 
420  su2double GetVertexForceDensityX(unsigned short iMarker, unsigned short iVertex);
421 
428  su2double GetVertexForceDensityY(unsigned short iMarker, unsigned short iVertex);
429 
436  su2double GetVertexForceDensityZ(unsigned short iMarker, unsigned short iVertex);
437 
444  void SetVertexCoordX(unsigned short iMarker, unsigned short iVertex, su2double newPosX);
445 
452  void SetVertexCoordY(unsigned short iMarker, unsigned short iVertex, su2double newPosY);
453 
460  void SetVertexCoordZ(unsigned short iMarker, unsigned short iVertex, su2double newPosZ);
461 
468  su2double SetVertexVarCoord(unsigned short iMarker, unsigned short iVertex);
469 
470 };
471 
478 class CGeneralDriver : public CDriver {
479 public:
480 
488  CGeneralDriver(char* confFile,
489  unsigned short val_nZone,
490  unsigned short val_nDim,
491  SU2_Comm MPICommunicator);
492 
496  ~CGeneralDriver(void);
497 
501  void Run();
502 
506  void Update();
507 
511  void ResetConvergence();
512 
516  void DynamicMeshUpdate(unsigned long ExtIter);
517 
521  void StaticMeshUpdate();
522 
526  void SetInitialMesh();
527 };
528 
529 
536 class CFluidDriver : public CDriver {
537 public:
538 
546  CFluidDriver(char* confFile,
547  unsigned short val_nZone,
548  unsigned short val_nDim,
549  SU2_Comm MPICommunicator);
550 
554  ~CFluidDriver(void);
555 
559  void Run();
560 
564  void Update();
565 
569  void ResetConvergence();
570 
574  void DynamicMeshUpdate(unsigned long ExtIter);
575 
579  void StaticMeshUpdate();
580 
584  void SetInitialMesh();
585 
589  void Transfer_Data(unsigned short donorZone, unsigned short targetZone);
590 };
591 
592 
599 class CHBDriver : public CDriver {
600 
601 private:
602 
603  su2double **D;
605 public:
606 
614  CHBDriver(char* confFile,
615  unsigned short val_nZone,
616  unsigned short val_nDim,
617  SU2_Comm MPICommunicator);
618 
622  ~CHBDriver(void);
623 
627  void Run();
628 
634  void SetHarmonicBalance(unsigned short iZone);
635 
640  void ComputeHB_Operator();
641 
645  void Update();
646 
650  void ResetConvergence();
651 };
652 
653 
660 class CFSIDriver : public CDriver {
661 public:
662 
669  CFSIDriver(char* confFile,
670  unsigned short val_nZone,
671  unsigned short val_nDim,
672  SU2_Comm MPICommunicator);
673 
677  ~CFSIDriver(void);
678 
682  void Run();
683 
689  void Predict_Displacements(unsigned short donorZone, unsigned short targetZone);
690 
696  void Predict_Tractions(unsigned short donorZone, unsigned short targetZone);
697 
703  void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone);
704 
710  void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone);
711 
718  void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iFSIIter);
719 
726  void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iFSIIter);
727 
733  void Update(unsigned short zoneFlow, unsigned short zoneStruct);
734  using CDriver::Update;
735 };
virtual void StaticMeshUpdate()
Perform a static mesh deformation, without considering grid velocity.
Definition: driver_structure.hpp:267
ofstream ConvHist_file
Convergence history file.
Definition: driver_structure.hpp:65
CSurfaceMovement ** surface_movement
Surface movement classes of the problem.
Definition: driver_structure.hpp:79
Class for writing the flow, adjoint and linearized solver solution (including the history solution...
Definition: output_structure.hpp:64
Headers of the main subroutines for generating the file outputs. The subroutines and functions are in...
unsigned short nZone
Total number of zones in the problem.
Definition: driver_structure.hpp:66
CIntegration *** integration_container
Container vector with all the integration methods.
Definition: driver_structure.hpp:74
virtual void Predict_Displacements(unsigned short donorZone, unsigned short targetZone)
A virtual member.
Definition: driver_structure.hpp:190
Class for driving an iteration of the physics within multiple zones.
Definition: driver_structure.hpp:536
virtual void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iFSIIter)
A virtual member.
Definition: driver_structure.hpp:227
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition: geometry_structure.hpp:72
Main class for defining the physical transfer of information.
Definition: transfer_structure.hpp:62
Class for driving an iteration of Harmonic Balance (HB) method problem using multiple time zones...
Definition: driver_structure.hpp:599
CFreeFormDefBox *** FFDBox
FFD FFDBoxes of the problem.
Definition: driver_structure.hpp:81
Headers of the main subroutines for space and time integration. The subroutines and functions are in ...
su2double UsedTime
Elapsed time between Start and Stop point of the timer.
Definition: driver_structure.hpp:61
bool StopCalc
Stop computation flag.
Definition: driver_structure.hpp:70
Main class for defining the PDE solution, it requires a child class for each particular solver (Euler...
Definition: solver_structure.hpp:71
virtual void ResetConvergence()
A virtual member.
Definition: driver_structure.hpp:242
Headers of the main subroutines used by SU2_CFD. The subroutines and functions are in the definition_...
virtual void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone)
A virtual member.
Definition: driver_structure.hpp:211
CConfig ** config_container
Definition of the particular problem.
Definition: driver_structure.hpp:78
Class for moving the surface numerical grid.
Definition: grid_movement_structure.hpp:1287
const unsigned int MAX_STRING_SIZE
Maximum number of domains.
Definition: option_structure.hpp:117
Class for driving a structural iteration of the physics within multiple zones.
Definition: driver_structure.hpp:478
Parent class for driving an iteration of a single or multi-zone problem.
Definition: driver_structure.hpp:57
CNumerics ***** numerics_container
Description of the numerical method (the way in which the equations are solved).
Definition: driver_structure.hpp:77
Class for moving the volumetric numerical grid.
Definition: grid_movement_structure.hpp:955
CGeometry *** geometry_container
Geometrical definition of the problem.
Definition: driver_structure.hpp:75
virtual void SetInitialMesh()
Perform a mesh deformation as initial condition.
Definition: driver_structure.hpp:272
CInterpolator *** interpolator_container
Definition of the interpolation method between non-matching discretizations of the interface...
Definition: driver_structure.hpp:82
Headers of the main subroutines for the dumerical definition of the problem. The subroutines and func...
Class for defining the free form FFDBox structure.
Definition: grid_movement_structure.hpp:273
virtual void Run()
A virtual member.
Definition: driver_structure.hpp:110
Main class for doing the space integration, time integration, and monitoring of a system of Partial D...
Definition: integration_structure.hpp:57
Class for driving a BGS iteration for a fluid-structure interaction problem in multiple zones...
Definition: driver_structure.hpp:660
Main class for defining the interpolator, it requires a child class for each particular interpolation...
Definition: interpolation_structure.hpp:57
Class for defining the numerical methods.
Definition: numerics_structure.hpp:59
CTransfer *** transfer_container
Definition of the transfer of information and the physics involved in the interface.
Definition: driver_structure.hpp:83
virtual void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iFSIIter)
A virtual member.
Definition: driver_structure.hpp:219
virtual void DynamicMeshUpdate(unsigned long ExtIter)
Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid s...
Definition: driver_structure.hpp:262
virtual void Update()
A virtual member.
Definition: driver_structure.hpp:232
CVolumetricMovement ** grid_movement
Volume grid movement classes of the problem.
Definition: driver_structure.hpp:80
virtual void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone)
A virtual member.
Definition: driver_structure.hpp:204
COutput * output
Pointer to the COutput class.
Definition: driver_structure.hpp:73
unsigned long ExtIter
External iteration.
Definition: driver_structure.hpp:64
Headers of the transfer structure The subroutines and functions are in the transfer_structure.cpp and transfer_physics.cpp files.
Parent class for defining a single iteration of a physics problem.
Definition: iteration_structure.hpp:58
Headers of the main subroutines for solving partial differential equations. The subroutines and funct...
CIteration ** iteration_container
Container vector with all the iteration methods.
Definition: driver_structure.hpp:72
Main class for defining the problem; basically this class reads the configuration file...
Definition: config_structure.hpp:68
virtual void Predict_Tractions(unsigned short donorZone, unsigned short targetZone)
A virtual member.
Definition: driver_structure.hpp:197
char * config_file_name
Configuration file name of the problem.
Definition: driver_structure.hpp:59
CSolver **** solver_container
Container vector with all the solutions.
Definition: driver_structure.hpp:76