diff --git a/.travis.yml b/.travis.yml index 07b1bda0b8d3..09224bc7c3da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,11 +72,11 @@ install: before_script: # Get the test cases - - git clone -b develop https://github.com/su2code/TestCases.git ./TestData + - git clone --depth=1 -b feature_input_output https://github.com/su2code/TestCases.git ./TestData - cp -R ./TestData/* ./TestCases/ # Get the tutorial cases - - git clone -b develop https://github.com/su2code/su2code.github.io ./Tutorials + - git clone --depth=1 -b feature_input_output https://github.com/su2code/su2code.github.io ./Tutorials # Enter the SU2/TestCases/ directory, which is now ready to run - cd TestCases/ diff --git a/Common/include/config_structure.hpp b/Common/include/config_structure.hpp index 4776ca081d00..95c7c13cd9d7 100644 --- a/Common/include/config_structure.hpp +++ b/Common/include/config_structure.hpp @@ -86,22 +86,13 @@ class CConfig { unsigned short nZoneSpecified; /*!< \brief Number of zones that are specified in config file. */ su2double Highlite_Area; /*!< \brief Highlite area. */ su2double Fan_Poly_Eff; /*!< \brief Highlite area. */ - su2double OrderMagResidual; /*!< \brief Order of magnitude reduction. */ su2double MinLogResidual; /*!< \brief Minimum value of the log residual. */ - su2double OrderMagResidualFSI; /*!< \brief Order of magnitude reduction. */ - su2double MinLogResidualFSI; /*!< \brief Minimum value of the log residual. */ - su2double OrderMagResidual_BGS_F; /*!< \brief Order of magnitude reduction. */ - su2double MinLogResidual_BGS_F; /*!< \brief Minimum value of the log residual. */ - su2double OrderMagResidual_BGS_S; /*!< \brief Order of magnitude reduction. */ - su2double MinLogResidual_BGS_S; /*!< \brief Minimum value of the log residual. */ - su2double Res_FEM_UTOL; /*!< \brief UTOL criteria for structural FEM. */ - su2double Res_FEM_RTOL; /*!< \brief RTOL criteria for structural FEM. */ - su2double Res_FEM_ETOL; /*!< \brief ETOL criteria for structural FEM. */ - su2double Res_FEM_ADJ; /*!< \brief Convergence criteria for adjoint FEM. */ su2double EA_ScaleFactor; /*!< \brief Equivalent Area scaling factor */ su2double* EA_IntLimit; /*!< \brief Integration limits of the Equivalent Area computation */ su2double AdjointLimit; /*!< \brief Adjoint variable limit */ su2double* Obj_ChainRuleCoeff; /*!< \brief Array defining objective function for adjoint problem based on chain rule in terms of gradient w.r.t. density, velocity, pressure */ + string* ConvField; + unsigned short nConvField; bool MG_AdjointFlow; /*!< \brief MG with the adjoint flow problem */ su2double* SubsonicEngine_Cyl; /*!< \brief Coordinates of the box subsonic region */ su2double* SubsonicEngine_Values; /*!< \brief Values of the box subsonic region */ @@ -120,7 +111,7 @@ class CConfig { su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */ su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */ su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */ - bool Write_Conv_FSI; /*!< \brief Write convergence file for FSI problems. */ + su2double StartTime; bool ContinuousAdjoint, /*!< \brief Flag to know if the code is solving an adjoint problem. */ Viscous, /*!< \brief Flag to know if the code is solving a viscous problem. */ EquivArea, /*!< \brief Flag to know if the code is going to compute and plot the equivalent area. */ @@ -163,7 +154,7 @@ class CConfig { su2double CL_Target; /*!< \brief Weight of the drag coefficient. */ su2double CM_Target; /*!< \brief Weight of the drag coefficient. */ su2double *HTP_Min_XCoord, *HTP_Min_YCoord; /*!< \brief Identification of the HTP. */ - unsigned short Unsteady_Simulation; /*!< \brief Steady or unsteady (time stepping or dual time stepping) computation. */ + unsigned short TimeMarching; /*!< \brief Steady or unsteady (time stepping or dual time stepping) computation. */ unsigned short Dynamic_Analysis; /*!< \brief Static or dynamic structural analysis. */ unsigned short nStartUpIter; /*!< \brief Start up iterations using the fine grid. */ su2double FixAzimuthalLine; /*!< \brief Fix an azimuthal line due to misalignments of the nearfield. */ @@ -402,6 +393,8 @@ class CConfig { unsigned long ExtIter_OffSet; /*!< \brief External iteration number offset. */ unsigned long IntIter; /*!< \brief Current internal iteration number. */ unsigned long OuterIter; /*!< \brief Current Outer Iteration for multizone problems. */ + unsigned long InnerIter; /*!< \brief Current Outer Iteration for multizone problems. */ + unsigned long TimeIter; /*!< \brief Current Outer Iteration for multizone problems. */ unsigned long Unst_nIntIter; /*!< \brief Number of internal iterations (Dual time Method). */ unsigned long Dyn_nIntIter; /*!< \brief Number of internal iterations (Newton-Raphson Method for nonlinear structural analysis). */ long Unst_RestartIter; /*!< \brief Iteration number to restart an unsteady simulation (Dual time Method). */ @@ -646,7 +639,6 @@ class CConfig { Wrt_Sol_Freq_DualTime, /*!< \brief Writing solution frequency for Dual Time. */ Wrt_Con_Freq, /*!< \brief Writing convergence history frequency. */ Wrt_Con_Freq_DualTime; /*!< \brief Writing convergence history frequency. */ - bool Wrt_Unsteady; /*!< \brief Write unsteady data adding header and prefix. */ bool Wrt_Dynamic; /*!< \brief Write dynamic data adding header and prefix. */ bool Restart, /*!< \brief Restart solution (for direct, adjoint, and linearized problems).*/ Wrt_Binary_Restart, /*!< \brief Write binary SU2 native restart files.*/ @@ -712,7 +704,7 @@ class CConfig { unsigned short Analytical_Surface; /*!< \brief Information about the analytical definition of the surface for grid adaptation. */ unsigned short Geo_Description; /*!< \brief Description of the geometry. */ unsigned short Mesh_FileFormat; /*!< \brief Mesh input format. */ - unsigned short Output_FileFormat; /*!< \brief Format of the output files. */ + unsigned short Tab_FileFormat; /*!< \brief Format of the output files. */ unsigned short ActDisk_Jump; /*!< \brief Format of the output files. */ bool CFL_Adapt; /*!< \brief Adaptive CFL number. */ bool HB_Precondition; /*< \brief Flag to turn on harmonic balance source term preconditioning */ @@ -738,37 +730,24 @@ class CConfig { su2double* Mesh_Box_Offset; /*!< \brief Array containing the offset from 0.0 in the x-, y-, and z-directions for the analytic RECTANGLE and BOX grid formats. */ string Mesh_FileName, /*!< \brief Mesh input file. */ Mesh_Out_FileName, /*!< \brief Mesh output file. */ - Solution_FlowFileName, /*!< \brief Flow solution input file. */ + Solution_FileName, /*!< \brief Flow solution input file. */ Solution_LinFileName, /*!< \brief Linearized flow solution input file. */ Solution_AdjFileName, /*!< \brief Adjoint solution input file for drag functional. */ - Solution_FEMFileName, /*!< \brief Solution input file for structural problem. */ - Solution_AdjFEMFileName, /*!< \brief Adjoint solution input file for structural problem. */ - Flow_FileName, /*!< \brief Flow variables output file. */ - Structure_FileName, /*!< \brief Structure variables output file. */ - SurfStructure_FileName, /*!< \brief Surface structure variables output file. */ - AdjStructure_FileName, /*!< \brief Structure variables output file. */ - AdjSurfStructure_FileName, /*!< \brief Surface structure variables output file. */ - SurfHeat_FileName, /*!< \brief Surface structure variables output file. */ - Heat_FileName, /*!< \brief Heat variables output file. */ + Volume_FileName, /*!< \brief Flow variables output file. */ Residual_FileName, /*!< \brief Residual variables output file. */ Conv_FileName, /*!< \brief Convergence history output file. */ Breakdown_FileName, /*!< \brief Breakdown output file. */ - Conv_FileName_FSI, /*!< \brief Convergence history output file. */ - Restart_FlowFileName, /*!< \brief Restart file for flow variables. */ - Restart_HeatFileName, /*!< \brief Restart file for heat variables. */ + Restart_FileName, /*!< \brief Restart file for flow variables. */ Restart_AdjFileName, /*!< \brief Restart file for adjoint variables, drag functional. */ - Restart_FEMFileName, /*!< \brief Restart file for FEM elasticity. */ - Restart_AdjFEMFileName, /*!< \brief Restart file for FEM elasticity. */ Adj_FileName, /*!< \brief Output file with the adjoint variables. */ ObjFunc_Grad_FileName, /*!< \brief Gradient of the objective function. */ ObjFunc_Value_FileName, /*!< \brief Objective function. */ - SurfFlowCoeff_FileName, /*!< \brief Output file with the flow variables on the surface. */ + SurfCoeff_FileName, /*!< \brief Output file with the flow variables on the surface. */ SurfAdjCoeff_FileName, /*!< \brief Output file with the adjoint variables on the surface. */ New_SU2_FileName, /*!< \brief Output SU2 mesh file converted from CGNS format. */ SurfSens_FileName, /*!< \brief Output file for the sensitivity on the surface (discrete adjoint). */ VolSens_FileName; /*!< \brief Output file for the sensitivity in the volume (discrete adjoint). */ - bool Low_MemoryOutput, /*!< \brief Output less information for lower memory use */ - Wrt_Output, /*!< \brief Write any output files */ + bool Wrt_Output, /*!< \brief Write any output files */ Wrt_Vol_Sol, /*!< \brief Write a volume solution file */ Wrt_Srf_Sol, /*!< \brief Write a surface solution file */ Wrt_Csv_Sol, /*!< \brief Write a surface comma-separated values solution file */ @@ -1078,17 +1057,30 @@ class CConfig { ofstream *ConvHistFile; /*!< \brief Store the pointer to each history file */ bool Time_Domain; /*!< \brief Determines if the multizone problem is solved in time-domain */ - unsigned long Outer_Iter, /*!< \brief Determines the number of outer iterations in the multizone problem */ - Inner_Iter, /*!< \brief Determines the number of inner iterations in each multizone block */ - Time_Iter, /*!< \brief Determines the number of time iterations in the multizone problem */ - Iter, /*!< \brief Determines the number of pseudo-time iterations in a single-zone problem */ + unsigned long nOuterIter, /*!< \brief Determines the number of outer iterations in the multizone problem */ + nInnerIter, /*!< \brief Determines the number of inner iterations in each multizone block */ + nTimeIter, /*!< \brief Determines the number of time iterations in the multizone problem */ + nIter, /*!< \brief Determines the number of pseudo-time iterations in a single-zone problem */ Restart_Iter; /*!< \brief Determines the restart iteration in the multizone problem */ su2double Time_Step; /*!< \brief Determines the time step for the multizone problem */ su2double Max_Time; /*!< \brief Determines the maximum time for the time-domain problems */ + su2double *default_wrt_freq; + unsigned long HistoryWrtFreq[3], /*!< \brief Array containing history writing frequencies for timer iter, outer iter, inner iter */ + ScreenWrtFreq[3]; /*!< \brief Array containing screen writing frequencies for timer iter, outer iter, inner iter */ + unsigned long VolumeWrtFreq; /*!< \brief Writing frequency for solution files. */ + unsigned short* VolumeOutputFiles; /*!< \brief File formats to output */ + unsigned short nVolumeOutputFiles; /*!< \brief Number of File formats to output */ + bool Multizone_Mesh; /*!< \brief Determines if the mesh contains multiple zones. */ bool SinglezoneDriver; /*!< \brief Determines if the single-zone driver is used. (TEMPORARY) */ + bool Wrt_ZoneConv; /*!< \brief Write the convergence history of each individual zone to screen. */ + bool Wrt_ZoneHist; /*!< \brief Write the convergence history of each individual zone to file. */ bool SpecialOutput, /*!< \brief Determines if the special output is written. */ Wrt_ForcesBreakdown; /*!< \brief Determines if the forces breakdown file is written. */ + string *ScreenOutput, /*!< \brief Kind of the screen output. */ + *HistoryOutput, *VolumeOutput; /*!< \brief Kind of the output printed to the history file. */ + unsigned short nScreenOutput, /*!< \brief Number of screen output variables (max: 6). */ + nHistoryOutput, nVolumeOutput; /*!< \brief Number of variables printed to the history file. */ bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */ bool using_uq; /*!< \brief Using uncertainty quantification with SST model */ @@ -2973,7 +2965,6 @@ class CConfig { * \return Total number of boundary markers. */ unsigned short GetnMarker_NearFieldBound(void); - /*! * \brief Get the total number of deformable markers at the boundary. * \return Total number of deformable markers at the boundary. @@ -3064,12 +3055,6 @@ class CConfig { */ void SetnMarker_All(unsigned short val_nmarker); - /*! - * \brief Get the number of external iterations. - * \return Number of external iterations. - */ - unsigned long GetnExtIter(void); - /*! * \brief Get the number of internal iterations. * \return Number of internal iterations. @@ -3082,12 +3067,6 @@ class CConfig { */ unsigned long GetDyn_nIntIter(void); - /*! - * \brief Get the restart iteration number for unsteady simulations. - * \return Restart iteration number for unsteady simulations. - */ - long GetUnst_RestartIter(void); - /*! * \brief Get the starting direct iteration number for the unsteady adjoint (reverse time integration). * \return Starting direct iteration number for the unsteady adjoint. @@ -3100,12 +3079,6 @@ class CConfig { */ unsigned long GetIter_Avg_Objective(void); - /*! - * \brief Get the restart iteration number for dynamic structural simulations. - * \return Restart iteration number for dynamic structural simulations. - */ - long GetDyn_RestartIter(void); - /*! * \brief Retrieves the number of periodic time instances for Harmonic Balance. * \return: Number of periodic time instances for Harmonic Balance. @@ -3118,43 +3091,35 @@ class CConfig { */ su2double GetHarmonicBalance_Period(void); - /*! - * \brief Set the number of external iterations. - * \note This is important in no time depending methods, where only - * one external iteration is needed. - * \param[in] val_niter - Set the number of external iterations. - */ - void SetnExtIter(unsigned long val_niter); - /*! * \brief Set the current external iteration number. * \param[in] val_iter - Current external iteration number. */ - void SetExtIter(unsigned long val_iter); + void SetExtIter_OffSet(unsigned long val_iter); /*! - * \brief Set the current external iteration number. - * \param[in] val_iter - Current external iteration number. + * \brief Set the current FSI iteration number. + * \param[in] val_iter - Current FSI iteration number. */ - void SetExtIter_OffSet(unsigned long val_iter); + void SetOuterIter(unsigned long val_iter); /*! * \brief Set the current FSI iteration number. * \param[in] val_iter - Current FSI iteration number. */ - void SetOuterIter(unsigned long val_iter); + void SetInnerIter(unsigned long val_iter); /*! - * \brief Set the current internal iteration number. - * \param[in] val_iter - Current external iteration number. + * \brief Set the current time iteration number. + * \param[in] val_iter - Current FSI iteration number. */ - void SetIntIter(unsigned long val_iter); + void SetTimeIter(unsigned long val_iter); /*! - * \brief Get the current external iteration number. - * \return Current external iteration. + * \brief Get the current time iteration number. + * \param[in] val_iter - Current time iterationnumber. */ - unsigned long GetExtIter(void); + unsigned long GetTimeIter(); /*! * \brief Get the current internal iteration number. @@ -3169,11 +3134,11 @@ class CConfig { unsigned long GetOuterIter(void); /*! - * \brief Get the current internal iteration number. - * \return Current internal iteration. + * \brief Get the current FSI iteration number. + * \return Current FSI iteration. */ - unsigned long GetIntIter(void); - + unsigned long GetInnerIter(void); + /*! * \brief Set the current physical time. * \param[in] val_t - Current physical time. @@ -3233,13 +3198,7 @@ class CConfig { * \return TRUE means that a volume solution file will be written. */ bool GetWrt_Vol_Sol(void); - - /*! - * \brief Get information about writing a volume solution file. - * \return TRUE means that a volume solution file will be written. - */ - bool GetLow_MemoryOutput(void); - + /*! * \brief Get information about writing a surface solution file. * \return TRUE means that a surface solution file will be written. @@ -4784,12 +4743,6 @@ class CConfig { */ bool GetFrozen_Limiter_Disc(void); - /*! - * \brief Write convergence file for FSI problems - * \return FALSE means no file is written. - */ - bool GetWrite_Conv_FSI(void); - /*! * \brief Provides information about if the sharp edges are going to be removed from the sensitivity. * \return FALSE means that the sharp edges will be removed from the sensitivity. @@ -5196,7 +5149,7 @@ class CConfig { * \return The kind of time integration: Steady state, time stepping method (unsteady) or * dual time stepping method (unsteady). */ - unsigned short GetUnsteady_Simulation(void); + unsigned short GetTime_Marching(void); /*! * \brief Provides the number of chemical reactions in the chemistry model @@ -5421,7 +5374,7 @@ class CConfig { * \brief Get the name of the file with the solution of the flow problem. * \return Name of the file with the solution of the flow problem. */ - string GetSolution_FlowFileName(void); + string GetSolution_FileName(void); /*! * \brief Get the name of the file with the solution of the adjoint flow problem @@ -5430,19 +5383,7 @@ class CConfig { * drag objective function. */ string GetSolution_AdjFileName(void); - - /*! - * \brief Get the name of the file with the solution of the structural problem. - * \return Name of the file with the solution of the structural problem. - */ - string GetSolution_FEMFileName(void); - - /*! - * \brief Get the name of the file with the solution of the adjoint structural problem. - * \return Name of the file with the solution of the structural problem. - */ - string GetSolution_AdjFEMFileName(void); - + /*! * \brief Get the name of the file with the residual of the problem. * \return Name of the file with the residual of the problem. @@ -5459,7 +5400,7 @@ class CConfig { * \brief Get the format of the output solution. * \return Format of the output solution. */ - unsigned short GetOutput_FileFormat(void); + unsigned short GetTabular_FileFormat(void); /*! * \brief Get the format of the output solution. @@ -5472,13 +5413,7 @@ class CConfig { * \return Name of the file with convergence history of the problem. */ string GetConv_FileName(void); - - /*! - * \brief Get the name of the file with the convergence history of the problem for FSI applications. - * \return Name of the file with convergence history of the problem. - */ - string GetConv_FileName_FSI(void); - + /*! * \brief Get the name of the file with the forces breakdown of the problem. * \return Name of the file with forces breakdown of the problem. @@ -5489,67 +5424,40 @@ class CConfig { * \brief Get the name of the file with the flow variables. * \return Name of the file with the primitive variables. */ - string GetFlow_FileName(void); - - /*! - * \brief Get the name of the file with the structure variables. - * \return Name of the file with the structure variables. - */ - string GetStructure_FileName(void); - - /*! - * \brief Get the name of the file with the structure variables. - * \return Name of the file with the structure variables. - */ - string GetSurfStructure_FileName(void); - - /*! - * \brief Get the name of the file with the adjoint structure variables. - * \return Name of the file with the adjoint structure variables. - */ - string GetAdjStructure_FileName(void); - - /*! - * \brief Get the name of the file with the adjoint structure variables. - * \return Name of the file with the adjoint structure variables. - */ - string GetAdjSurfStructure_FileName(void); - - /*! - * \brief Get the name of the file with the structure variables. - * \return Name of the file with the structure variables. - */ - string GetSurfHeat_FileName(void); - - /*! - * \brief Get the name of the file with the wave variables. - * \return Name of the file with the wave variables. - */ - string GetHeat_FileName(void); - + string GetVolume_FileName(void); + /*! * \brief Get the name of the restart file for the heat variables. * \return Name of the restart file for the flow variables. */ string GetRestart_HeatFileName(void); + /*! + * \brief Add any numbers necessary to the filename (iteration number, zone ID ...) + * \param[in] config - Definition of the particular problem. + * \param[in] filename - the base filename. + * \param[in] ext - the extension to be added. + * \return The new filename + */ + string GetFilename(string filename, string ext, unsigned long Iter); + /*! * \brief Append the zone index to the restart or the solution files. * \return Name of the restart file for the flow variables. */ - string GetMultizone_FileName(string val_filename, int val_iZone); + string GetMultizone_FileName(string val_filename, int val_iZone, string ext); /*! * \brief Append the zone index to the restart or the solution files. * \return Name of the restart file for the flow variables. */ - string GetMultizone_HistoryFileName(string val_filename, int val_iZone); + string GetMultizone_HistoryFileName(string val_filename, int val_iZone, string ext); /*! * \brief Append the instance index to the restart or the solution files. * \return Name of the restart file for the flow variables. */ - string GetMultiInstance_FileName(string val_filename, int val_iInst); + string GetMultiInstance_FileName(string val_filename, int val_iInst, string ext); /*! * \brief Append the instance index to the restart or the solution files. @@ -5561,26 +5469,14 @@ class CConfig { * \brief Get the name of the restart file for the flow variables. * \return Name of the restart file for the flow variables. */ - string GetRestart_FlowFileName(void); + string GetRestart_FileName(void); /*! * \brief Get the name of the restart file for the adjoint variables (drag objective function). * \return Name of the restart file for the adjoint variables (drag objective function). */ string GetRestart_AdjFileName(void); - - /*! - * \brief Get the name of the restart file for the structural variables. - * \return Name of the restart file for the structural variables. - */ - string GetRestart_FEMFileName(void); - - /*! - * \brief Get the name of the restart file for the structural adjoint variables. - * \return Name of the restart file for the structural adjoint variables. - */ - string GetRestart_AdjFEMFileName(void); - + /*! * \brief Get the name of the file with the adjoint variables. * \return Name of the file with the adjoint variables. @@ -5603,7 +5499,7 @@ class CConfig { * \brief Get the name of the file with the surface information for the flow problem. * \return Name of the file with the surface information for the flow problem. */ - string GetSurfFlowCoeff_FileName(void); + string GetSurfCoeff_FileName(void); /*! * \brief Get the name of the file with the surface information for the adjoint problem. @@ -5629,7 +5525,7 @@ class CConfig { * \param[in] val_iter - Unsteady iteration number or time instance. * \return Name of the file with the iteration number for an unsteady solution file. */ - string GetUnsteady_FileName(string val_filename, int val_iter); + string GetUnsteady_FileName(string val_filename, int val_iter, string ext); /*! * \brief Append the input filename string with the appropriate objective function extension. @@ -6289,78 +6185,12 @@ class CConfig { */ unsigned short GetContainerPosition(unsigned short val_eqsystem); - /*! - * \brief Value of the order of magnitude reduction of the residual. - * \return Value of the order of magnitude reduction of the residual. - */ - su2double GetOrderMagResidual(void); - /*! * \brief Value of the minimum residual value (log10 scale). * \return Value of the minimum residual value (log10 scale). */ su2double GetMinLogResidual(void); - /*! - * \brief Value of the order of magnitude reduction of the residual for FSI applications. - * \return Value of the order of magnitude reduction of the residual. - */ - su2double GetOrderMagResidualFSI(void); - - /*! - * \brief Value of the minimum residual value for FSI applications (log10 scale). - * \return Value of the minimum residual value (log10 scale). - */ - su2double GetMinLogResidualFSI(void); - - /*! - * \brief Value of the order of magnitude reduction of the flow residual for BGS applications. - * \return Value of the order of magnitude reduction of the residual. - */ - su2double GetOrderMagResidual_BGS_F(void); - - /*! - * \brief Value of the minimum flow residual value for BGS applications (log10 scale). - * \return Value of the minimum residual value (log10 scale). - */ - su2double GetMinLogResidual_BGS_F(void); - - /*! - * \brief Value of the order of magnitude reduction of the flow residual for BGS applications. - * \return Value of the order of magnitude reduction of the residual. - */ - su2double GetOrderMagResidual_BGS_S(void); - - /*! - * \brief Value of the minimum flow residual value for BGS applications (log10 scale). - * \return Value of the minimum residual value (log10 scale). - */ - su2double GetMinLogResidual_BGS_S(void); - - /*! - * \brief Value of the displacement tolerance UTOL for FEM structural analysis (log10 scale). - * \return Value of Res_FEM_UTOL (log10 scale). - */ - su2double GetResidual_FEM_UTOL(void); - - /*! - * \brief Value of the displacement tolerance UTOL for FEM structural analysis (log10 scale). - * \return Value of Res_FEM_UTOL (log10 scale). - */ - su2double GetResidual_FEM_RTOL(void); - - /*! - * \brief Value of the displacement tolerance UTOL for FEM structural analysis (log10 scale). - * \return Value of Res_FEM_UTOL (log10 scale). - */ - su2double GetResidual_FEM_ETOL(void); - - /*! - * \brief Value of the maximum objective function for FEM elasticity adjoint (log10 scale). - * \return Value of Res_FEM_ADJ (log10 scale). - */ - su2double GetCriteria_FEM_ADJ(void); - /*! * \brief Value of the damping factor for the engine inlet bc. * \return Value of the damping factor. @@ -6498,7 +6328,7 @@ class CConfig { * \param[in] val_solver - Solver of the simulation. * \param[in] val_system - Runtime system that we are solving. */ - void SetGlobalParam(unsigned short val_solver, unsigned short val_system, unsigned long val_extiter); + void SetGlobalParam(unsigned short val_solver, unsigned short val_system); /*! * \brief Center of rotation for a rotational periodic boundary. @@ -9210,10 +9040,16 @@ class CConfig { /*! * \brief Get the number of time iterations - * \return Number of time steps run for the multizone problem + * \return Number of time steps run */ unsigned long GetnTime_Iter(void); + /*! + * \brief Set the number of time iterations + * \param[in] val_iter - Number of time steps run + */ + void SetnTime_Iter(unsigned long val_iter); + /*! * \brief Get the number of pseudo-time iterations * \return Number of pseudo-time steps run for the single-zone problem @@ -9262,6 +9098,19 @@ class CConfig { */ bool GetSinglezone_Driver(void); + /*! + * \brief Check if the convergence history of each individual zone is written to screen + * \return YES if the zone convergence history of each individual zone must be written to screen + */ + bool GetWrt_ZoneConv(void); + + /*! + * \brief Check if the convergence history of each individual zone is written to file + * \return YES if the zone convergence history of each individual zone must be written to file + */ + bool GetWrt_ZoneHist(void); + + /*! * \brief Check if the special output is written * \return YES if the special output is written. @@ -9292,6 +9141,91 @@ class CConfig { */ su2double GetMeshBoxOffset(unsigned short val_iDim); + /*! + * \brief Get the number of screen output variables requested (maximum 6) + */ + unsigned short GetnScreenOutput(void); + + /* + * \brief Get the screen output field iField + */ + string GetScreenOutput_Field(unsigned short iField); + + /*! + * \brief Get the number of history output variables requested + */ + unsigned short GetnHistoryOutput(void); + + /* + * \brief Get the history output field iField + */ + string GetHistoryOutput_Field(unsigned short iField); + + /*! + * \brief Get the number of history output variables requested + */ + unsigned short GetnVolumeOutput(void); + + /* + * \brief Get the history output field iField + */ + string GetVolumeOutput_Field(unsigned short iField); + + /* + * \brief Get the convergence fields for monitoring + * \param[in] iField - Index of the field + * return Field name for monitoring convergence + */ + string GetConv_Field(unsigned short iField); + + /* + * \brief Get the number of convergence monitoring fields. + * return Number of convergence monitoring fields. + */ + unsigned short GetnConv_Field(); + + /*! + * \brief Set_StartTime + * \param starttime + */ + void Set_StartTime(su2double starttime); + + /*! + * \brief Get_StartTime + * \return + */ + su2double Get_StartTime(); + + /*! + * \brief GetHistory_Wrt_Freq_Inner + * \return + */ + unsigned long GetHistory_Wrt_Freq(unsigned short iter); + + /*! + * \brief GetScreen_Wrt_Freq_Inner + * \return + */ + unsigned long GetScreen_Wrt_Freq(unsigned short iter); + + /*! + * \brief GetScreen_Wrt_Freq_Inner + * \return + */ + unsigned long GetVolume_Wrt_Freq(); + + /*! + * \brief GetVolumeOutputFiles + * \return + */ + unsigned short* GetVolumeOutputFiles(); + + /*! + * \brief GetnVolumeOutputFiles + * \return + */ + unsigned short GetnVolumeOutputFiles(); + /*! * \brief Get the desired factorization frequency for PaStiX * \return Number of calls to 'Build' that trigger re-factorization. @@ -9310,6 +9244,12 @@ class CConfig { */ unsigned short GetPastixFillLvl(void); + /*! + * \brief Check if an option is present in the config file + * \param[in] - Name of the option + * \return if option was set in the config file + */ + bool OptionIsSet(string option); }; #include "config_structure.inl" diff --git a/Common/include/config_structure.inl b/Common/include/config_structure.inl index 15779e16af2a..1060f486668a 100644 --- a/Common/include/config_structure.inl +++ b/Common/include/config_structure.inl @@ -36,6 +36,7 @@ */ #pragma once +#include "config_structure.hpp" inline su2double CConfig::GetHTP_Axis(unsigned short val_index) { return HTP_Axis[val_index]; } @@ -297,34 +298,30 @@ inline bool CConfig::GetContinuous_Adjoint(void) { return ContinuousAdjoint; } inline bool CConfig::GetViscous(void) { return Viscous; } -inline unsigned long CConfig::GetnExtIter(void) { return nExtIter; } - inline unsigned short CConfig::GetnTimeInstances(void) { return nTimeInstances; } inline su2double CConfig::GetHarmonicBalance_Period(void) { return HarmonicBalance_Period; } -inline void CConfig::SetExtIter(unsigned long val_iter) { ExtIter = val_iter; } - inline void CConfig::SetExtIter_OffSet(unsigned long val_iter) { ExtIter_OffSet = val_iter; } inline void CConfig::SetOuterIter(unsigned long val_iter) { OuterIter = val_iter; } -inline void CConfig::SetIntIter(unsigned long val_iter) { IntIter = val_iter; } +inline void CConfig::SetInnerIter(unsigned long val_iter) { InnerIter = val_iter; } -inline unsigned long CConfig::GetExtIter(void) { return ExtIter; } +inline void CConfig::SetTimeIter(unsigned long val_iter) { TimeIter = val_iter; } inline unsigned long CConfig::GetExtIter_OffSet(void) { return ExtIter_OffSet; } inline unsigned long CConfig::GetOuterIter(void) { return OuterIter; } -inline unsigned long CConfig::GetIntIter(void) { return IntIter; } +inline unsigned long CConfig::GetInnerIter(void) { return InnerIter; } + +inline unsigned long CConfig::GetTimeIter(void) { return TimeIter; } inline unsigned long CConfig::GetUnst_nIntIter(void) { return Unst_nIntIter; } inline unsigned long CConfig::GetDyn_nIntIter(void) { return Dyn_nIntIter; } -inline long CConfig::GetUnst_RestartIter(void) { return Unst_RestartIter; } - inline long CConfig::GetUnst_AdjointIter(void) { return Unst_AdjointIter; } inline void CConfig::SetPhysicalTime(su2double val_t) { PhysicalTime = val_t; } @@ -335,8 +332,6 @@ inline bool CConfig::GetReorientElements(void) { return ReorientElements; } inline unsigned long CConfig::GetIter_Avg_Objective(void) { return Iter_Avg_Objective ; } -inline long CConfig::GetDyn_RestartIter(void) { return Dyn_RestartIter; } - inline string CConfig::GetPlaneTag(unsigned short index) { return PlaneTag[index]; } inline su2double CConfig::GetEA_IntLimit(unsigned short index) { return EA_IntLimit[index]; } @@ -439,8 +434,6 @@ inline void CConfig::SetSemiSpan(su2double val_semispan) { SemiSpan = val_semisp inline void CConfig::SetDomainVolume(su2double val_volume) { DomainVolume = val_volume; } -inline void CConfig::SetnExtIter(unsigned long val_niter) { nExtIter = val_niter; } - inline su2double CConfig::GetMach(void) { return Mach; } inline su2double CConfig::GetGamma(void) { return Gamma; } @@ -847,8 +840,6 @@ inline void CConfig::SetWrt_Con_Freq(unsigned long val_freq) { Wrt_Con_Freq = va inline unsigned long CConfig::GetWrt_Con_Freq_DualTime(void) { return Wrt_Con_Freq_DualTime; } -inline bool CConfig::GetWrt_Unsteady(void) { return Wrt_Unsteady; } - inline unsigned short CConfig::GetKind_Solver(void) { return Kind_Solver; } inline void CConfig::SetKind_Solver(unsigned short val_solver) { Kind_Solver = val_solver; } @@ -1307,7 +1298,7 @@ inline su2double CConfig::GetCoeff_ObjChainRule(unsigned short iVar) { return Ob inline unsigned short CConfig::GetKind_SensSmooth(void) { return Kind_SensSmooth; } -inline unsigned short CConfig::GetUnsteady_Simulation(void) { return Unsteady_Simulation; } +inline unsigned short CConfig::GetTime_Marching(void) { return TimeMarching; } inline bool CConfig::GetRestart(void) { return Restart; } @@ -1480,55 +1471,31 @@ inline string CConfig::GetMesh_Out_FileName(void) { return Mesh_Out_FileName; } inline unsigned short CConfig::GetMesh_FileFormat(void) { return Mesh_FileFormat; } -inline unsigned short CConfig::GetOutput_FileFormat(void) { return Output_FileFormat; } +inline unsigned short CConfig::GetTabular_FileFormat(void) { return Tab_FileFormat; } inline unsigned short CConfig::GetActDisk_Jump(void) { return ActDisk_Jump; } inline string CConfig::GetConv_FileName(void) { return Conv_FileName; } -inline string CConfig::GetConv_FileName_FSI(void) { return Conv_FileName_FSI; } - inline string CConfig::GetBreakdown_FileName(void) { return Breakdown_FileName; } -inline string CConfig::GetSolution_FlowFileName(void) { return Solution_FlowFileName; } +inline string CConfig::GetSolution_FileName(void) { return Solution_FileName; } inline string CConfig::GetSolution_AdjFileName(void) { return Solution_AdjFileName; } -inline string CConfig::GetSolution_FEMFileName(void) { return Solution_FEMFileName; } - -inline string CConfig::GetSolution_AdjFEMFileName(void) { return Solution_AdjFEMFileName; } - -inline string CConfig::GetFlow_FileName(void) { return Flow_FileName; } - -inline string CConfig::GetStructure_FileName(void) { return Structure_FileName; } - -inline string CConfig::GetSurfStructure_FileName(void) { return SurfStructure_FileName; } - -inline string CConfig::GetAdjStructure_FileName(void) { return Structure_FileName; } +inline string CConfig::GetVolume_FileName(void) { return Volume_FileName; } -inline string CConfig::GetAdjSurfStructure_FileName(void) { return SurfStructure_FileName; } - -inline string CConfig::GetSurfHeat_FileName(void) { return SurfHeat_FileName; } - -inline string CConfig::GetHeat_FileName(void) { return Heat_FileName; } - -inline string CConfig::GetRestart_FlowFileName(void) { return Restart_FlowFileName; } - -inline string CConfig::GetRestart_HeatFileName(void) { return Restart_HeatFileName; } +inline string CConfig::GetRestart_FileName(void) { return Restart_FileName; } inline string CConfig::GetRestart_AdjFileName(void) { return Restart_AdjFileName; } -inline string CConfig::GetRestart_FEMFileName(void) { return Restart_FEMFileName; } - -inline string CConfig::GetRestart_AdjFEMFileName(void) { return Restart_AdjFEMFileName; } - inline string CConfig::GetAdj_FileName(void) { return Adj_FileName; } inline string CConfig::GetObjFunc_Grad_FileName(void) { return ObjFunc_Grad_FileName; } inline string CConfig::GetObjFunc_Value_FileName(void) { return ObjFunc_Value_FileName; } -inline string CConfig::GetSurfFlowCoeff_FileName(void) { return SurfFlowCoeff_FileName; } +inline string CConfig::GetSurfCoeff_FileName(void) { return SurfCoeff_FileName; } inline string CConfig::GetSurfAdjCoeff_FileName(void) { return SurfAdjCoeff_FileName; } @@ -1574,8 +1541,6 @@ inline su2double CConfig::GetDV_Value(unsigned short val_dv, unsigned short val_ inline void CConfig::SetDV_Value(unsigned short val_dv, unsigned short val_ind, su2double val) { DV_Value[val_dv][val_ind] = val; } -inline su2double CConfig::GetOrderMagResidual(void) { return OrderMagResidual; } - inline su2double CConfig::GetMinLogResidual(void) { return MinLogResidual; } inline su2double CConfig::GetDamp_Engine_Inflow(void) { return Damp_Engine_Inflow; } @@ -1627,7 +1592,7 @@ inline bool CConfig::GetGrid_Movement(void) { return (Kind_GridMovement != NO_MO inline bool CConfig::GetDynamic_Grid(void) { return (Kind_GridMovement != NO_MOVEMENT) || ((nKind_SurfaceMovement > 0) && !GetSurface_Movement(FLUID_STRUCTURE_STATIC)) - || (Deform_Mesh && (Unsteady_Simulation != NO)); + || (Deform_Mesh && (Time_Domain)); } inline unsigned short CConfig::GetKind_SurfaceMovement(unsigned short iMarkerMoving){return Kind_SurfaceMovement[iMarkerMoving];} @@ -1670,8 +1635,6 @@ inline bool CConfig::GetInconsistent_Disc(void){ return Inconsistent_Disc; } inline bool CConfig::GetSens_Remove_Sharp(void) { return Sens_Remove_Sharp; } -inline bool CConfig::GetWrite_Conv_FSI(void) { return Write_Conv_FSI; } - inline bool CConfig::GetHold_GridFixed(void) { return Hold_GridFixed; } inline su2double CConfig::GetCyclic_Pitch(void) { return Cyclic_Pitch; } @@ -1684,8 +1647,6 @@ inline string CConfig::GetDV_Sens_Filename(void) { return DV_Sens_Filename; } inline string CConfig::GetDV_Unordered_Sens_Filename(void) { return DV_Unordered_Sens_Filename; } -inline bool CConfig::GetLow_MemoryOutput(void) { return Low_MemoryOutput; } - inline bool CConfig::GetWrt_Output(void) { return Wrt_Output; } inline bool CConfig::GetWrt_Vol_Sol(void) { return Wrt_Vol_Sol; } @@ -1938,26 +1899,6 @@ inline bool CConfig::GetConservativeInterpolation(void) { return ConservativeInt inline unsigned short CConfig::GetRelaxation_Method_FSI(void) { return Kind_BGS_RelaxMethod; } -inline su2double CConfig::GetOrderMagResidualFSI(void) { return OrderMagResidualFSI; } - -inline su2double CConfig::GetMinLogResidualFSI(void) { return MinLogResidualFSI; } - -inline su2double CConfig::GetOrderMagResidual_BGS_F(void) { return OrderMagResidual_BGS_F; } - -inline su2double CConfig::GetMinLogResidual_BGS_F(void) { return MinLogResidual_BGS_F; } - -inline su2double CConfig::GetOrderMagResidual_BGS_S(void) { return OrderMagResidual_BGS_S; } - -inline su2double CConfig::GetMinLogResidual_BGS_S(void) { return MinLogResidual_BGS_S; } - -inline su2double CConfig::GetResidual_FEM_UTOL(void) { return Res_FEM_UTOL; } - -inline su2double CConfig::GetResidual_FEM_RTOL(void) { return Res_FEM_RTOL; } - -inline su2double CConfig::GetResidual_FEM_ETOL(void) { return Res_FEM_ETOL; } - -inline su2double CConfig::GetCriteria_FEM_ADJ(void) { return Res_FEM_ADJ; } - inline unsigned short CConfig::GetDynamic_LoadTransfer(void) { return Dynamic_LoadTransfer; } inline unsigned short CConfig::GetDirectDiff() { return DirectDiff;} @@ -2055,13 +1996,15 @@ inline string CConfig::GetMarkerTag_ZoneInterface(unsigned short val_iMarker) { inline bool CConfig::GetTime_Domain(void) { return Time_Domain; } -inline unsigned long CConfig::GetnInner_Iter(void) { return Inner_Iter; } +inline unsigned long CConfig::GetnInner_Iter(void) { return nInnerIter; } + +inline unsigned long CConfig::GetnOuter_Iter(void) { return nOuterIter; } -inline unsigned long CConfig::GetnOuter_Iter(void) { return Outer_Iter; } +inline unsigned long CConfig::GetnTime_Iter(void) { return nTimeIter; } -inline unsigned long CConfig::GetnTime_Iter(void) { return Time_Iter; } +inline void CConfig::SetnTime_Iter(unsigned long val_iter) { nTimeIter = val_iter; } -inline unsigned long CConfig::GetnIter(void) { return Iter; } +inline unsigned long CConfig::GetnIter(void) { return nIter; } inline unsigned long CConfig::GetRestart_Iter(void) { return Restart_Iter; } @@ -2075,10 +2018,26 @@ inline bool CConfig::GetMultizone_Residual(void) { return Multizone_Residual; } inline bool CConfig::GetSinglezone_Driver(void) { return SinglezoneDriver; } +inline bool CConfig::GetWrt_ZoneConv(void) { return Wrt_ZoneConv; } + +inline bool CConfig::GetWrt_ZoneHist(void) { return Wrt_ZoneHist; } + inline bool CConfig::GetSpecial_Output(void) { return SpecialOutput; } inline bool CConfig::GetWrt_ForcesBreakdown(void) { return Wrt_ForcesBreakdown; } +inline unsigned short CConfig::GetnScreenOutput(void) { return nScreenOutput; } + +inline string CConfig::GetScreenOutput_Field(unsigned short iField) { return ScreenOutput[iField]; } + +inline unsigned short CConfig::GetnHistoryOutput(void) { return nHistoryOutput; } + +inline string CConfig::GetHistoryOutput_Field(unsigned short iField) { return HistoryOutput[iField]; } + +inline unsigned short CConfig::GetnVolumeOutput(void) { return nVolumeOutput; } + +inline string CConfig::GetVolumeOutput_Field(unsigned short iField) { return VolumeOutput[iField]; } + inline bool CConfig::GetUsing_UQ(void) { return using_uq; } inline su2double CConfig::GetUQ_Delta_B(void) { return uq_delta_b; } @@ -2100,3 +2059,23 @@ inline short CConfig::GetMeshBoxSize(unsigned short val_iDim) { return Mesh_Box_ inline su2double CConfig::GetMeshBoxLength(unsigned short val_iDim) { return Mesh_Box_Length[val_iDim]; } inline su2double CConfig::GetMeshBoxOffset(unsigned short val_iDim) { return Mesh_Box_Offset[val_iDim]; } + +inline string CConfig::GetConv_Field(unsigned short iField){ return ConvField[iField]; } + +inline unsigned short CConfig::GetnConv_Field(){ return nConvField; } + +inline void CConfig::Set_StartTime(su2double starttime){StartTime = starttime;} + +inline su2double CConfig::Get_StartTime() {return StartTime;} + +inline unsigned long CConfig::GetHistory_Wrt_Freq(unsigned short iter) {return HistoryWrtFreq[iter];} + +inline unsigned long CConfig::GetScreen_Wrt_Freq(unsigned short iter) {return ScreenWrtFreq[iter];} + +inline unsigned long CConfig::GetVolume_Wrt_Freq() {return VolumeWrtFreq;} + +inline unsigned short* CConfig::GetVolumeOutputFiles() {return VolumeOutputFiles;} + +inline unsigned short CConfig::GetnVolumeOutputFiles() {return nVolumeOutputFiles;} + +inline bool CConfig::OptionIsSet(string option){ return all_options.find(option) == all_options.end();} diff --git a/Common/include/geometry_structure.hpp b/Common/include/geometry_structure.hpp index d5045a7f7214..bc8d00bc2077 100644 --- a/Common/include/geometry_structure.hpp +++ b/Common/include/geometry_structure.hpp @@ -1691,6 +1691,12 @@ class CGeometry { */ unsigned short GetMGLevel(void); + /*! + * \brief Compute and store the volume of the elements. + * \param[in] config - Problem configuration. + */ + void UpdateBoundaries(CConfig *config); + /*! * \brief A virtual member. * \param config - Config diff --git a/Common/include/grid_movement_structure.hpp b/Common/include/grid_movement_structure.hpp index 907a44632adb..fbe90a13d007 100644 --- a/Common/include/grid_movement_structure.hpp +++ b/Common/include/grid_movement_structure.hpp @@ -1652,7 +1652,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iMarker_Monitoring - Marker we are monitoring. * \param[in] displacements - solution of typical section wing model. */ - void AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long ExtIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements); + void AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long TimeIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements); /*! * \brief Deforms a 3-D flutter/pitching surface during an unsteady simulation. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index e9fdbe537ea4..4edc8f8e88a1 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1522,13 +1522,13 @@ static const map Adapt_Map = CCreateMap */ enum ENUM_INPUT { SU2 = 1, /*!< \brief SU2 input format. */ - CGNS = 2, /*!< \brief CGNS input format for the computational grid. */ + CGNS_GRID = 2, /*!< \brief CGNS input format for the computational grid. */ RECTANGLE = 3, /*!< \brief 2D rectangular mesh with N x M points of size Lx x Ly. */ BOX = 4 /*!< \brief 3D box mesh with N x M x L points of size Lx x Ly x Lz. */ }; static const map Input_Map = CCreateMap ("SU2", SU2) -("CGNS", CGNS) +("CGNS", CGNS_GRID) ("RECTANGLE", RECTANGLE) ("BOX", BOX); @@ -1538,22 +1538,46 @@ static const map Input_Map = CCreateMap enum ENUM_OUTPUT { TECPLOT = 1, /*!< \brief Tecplot format for the solution output. */ TECPLOT_BINARY = 2, /*!< \brief Tecplot binary format for the solution output. */ - FIELDVIEW = 3, /*!< \brief FieldView format for the solution output. */ - FIELDVIEW_BINARY = 4, /*!< \brief FieldView binary format for the solution output. */ + SURFACE_TECPLOT = 3, /*!< \brief Tecplot format for the solution output. */ + SURFACE_TECPLOT_BINARY = 4, /*!< \brief Tecplot binary format for the solution output. */ CSV = 5, /*!< \brief Comma-separated values format for the solution output. */ - CGNS_SOL = 6, /*!< \brief CGNS format for the solution output. */ + SURFACE_CSV = 6, /*!< \brief Comma-separated values format for the solution output. */ PARAVIEW = 7, /*!< \brief Paraview ASCII format for the solution output. */ - PARAVIEW_BINARY = 8 /*!< \brief Paraview binary format for the solution output. */ + PARAVIEW_BINARY = 8, /*!< \brief Paraview binary format for the solution output. */ + SURFACE_PARAVIEW = 9, /*!< \brief Paraview ASCII format for the solution output. */ + SURFACE_PARAVIEW_BINARY = 10, /*!< \brief Paraview binary format for the solution output. */ + MESH = 11, /*!< \brief SU2 mesh format. */ + RESTART_BINARY = 12,/*!< \brief SU2 binary restart format. */ + RESTART_ASCII = 13, /*!< \brief SU2 ASCII restart format. */ + CGNS = 14 }; + static const map Output_Map = CCreateMap -("TECPLOT", TECPLOT) -("TECPLOT_BINARY", TECPLOT_BINARY) -("FIELDVIEW", FIELDVIEW) -("FIELDVIEW_BINARY", FIELDVIEW_BINARY) +("TECPLOT_ASCII", TECPLOT) +("TECPLOT", TECPLOT_BINARY) +("SURFACE_TECPLOT_ASCII", SURFACE_TECPLOT) +("SURFACE_TECPLOT", SURFACE_TECPLOT_BINARY) ("CSV", CSV) -("CGNS", CGNS_SOL) -("PARAVIEW", PARAVIEW) -("PARAVIEW_BINARY", PARAVIEW_BINARY); +("SURFACE_CSV", SURFACE_CSV) +("PARAVIEW_ASCII", PARAVIEW) +("PARAVIEW", PARAVIEW_BINARY) +("SURFACE_PARAVIEW_ASCII", SURFACE_PARAVIEW) +("SURFACE_PARAVIEW", SURFACE_PARAVIEW_BINARY) +("RESTART_ASCII", RESTART_ASCII) +("RESTART", RESTART_BINARY) +("CGNS", CGNS); + +/*! + * \brief type of solution output file formats + */ +enum ENUM_TAB_OUTPUT { + TAB_CSV = 1, /*!< \brief Comma-separated values format for the solution output. */ + TAB_TECPLOT = 2 /*!< \brief Tecplot format for the solution output. */ +}; + +static const map TabOutput_Map = CCreateMap +("CSV", TAB_CSV) +("TECPLOT", TAB_TECPLOT); /*! * \brief type of volume sensitivity file formats (inout to SU2_DOT) @@ -1845,7 +1869,7 @@ enum ENUM_UNSTEADY { HARMONIC_BALANCE = 5 /*!< \brief Use a harmonic balance source term. */ }; -static const map Unsteady_Map = CCreateMap +static const map TimeMarching_Map = CCreateMap ("NO", STEADY) ("TIME_STEPPING", TIME_STEPPING) ("DUAL_TIME_STEPPING-1ST_ORDER", DT_STEPPING_1ST) @@ -2857,45 +2881,47 @@ class COptionDVParam : public COptionBase { this->FFDTag = new string[this->nDV]; - unsigned short nParamDV = 0; - stringstream ss; - unsigned int i = 0; + vector nParamDV(nDV, 0); + unsigned short totalnParamDV = 0; + stringstream ss; + unsigned int i = 0; + for (unsigned short iDV = 0; iDV < this->nDV; iDV++) { switch (this->design_variable[iDV]) { - case NO_DEFORMATION: nParamDV = 0; break; - case FFD_SETTING: nParamDV = 0; break; - case FFD_CONTROL_POINT_2D: nParamDV = 5; break; - case FFD_CAMBER_2D: nParamDV = 2; break; - case FFD_THICKNESS_2D: nParamDV = 2; break; - case FFD_TWIST_2D: nParamDV = 3; break; - case HICKS_HENNE: nParamDV = 2; break; - case SURFACE_BUMP: nParamDV = 3; break; - case CST: nParamDV = 3; break; - case ANGLE_OF_ATTACK: nParamDV = 1; break; - case SCALE: nParamDV = 0; break; - case TRANSLATION: nParamDV = 3; break; - case ROTATION: nParamDV = 6; break; - case NACA_4DIGITS: nParamDV = 3; break; - case PARABOLIC: nParamDV = 2; break; - case AIRFOIL: nParamDV = 2; break; - case FFD_CONTROL_POINT: nParamDV = 7; break; - case FFD_NACELLE: nParamDV = 6; break; - case FFD_GULL: nParamDV = 2; break; - case FFD_TWIST: nParamDV = 8; break; - case FFD_ROTATION: nParamDV = 7; break; - case FFD_CONTROL_SURFACE: nParamDV = 7; break; - case FFD_CAMBER: nParamDV = 3; break; - case FFD_THICKNESS: nParamDV = 3; break; - case FFD_ANGLE_OF_ATTACK: nParamDV = 2; break; - case SURFACE_FILE: nParamDV = 0; break; - case DV_EFIELD: nParamDV = 2; break; - case DV_YOUNG: nParamDV = 0; break; - case DV_POISSON: nParamDV = 0; break; - case DV_RHO: nParamDV = 0; break; - case DV_RHO_DL: nParamDV = 0; break; - case SCALE_GRID: nParamDV = 0; break; - case TRANSLATE_GRID: nParamDV = 3; break; - case ROTATE_GRID: nParamDV = 6; break; + case NO_DEFORMATION: nParamDV[iDV] = 0; break; + case FFD_SETTING: nParamDV[iDV] = 0; break; + case FFD_CONTROL_POINT_2D: nParamDV[iDV] = 5; break; + case FFD_CAMBER_2D: nParamDV[iDV] = 2; break; + case FFD_THICKNESS_2D: nParamDV[iDV] = 2; break; + case FFD_TWIST_2D: nParamDV[iDV] = 3; break; + case HICKS_HENNE: nParamDV[iDV] = 2; break; + case SURFACE_BUMP: nParamDV[iDV] = 3; break; + case CST: nParamDV[iDV] = 3; break; + case ANGLE_OF_ATTACK: nParamDV[iDV] = 1; break; + case SCALE: nParamDV[iDV] = 0; break; + case TRANSLATION: nParamDV[iDV] = 3; break; + case ROTATION: nParamDV[iDV] = 6; break; + case NACA_4DIGITS: nParamDV[iDV] = 3; break; + case PARABOLIC: nParamDV[iDV] = 2; break; + case AIRFOIL: nParamDV[iDV] = 2; break; + case FFD_CONTROL_POINT: nParamDV[iDV] = 7; break; + case FFD_NACELLE: nParamDV[iDV] = 6; break; + case FFD_GULL: nParamDV[iDV] = 2; break; + case FFD_TWIST: nParamDV[iDV] = 8; break; + case FFD_ROTATION: nParamDV[iDV] = 7; break; + case FFD_CONTROL_SURFACE: nParamDV[iDV] = 7; break; + case FFD_CAMBER: nParamDV[iDV] = 3; break; + case FFD_THICKNESS: nParamDV[iDV] = 3; break; + case FFD_ANGLE_OF_ATTACK: nParamDV[iDV] = 2; break; + case SURFACE_FILE: nParamDV[iDV] = 0; break; + case DV_EFIELD: nParamDV[iDV] = 2; break; + case DV_YOUNG: nParamDV[iDV] = 0; break; + case DV_POISSON: nParamDV[iDV] = 0; break; + case DV_RHO: nParamDV[iDV] = 0; break; + case DV_RHO_DL: nParamDV[iDV] = 0; break; + case SCALE_GRID: nParamDV[iDV] = 0; break; + case TRANSLATE_GRID: nParamDV[iDV] = 3; break; + case ROTATE_GRID: nParamDV[iDV] = 6; break; default : { string newstring; newstring.append(this->name); @@ -2903,8 +2929,15 @@ class COptionDVParam : public COptionBase { return newstring; } } - - for (unsigned short iParamDV = 0; iParamDV < nParamDV; iParamDV++) { + totalnParamDV += nParamDV[iDV]; + } + + if (totalnParamDV > option_value.size()){ + SU2_MPI::Error("Wrong number of arguments for DV_PARAM!", CURRENT_FUNCTION); + } + + for (unsigned short iDV = 0; iDV < this->nDV; iDV++) { + for (unsigned short iParamDV = 0; iParamDV < nParamDV[iDV]; iParamDV++) { ss << option_value[i] << " "; diff --git a/Common/include/toolboxes/printing_toolbox.hpp b/Common/include/toolboxes/printing_toolbox.hpp index 6f90e0cdcac5..e06faa855261 100644 --- a/Common/include/toolboxes/printing_toolbox.hpp +++ b/Common/include/toolboxes/printing_toolbox.hpp @@ -4,6 +4,7 @@ #include #include #include +#include "../datatype_structure.hpp" namespace PrintingToolbox { @@ -61,13 +62,19 @@ class CTablePrinter{ * \return Total width of the table. */ int GetTableWidth() const; - + /*! * \brief Set the separator between columns (outer decoration) * \param[in] separator - The separation character. */ void SetSeparator(const std::string & separator); + /*! + * \brief Set the separator between columns (inner decoration) + * \param[in] separator - The separation character. + */ + void SetInnerSeparator(const std::string & inner_separator); + /*! * \brief Set the alignment of the table entries (CENTER only works for the header at the moment). * \param[in] align_ - The alignment (CENTER, LEFT, RIGHT). @@ -85,7 +92,7 @@ class CTablePrinter{ * \param[in] print - If TRUE, the top line is printed. */ void SetPrintHeaderTopLine(bool print); - + /*! * \brief Add a column to the table by specifiying the header name and the width. @@ -103,14 +110,19 @@ class CTablePrinter{ * \brief Print the footer. */ void PrintFooter(); - + + /*! + * \brief Set the floating point precision. + */ + void SetPrecision(int precision); + template CTablePrinter& operator<<(T input){ - + int indent = 0; - + /* --- Set the left separator --- */ if (j_ == 0) - *out_stream_ << "|"; + *out_stream_ << separator_; /* --- Determine and set the current alignment in the stream --- */ if(align_ == LEFT) @@ -120,16 +132,16 @@ class CTablePrinter{ /*--- Print the current column value to the stream --- */ *out_stream_ << std::setw(column_widths_.at(j_) - indent) - << input; + << std::setprecision(precision_) << input; /*--- Reset the column counter and if it is the last column, * add also a line break ---*/ if (j_ == GetNumColumns()-1){ - *out_stream_ << std::setw(indent+2) << "|\n"; + *out_stream_ << std::setw(indent+1+(int)separator_.size()) << separator_ + "\n"; i_ = i_ + 1; j_ = 0; } else { - *out_stream_ << std::setw(indent+1) << separator_; + *out_stream_ << std::setw(indent+(int)inner_separator_.size()) << inner_separator_; j_ = j_ + 1; } @@ -147,7 +159,10 @@ class CTablePrinter{ std::vector column_headers_; /*< \brief Vector of column header names. */ std::vector column_widths_; /*< \brief Vector of column widths. */ std::string separator_; /*< \brief Column separator char. */ + std::string inner_separator_; /*< \brief Inner column separator char. */ + int precision_; /*< \brief Floating point precision */ + int i_; /*< \brief Index of the current row. */ int j_; /*< \brief Index of the current column. */ @@ -157,4 +172,79 @@ class CTablePrinter{ print_header_bottom_line_; /*< \brief Printing the header bottom line. */ }; + + +inline void PrintScreenFixed(std::ostream &stream, su2double val, unsigned short field_width) { + stream.precision(6); stream.setf(std::ios::fixed, std::ios::floatfield); stream.width(field_width); + stream << std::right << val; + stream.unsetf(std::ios::fixed); +} + +inline void PrintScreenScientific(std::ostream &stream, su2double val, unsigned short field_width) { + stream.precision(4); stream.setf(std::ios::scientific, std::ios::floatfield); stream.width(field_width); + stream << std::right << val; + stream.unsetf(std::ios::scientific); +} + +inline void PrintScreenInteger(std::ostream &stream, unsigned long val, unsigned short field_width){ + stream.width(field_width); + stream << std::right << val; +} + + +inline std::vector split(const std::string& s, char delimiter) +{ + std::vector tokens; + std::string token; + std::istringstream tokenStream(s); + while (std::getline(tokenStream, token, delimiter)) + { + tokens.push_back(token); + } + return tokens; +} + +inline int stoi(const std::string s){ + std::istringstream ss(s); + int number; + ss >> number; + return number; +} + +inline su2double stod(const std::string s){ + std::istringstream ss(s); + su2double number; + ss >> number; + return number; +} + +inline std::string to_string(const su2double number){ + + std::stringstream ss; + + ss << number; + + return ss.str(); + +} + +const static char* ws = " \t\n\r\f\v"; + +// trim from end of string (right) +inline std::string& rtrim(std::string& s, const char* t = ws){ + s.erase(s.find_last_not_of(t) + 1); + return s; +} + +// trim from beginning of string (left) +inline std::string& ltrim(std::string& s, const char* t = ws){ + s.erase(0, s.find_first_not_of(t)); + return s; +} + +// trim from both ends of string (right then left) +inline std::string& trim(std::string& s, const char* t = ws){ + return ltrim(rtrim(s, t), t); +} + } diff --git a/Common/include/toolboxes/signal_processing_toolbox.hpp b/Common/include/toolboxes/signal_processing_toolbox.hpp new file mode 100644 index 000000000000..8f2128cb5390 --- /dev/null +++ b/Common/include/toolboxes/signal_processing_toolbox.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "../datatype_structure.hpp" +#include + +namespace Signal_Processing { + + su2double Average(std::vector &data); + + class RunningAverage + { + private: + su2double val; + unsigned long count; + + public: + RunningAverage(){ + this->Reset(); + } + + su2double Update(su2double valIn){ + su2double scaling = 1. / (su2double)(count + 1); + val = valIn * scaling + val * (1. - scaling); + count++; + return val; + } + + su2double Get(){ + return val; + } + + unsigned long Count(){ + return count; + } + + void Reset(){ + val = 0.; + count = 0; + } + }; +}; diff --git a/Common/lib/Makefile.am b/Common/lib/Makefile.am index d09fbafddda5..df0631571392 100644 --- a/Common/lib/Makefile.am +++ b/Common/lib/Makefile.am @@ -147,6 +147,7 @@ lib_sources = \ ../src/adt_structure.cpp \ ../src/wall_model.cpp \ ../src/toolboxes/printing_toolbox.cpp \ + ../src/toolboxes/signal_processing_toolbox.cpp \ ../src/toolboxes/CLinearPartitioner.cpp \ ../src/toolboxes/MMS/CVerificationSolution.cpp \ ../src/toolboxes/MMS/CIncTGVSolution.cpp \ diff --git a/Common/src/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/CSU2ASCIIMeshReaderFVM.cpp index 32eaf2a6e429..9cc4a9bd0589 100644 --- a/Common/src/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/CSU2ASCIIMeshReaderFVM.cpp @@ -82,7 +82,7 @@ CSU2ASCIIMeshReaderFVM::~CSU2ASCIIMeshReaderFVM(void) { } void CSU2ASCIIMeshReaderFVM::ReadMetadata() { - bool harmonic_balance = config->GetUnsteady_Simulation() == HARMONIC_BALANCE; + bool harmonic_balance = config->GetTime_Marching() == HARMONIC_BALANCE; bool multizone_file = config->GetMultizone_Mesh(); /*--- Open grid file ---*/ diff --git a/Common/src/config_structure.cpp b/Common/src/config_structure.cpp index 9f39c39bee26..97f2d017d172 100644 --- a/Common/src/config_structure.cpp +++ b/Common/src/config_structure.cpp @@ -227,7 +227,7 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig *config) { /*--- Parsing the config file ---*/ runtime_file = SetRunTime_Parsing(case_filename); - + /*--- Set the default values for all of the options that weren't set ---*/ SetDefault(); @@ -235,9 +235,11 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], CConfig *config) { /*--- Update original config file ---*/ if (runtime_file) { - config->SetnExtIter(nExtIter); + if (all_options.find("TIME_ITER") == all_options.end()) + config->SetnTime_Iter(nTimeIter); + if (all_options.find("CFL_NUMBER") == all_options.end()) + config->SetCFL(MESH_0, CFLFineGrid); } - } SU2_MPI::Comm CConfig::GetMPICommunicator() { @@ -293,7 +295,7 @@ unsigned short CConfig::GetnZone(string val_mesh_filename, unsigned short val_fo } - case CGNS: { + case CGNS_GRID: { #ifdef HAVE_CGNS @@ -421,7 +423,7 @@ unsigned short CConfig::GetnDim(string val_mesh_filename, unsigned short val_for break; } - case CGNS: { + case CGNS_GRID: { #ifdef HAVE_CGNS @@ -712,6 +714,7 @@ void CConfig::SetPointersNull(void) { default_body_force = NULL; default_sineload_coeff = NULL; default_nacelle_location = NULL; + default_wrt_freq = NULL; default_cp_polycoeffs = NULL; default_mu_polycoeffs = NULL; @@ -758,11 +761,16 @@ void CConfig::SetPointersNull(void) { top_optim_kernels = NULL; top_optim_kernel_params = NULL; top_optim_filter_radius = NULL; + + ScreenOutput = NULL; + HistoryOutput = NULL; + VolumeOutput = NULL; + VolumeOutputFiles = NULL; /*--- Variable initialization ---*/ - ExtIter = 0; - IntIter = 0; + TimeIter = 0; + InnerIter = 0; nIntCoeffs = 0; OuterIter = 0; @@ -779,6 +787,8 @@ void CConfig::SetPointersNull(void) { Wrt_InletFile = false; Restart_Bandwidth_Agg = 0.0; + + Mesh_Box_Size = NULL; } @@ -786,7 +796,11 @@ void CConfig::SetRunTime_Options(void) { /* DESCRIPTION: Number of external iterations */ - addUnsignedLongOption("EXT_ITER", nExtIter, 999999); + addUnsignedLongOption("TIME_ITER", nTimeIter, 999999); + + /* DESCRIPTION: CFL Number */ + + addDoubleOption("CFL_NUMBER", CFLFineGrid, 10); } @@ -818,6 +832,7 @@ void CConfig::SetConfig_Options() { default_body_force = new su2double[3]; default_sineload_coeff = new su2double[3]; default_nacelle_location = new su2double[5]; + default_wrt_freq = new su2double[3]; /*--- All temperature polynomial fits for the fluid models currently assume a quartic form (5 coefficients). For example, @@ -1351,7 +1366,7 @@ void CConfig::SetConfig_Options() { /*--- Options related to time-marching ---*/ /* DESCRIPTION: Unsteady simulation */ - addEnumOption("UNSTEADY_SIMULATION", Unsteady_Simulation, Unsteady_Map, STEADY); + addEnumOption("TIME_MARCHING", TimeMarching, TimeMarching_Map, STEADY); /* DESCRIPTION: Courant-Friedrichs-Lewy condition of the finest grid */ addDoubleOption("CFL_NUMBER", CFLFineGrid, 1.25); /* DESCRIPTION: Courant-Friedrichs-Lewy condition of the finest grid in (heat fvm) solid solvers */ @@ -1372,8 +1387,6 @@ void CConfig::SetConfig_Options() { addDoubleOption("CFL_REDUCTION_TURB", CFLRedCoeff_Turb, 1.0); /* DESCRIPTION: Reduction factor of the CFL coefficient in the turbulent adjoint problem */ addDoubleOption("CFL_REDUCTION_ADJTURB", CFLRedCoeff_AdjTurb, 1.0); - /* DESCRIPTION: Number of total iterations */ - addUnsignedLongOption("EXT_ITER", nExtIter, 999999); /* DESCRIPTION: External iteration offset due to restart */ addUnsignedLongOption("EXT_ITER_OFFSET", ExtIter_OffSet, 0); // these options share nRKStep as their size, which is not a good idea in general @@ -1383,14 +1396,8 @@ void CConfig::SetConfig_Options() { addUnsignedShortOption("LEVELS_TIME_ACCURATE_LTS", nLevels_TimeAccurateLTS, 1); /* DESCRIPTION: Number of time DOFs used in the predictor step of ADER-DG. */ addUnsignedShortOption("TIME_DOFS_ADER_DG", nTimeDOFsADER_DG, 2); - /* DESCRIPTION: Time Step for dual time stepping simulations (s) */ - addDoubleOption("UNST_TIMESTEP", Delta_UnstTime, 0.0); - /* DESCRIPTION: Total Physical Time for dual time stepping simulations (s) */ - addDoubleOption("UNST_TIME", Total_UnstTime, 1.0); /* DESCRIPTION: Unsteady Courant-Friedrichs-Lewy number of the finest grid */ addDoubleOption("UNST_CFL_NUMBER", Unst_CFL, 0.0); - /* DESCRIPTION: Number of internal iterations (dual time method) */ - addUnsignedLongOption("UNST_INT_ITER", Unst_nIntIter, 100); /* DESCRIPTION: Integer number of periodic time instances for Harmonic Balance */ addUnsignedShortOption("TIME_INSTANCES", nTimeInstances, 1); /* DESCRIPTION: Time period for Harmonic Balance wihtout moving meshes */ @@ -1490,43 +1497,16 @@ void CConfig::SetConfig_Options() { /*!\brief CONV_CRITERIA * \n DESCRIPTION: Convergence criteria \n OPTIONS: see \link Converge_Crit_Map \endlink \n DEFAULT: RESIDUAL \ingroup Config*/ addEnumOption("CONV_CRITERIA", ConvCriteria, Converge_Crit_Map, RESIDUAL); - /*!\brief RESIDUAL_REDUCTION \n DESCRIPTION: Residual reduction (order of magnitude with respect to the initial value)\n DEFAULT: 3.0 \ingroup Config*/ - addDoubleOption("RESIDUAL_REDUCTION", OrderMagResidual, 5.0); - /*!\brief RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/ - addDoubleOption("RESIDUAL_MINVAL", MinLogResidual, -14.0); - /* DESCRIPTION: Residual reduction (order of magnitude with respect to the initial value) */ - addDoubleOption("RESIDUAL_REDUCTION_FSI", OrderMagResidualFSI, 3.0); - /* DESCRIPTION: Min value of the residual (log10 of the residual) */ - addDoubleOption("RESIDUAL_MINVAL_FSI", MinLogResidualFSI, -5.0); - /*!\brief RESIDUAL_REDUCTION \n DESCRIPTION: Residual reduction (order of magnitude with respect to the initial value)\n DEFAULT: 3.0 \ingroup Config*/ - addDoubleOption("RESIDUAL_REDUCTION_BGS_FLOW", OrderMagResidual_BGS_F, 3.0); - /*!\brief RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -8.0 \ingroup Config*/ - addDoubleOption("RESIDUAL_MINVAL_BGS_FLOW", MinLogResidual_BGS_F, -8.0); - /*!\brief RESIDUAL_REDUCTION \n DESCRIPTION: Residual reduction (order of magnitude with respect to the initial value)\n DEFAULT: 3.0 \ingroup Config*/ - addDoubleOption("RESIDUAL_REDUCTION_BGS_STRUCTURE", OrderMagResidual_BGS_S, 3.0); - /*!\brief RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -8.0 \ingroup Config*/ - addDoubleOption("RESIDUAL_MINVAL_BGS_STRUCTURE", MinLogResidual_BGS_S, -8.0); - /* DESCRIPTION: FEM: UTOL = norm(Delta_U(k)) / norm(U(k)) */ - addDoubleOption("RESIDUAL_FEM_UTOL", Res_FEM_UTOL, -9.0); - /* DESCRIPTION: FEM: RTOL = norm(Residual(k)) / norm(Residual(0)) */ - addDoubleOption("RESIDUAL_FEM_RTOL", Res_FEM_RTOL, -9.0); - /* DESCRIPTION: FEM: ETOL = Delta_U(k) * Residual(k) / Delta_U(0) * Residual(0) */ - addDoubleOption("RESIDUAL_FEM_ETOL", Res_FEM_ETOL, -9.0); - /* DESCRIPTION: FEM: ETOL = Delta_U(k) * Residual(k) / Delta_U(0) * Residual(0) */ - addEnumOption("RESIDUAL_CRITERIA_FEM", Res_FEM_CRIT, ResFem_Map, RESFEM_RELATIVE); - /*!\brief RESIDUAL_FUNC_FLOW\n DESCRIPTION: Flow functional for the Residual criteria\n OPTIONS: See \link Residual_Map \endlink \n DEFAULT: RHO_RESIDUAL \ingroup Config*/ - addEnumOption("RESIDUAL_FUNC_FLOW", Residual_Func_Flow, Residual_Map, RHO_RESIDUAL); - /*!\brief STARTCONV_ITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/ - addUnsignedLongOption("STARTCONV_ITER", StartConv_Iter, 5); - /*!\brief CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ - addUnsignedShortOption("CAUCHY_ELEMS", Cauchy_Elems, 100); - /*!\brief CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-10 \ingroup Config*/ - addDoubleOption("CAUCHY_EPS", Cauchy_Eps, 1E-10); - /*!\brief CAUCHY_FUNC_FLOW - * \n DESCRIPTION: Flow functional for the Cauchy criteria \n OPTIONS: see \link Objective_Map \endlink \n DEFAULT: DRAG_COEFFICIENT \ingroup Config*/ - addEnumOption("CAUCHY_FUNC_FLOW", Cauchy_Func_Flow, Objective_Map, DRAG_COEFFICIENT); - /*!\brief CAUCHY_FUNC_ADJFLOW\n DESCRIPTION: Adjoint functional for the Cauchy criteria.\n OPTIONS: See \link Sens_Map \endlink. \n DEFAULT: SENS_GEOMETRY \ingroup Config*/ - addEnumOption("CAUCHY_FUNC_ADJFLOW", Cauchy_Func_AdjFlow, Sens_Map, SENS_GEOMETRY); + /*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/ + addDoubleOption("CONV_RESIDUAL_MINVAL", MinLogResidual, -14.0); + /*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/ + addUnsignedLongOption("CONV_STARTITER", StartConv_Iter, 5); + /*!\brief CONV_CAUCHY_ELEMS\n DESCRIPTION: Number of elements to apply the criteria. \n DEFAULT 100 \ingroup Config*/ + addUnsignedShortOption("CONV_CAUCHY_ELEMS", Cauchy_Elems, 100); + /*!\brief CONV_CAUCHY_EPS\n DESCRIPTION: Epsilon to control the series convergence \n DEFAULT: 1e-10 \ingroup Config*/ + addDoubleOption("CONV_CAUCHY_EPS", Cauchy_Eps, 1E-10); + /*!\brief CONV_FIELD\n DESCRIPTION: Output field to monitor \n Default: depends on solver \ingroup Config*/ + addStringListOption("CONV_FIELD", nConvField, ConvField); /*!\par CONFIG_CATEGORY: Multi-grid \ingroup Config*/ /*--- Options related to Multi-grid ---*/ @@ -1707,7 +1687,7 @@ void CConfig::SetConfig_Options() { /*--- Options related to input/output files and formats ---*/ /*!\brief OUTPUT_FORMAT \n DESCRIPTION: I/O format for output plots. \n OPTIONS: see \link Output_Map \endlink \n DEFAULT: TECPLOT \ingroup Config */ - addEnumOption("OUTPUT_FORMAT", Output_FileFormat, Output_Map, TECPLOT); + addEnumOption("TABULAR_FORMAT", Tab_FileFormat, TabOutput_Map, TAB_CSV); /*!\brief ACTDISK_JUMP \n DESCRIPTION: The jump is given by the difference in values or a ratio */ addEnumOption("ACTDISK_JUMP", ActDisk_Jump, Jump_Map, DIFFERENCE); /*!\brief MESH_FORMAT \n DESCRIPTION: Mesh input file format \n OPTIONS: see \link Input_Map \endlink \n DEFAULT: SU2 \ingroup Config*/ @@ -1737,49 +1717,19 @@ void CConfig::SetConfig_Options() { addStringOption("CONV_FILENAME", Conv_FileName, string("history")); /*!\brief BREAKDOWN_FILENAME \n DESCRIPTION: Output file forces breakdown \ingroup Config*/ addStringOption("BREAKDOWN_FILENAME", Breakdown_FileName, string("forces_breakdown.dat")); - /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup Config*/ - addStringOption("CONV_FILENAME_FSI", Conv_FileName_FSI, string("historyFSI.csv")); - /* DESCRIPTION: Viscous limiter turbulent equations */ - addBoolOption("WRITE_CONV_FILENAME_FSI", Write_Conv_FSI, false); /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart flow input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n DEFAULT: solution_flow.dat \ingroup Config */ - addStringOption("SOLUTION_FLOW_FILENAME", Solution_FlowFileName, string("solution_flow.dat")); + addStringOption("SOLUTION_FILENAME", Solution_FileName, string("solution.dat")); /*!\brief SOLUTION_ADJ_FILENAME\n DESCRIPTION: Restart adjoint input file. Objective function abbreviation is expected. \ingroup Config*/ addStringOption("SOLUTION_ADJ_FILENAME", Solution_AdjFileName, string("solution_adj.dat")); - /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart structure input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n Default: solution_flow.dat \ingroup Config */ - addStringOption("SOLUTION_STRUCTURE_FILENAME", Solution_FEMFileName, string("solution_structure.dat")); - /*!\brief SOLUTION_FLOW_FILENAME \n DESCRIPTION: Restart structure input file (the file output under the filename set by RESTART_FLOW_FILENAME) \n Default: solution_flow.dat \ingroup Config */ - addStringOption("SOLUTION_ADJ_STRUCTURE_FILENAME", Solution_AdjFEMFileName, string("solution_adjoint_structure.dat")); /*!\brief RESTART_FLOW_FILENAME \n DESCRIPTION: Output file restart flow \ingroup Config*/ - addStringOption("RESTART_FLOW_FILENAME", Restart_FlowFileName, string("restart_flow.dat")); + addStringOption("RESTART_FILENAME", Restart_FileName, string("restart.dat")); /*!\brief RESTART_ADJ_FILENAME \n DESCRIPTION: Output file restart adjoint. Objective function abbreviation will be appended. \ingroup Config*/ addStringOption("RESTART_ADJ_FILENAME", Restart_AdjFileName, string("restart_adj.dat")); - /*!\brief RESTART_STRUCTURE_FILENAME \n DESCRIPTION: Output file restart structure \ingroup Config*/ - addStringOption("RESTART_STRUCTURE_FILENAME", Restart_FEMFileName, string("restart_structure.dat")); - /*!\brief RESTART_ADJ_STRUCTURE_FILENAME \n DESCRIPTION: Output file restart structure \ingroup Config*/ - addStringOption("RESTART_ADJ_STRUCTURE_FILENAME", Restart_AdjFEMFileName, string("restart_adjoint_structure.dat")); /*!\brief VOLUME_FLOW_FILENAME \n DESCRIPTION: Output file flow (w/o extension) variables \ingroup Config */ - addStringOption("VOLUME_FLOW_FILENAME", Flow_FileName, string("flow")); - /*!\brief VOLUME_STRUCTURE_FILENAME - * \n DESCRIPTION: Output file structure (w/o extension) variables \ingroup Config*/ - addStringOption("VOLUME_STRUCTURE_FILENAME", Structure_FileName, string("structure")); - /*!\brief VOLUME_ADJ_STRUCTURE_FILENAME - * \n DESCRIPTION: Output file structure (w/o extension) variables \ingroup Config*/ - addStringOption("VOLUME_ADJ_STRUCTURE_FILENAME", AdjStructure_FileName, string("adj_structure")); - /*!\brief SURFACE_STRUCTURE_FILENAME - * \n DESCRIPTION: Output file structure (w/o extension) variables \ingroup Config*/ - addStringOption("SURFACE_STRUCTURE_FILENAME", SurfStructure_FileName, string("surface_structure")); - /*!\brief SURFACE_STRUCTURE_FILENAME - * \n DESCRIPTION: Output file structure (w/o extension) variables \ingroup Config*/ - addStringOption("SURFACE_ADJ_STRUCTURE_FILENAME", AdjSurfStructure_FileName, string("adj_surface_structure")); - /*!\brief SURFACE_HEAT_FILENAME - * \n DESCRIPTION: Output file structure (w/o extension) variables \ingroup Config */ - addStringOption("SURFACE_HEAT_FILENAME", SurfHeat_FileName, string("surface_heat")); - /*!\brief VOLUME_HEAT_FILENAME - * \n DESCRIPTION: Output file wave (w/o extension) variables \ingroup Config*/ - addStringOption("VOLUME_HEAT_FILENAME", Heat_FileName, string("heat")); + addStringOption("VOLUME_FILENAME", Volume_FileName, string("vol_solution")); /*!\brief VOLUME_ADJ_FILENAME * \n DESCRIPTION: Output file adjoint (w/o extension) variables \ingroup Config*/ - addStringOption("VOLUME_ADJ_FILENAME", Adj_FileName, string("adjoint")); + addStringOption("VOLUME_ADJ_FILENAME", Adj_FileName, string("adj_vol_solution")); /*!\brief GRAD_OBJFUNC_FILENAME * \n DESCRIPTION: Output objective function gradient \ingroup Config*/ addStringOption("GRAD_OBJFUNC_FILENAME", ObjFunc_Grad_FileName, string("of_grad.dat")); @@ -1788,7 +1738,7 @@ void CConfig::SetConfig_Options() { addStringOption("VALUE_OBJFUNC_FILENAME", ObjFunc_Value_FileName, string("of_func.dat")); /*!\brief SURFACE_FLOW_FILENAME * \n DESCRIPTION: Output file surface flow coefficient (w/o extension) \ingroup Config*/ - addStringOption("SURFACE_FLOW_FILENAME", SurfFlowCoeff_FileName, string("surface_flow")); + addStringOption("SURFACE_FILENAME", SurfCoeff_FileName, string("surface")); /*!\brief SURFACE_ADJ_FILENAME * \n DESCRIPTION: Output file surface adjoint coefficient (w/o extension) \ingroup Config*/ addStringOption("SURFACE_ADJ_FILENAME", SurfAdjCoeff_FileName, string("surface_adjoint")); @@ -1810,9 +1760,6 @@ void CConfig::SetConfig_Options() { /*!\brief WRT_CON_FREQ_DUALTIME * \n DESCRIPTION: Writing convergence history frequency for the dual time \ingroup Config*/ addUnsignedLongOption("WRT_CON_FREQ_DUALTIME", Wrt_Con_Freq_DualTime, 10); - /*!\brief LOW_MEMORY_OUTPUT - * \n DESCRIPTION: Output less information for lower memory use. \ingroup Config*/ - addBoolOption("LOW_MEMORY_OUTPUT", Low_MemoryOutput, false); /*!\brief WRT_OUTPUT * \n DESCRIPTION: Write output files (disable all output by setting to NO) \ingroup Config*/ addBoolOption("WRT_OUTPUT", Wrt_Output, true); @@ -2118,9 +2065,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Direction of the Electic Fields */ addDoubleListOption("ELECTRIC_FIELD_DIR", nDim_Electric_Field, Electric_Field_Dir); - /* DESCRIPTION: Convergence criteria for FEM adjoint */ - addDoubleOption("CRITERIA_FEM_ADJ", Res_FEM_ADJ, -5.0); - /*!\brief DESIGN_VARIABLE_FEA * \n DESCRIPTION: Design variable for FEA problems \n OPTIONS: See \link DVFEA_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ addEnumOption("DESIGN_VARIABLE_FEA", Kind_DV_FEA, DVFEA_Map, NODV_FEA); @@ -2256,13 +2200,13 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Determines if the multizone problem is solved for time-domain. */ addBoolOption("TIME_DOMAIN", Time_Domain, false); /* DESCRIPTION: Number of outer iterations in the multizone problem. */ - addUnsignedLongOption("OUTER_ITER", Outer_Iter, 1); + addUnsignedLongOption("OUTER_ITER", nOuterIter, 1); /* DESCRIPTION: Number of inner iterations in each multizone block. */ - addUnsignedLongOption("INNER_ITER", Inner_Iter, 1); + addUnsignedLongOption("INNER_ITER", nInnerIter, 1); /* DESCRIPTION: Number of time steps solved in the multizone problem. */ - addUnsignedLongOption("TIME_ITER", Time_Iter, 1); + addUnsignedLongOption("TIME_ITER", nTimeIter, 1); /* DESCRIPTION: Number of iterations in each single-zone block. */ - addUnsignedLongOption("ITER", Iter, 1000); + addUnsignedLongOption("ITER", nIter, 1000); /* DESCRIPTION: Restart iteration in the multizone problem. */ addUnsignedLongOption("RESTART_ITER", Restart_Iter, 1); /* DESCRIPTION: Minimum error threshold for the linear solver for the implicit formulation */ @@ -2270,12 +2214,21 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Total Physical Time for time-domain problems (s) */ addDoubleOption("MAX_TIME", Max_Time, 1.0); /* DESCRIPTION: Determines if the single-zone driver is used. (TEMPORARY) */ - addBoolOption("SINGLEZONE_DRIVER", SinglezoneDriver, false); + addBoolOption("SINGLEZONE_DRIVER", SinglezoneDriver, true); /* DESCRIPTION: Determines if the special output is written out */ addBoolOption("SPECIAL_OUTPUT", SpecialOutput, false); + + /* DESCRIPTION: Determines if the convergence history of each individual zone is written to screen */ + addBoolOption("WRT_ZONE_CONV", Wrt_ZoneConv, false); + /* DESCRIPTION: Determines if the convergence history of each individual zone is written to file */ + addBoolOption("WRT_ZONE_HIST", Wrt_ZoneHist, true); + + /* DESCRIPTION: Determines if the special output is written out */ addBoolOption("WRT_FORCES_BREAKDOWN", Wrt_ForcesBreakdown, false); - + + + /* DESCRIPTION: Use conservative approach for interpolating between meshes. * Options: NO, YES \ingroup Config */ addBoolOption("CONSERVATIVE_INTERPOLATION", ConservativeInterpolation, true); @@ -2514,6 +2467,34 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Multipoint mesh filenames, if using different meshes for each point */ addPythonOption("MULTIPOINT_MESH_FILENAME"); + + /*--- options that are used for the output ---*/ + /*!\par CONFIG_CATEGORY:Output Options\ingroup Config*/ + + /* DESCRIPTION: Type of screen output */ + addStringListOption("SCREEN_OUTPUT", nScreenOutput, ScreenOutput); + /* DESCRIPTION: Type of output printed to the history file */ + addStringListOption("HISTORY_OUTPUT", nHistoryOutput, HistoryOutput); + /* DESCRIPTION: Type of output printed to the volume solution file */ + addStringListOption("VOLUME_OUTPUT", nVolumeOutput, VolumeOutput); + + /* DESCRIPTION: History writing frequency (INNER_ITER) */ + addUnsignedLongOption("HISTORY_WRT_FREQ_INNER", HistoryWrtFreq[2], 1); + /* DESCRIPTION: History writing frequency (OUTER_ITER) */ + addUnsignedLongOption("HISTORY_WRT_FREQ_OUTER", HistoryWrtFreq[1], 1); + /* DESCRIPTION: History writing frequency (TIME_ITER) */ + addUnsignedLongOption("HISTORY_WRT_FREQ_TIME", HistoryWrtFreq[0], 1); + + /* DESCRIPTION: Screen writing frequency (INNER_ITER) */ + addUnsignedLongOption("SCREEN_WRT_FREQ_INNER", ScreenWrtFreq[2], 1); + /* DESCRIPTION: Screen writing frequency (OUTER_ITER) */ + addUnsignedLongOption("SCREEN_WRT_FREQ_OUTER", ScreenWrtFreq[1], 1); + /* DESCRIPTION: Screen writing frequency (TIME_ITER) */ + addUnsignedLongOption("SCREEN_WRT_FREQ_TIME", ScreenWrtFreq[0], 1); + /* DESCRIPTION: Volume solution writing frequency */ + addUnsignedLongOption("OUTPUT_WRT_FREQ", VolumeWrtFreq, 250); + /* DESCRIPTION: Volume solution files */ + addEnumListOption("OUTPUT_FILES", nVolumeOutputFiles, VolumeOutputFiles, Output_Map); /* DESCRIPTION: Using Uncertainty Quantification with SST Turbulence Model */ addBoolOption("USING_UQ", using_uq, false); @@ -2584,21 +2565,20 @@ void CConfig::SetConfig_Parsing(char case_filename[MAX_STRING_SIZE]) { newString.append(": invalid option name"); newString.append(". Check current SU2 options in config_template.cfg."); newString.append("\n"); - if (!option_name.compare("AD_COEFF_FLOW")) newString.append("AD_COEFF_FLOW= (1st, 2nd, 4th) is now JST_SENSOR_COEFF= (2nd, 4th).\n"); - if (!option_name.compare("AD_COEFF_ADJFLOW")) newString.append("AD_COEFF_ADJFLOW= (1st, 2nd, 4th) is now ADJ_JST_SENSOR_COEFF= (2nd, 4th).\n"); - if (!option_name.compare("SPATIAL_ORDER_FLOW")) newString.append("SPATIAL_ORDER_FLOW is now the boolean MUSCL_FLOW and the appropriate SLOPE_LIMITER_FLOW.\n"); - if (!option_name.compare("SPATIAL_ORDER_ADJFLOW")) newString.append("SPATIAL_ORDER_ADJFLOW is now the boolean MUSCL_ADJFLOW and the appropriate SLOPE_LIMITER_ADJFLOW.\n"); - if (!option_name.compare("SPATIAL_ORDER_TURB")) newString.append("SPATIAL_ORDER_TURB is now the boolean MUSCL_TURB and the appropriate SLOPE_LIMITER_TURB.\n"); - if (!option_name.compare("SPATIAL_ORDER_ADJTURB")) newString.append("SPATIAL_ORDER_ADJTURB is now the boolean MUSCL_ADJTURB and the appropriate SLOPE_LIMITER_ADJTURB.\n"); - if (!option_name.compare("LIMITER_COEFF")) newString.append("LIMITER_COEFF is now VENKAT_LIMITER_COEFF.\n"); - if (!option_name.compare("SHARP_EDGES_COEFF")) newString.append("SHARP_EDGES_COEFF is now ADJ_SHARP_LIMITER_COEFF.\n"); - if (!option_name.compare("DEFORM_TOL_FACTOR")) newString.append("DEFORM_TOL_FACTOR is no longer used.\n Set DEFORM_LINEAR_SOLVER_ERROR to define the minimum residual for grid deformation.\n"); - if (!option_name.compare("MOTION_FILENAME")) newString.append("MOTION_FILENAME is now DV_FILENAME.\n"); - if (!option_name.compare("BETA_DELTA")) newString.append("BETA_DELTA is now UQ_DELTA_B.\n"); - if (!option_name.compare("COMPONENTALITY")) newString.append("COMPONENTALITY is now UQ_COMPONENT.\n"); - if (!option_name.compare("PERMUTE")) newString.append("PERMUTE is now UQ_PERMUTE.\n"); - if (!option_name.compare("URLX")) newString.append("URLX is now UQ_URLX.\n"); - + if (!option_name.compare("EXT_ITER")) newString.append("Option EXT_ITER is deprecated as of v7.0. Please use TIME_ITER, OUTER_ITER or ITER \n" + "to specify the number of time iterations, outer multizone iterations or iterations, respectively."); + if (!option_name.compare("UNST_TIMESTEP")) newString.append("UNST_TIMESTEP is now TIME_STEP.\n"); + if (!option_name.compare("UNST_TIME")) newString.append("UNST_TIME is now MAX_TIME.\n"); + if (!option_name.compare("UNST_INT_ITER")) newString.append("UNST_INT_ITER is now INNER_ITER.\n"); + if (!option_name.compare("RESIDUAL_MINVAL")) newString.append("RESIDUAL_MINVAL is now CONV_RESIDUAL_MINVAL.\n"); + if (!option_name.compare("STARTCONV_ITER")) newString.append("STARTCONV_ITER is now CONV_STARTITER.\n"); + if (!option_name.compare("CAUCHY_ELEMS")) newString.append("CAUCHY_ELEMS is now CONV_CAUCHY_ELEMS.\n"); + if (!option_name.compare("CAUCHY_EPS")) newString.append("CAUCHY_EPS is now CONV_CAUCHY_EPS.\n"); + if (!option_name.compare("OUTPUT_FORMAT")) newString.append("OUTPUT_FORMAT is now TABULAR_FORMAT.\n"); + if (!option_name.compare("PHYSICAL_PROBLEM")) newString.append("PHYSICAL_PROBLEM is now SOLVER.\n"); + if (!option_name.compare("REGIME_TYPE")) newString.append("REGIME_TYPE has been removed.\n " + "If you want use the incompressible solver, \n" + "use INC_EULER, INC_NAVIER_STOKES or INC_RANS as value of the SOLVER option."); errorString.append(newString); err_count++; continue; @@ -2666,7 +2646,7 @@ void CConfig::SetDefault(){ for (map::iterator iter = all_options.begin(); iter != all_options.end(); ++iter) { if (option_map[iter->first]->GetValue().size() == 0) - option_map[iter->first]->SetDefault(); + option_map[iter->first]->SetDefault(); } } @@ -2900,6 +2880,28 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (nZone > 1){ Multizone_Problem = YES; } + + /*--- Set the default output files ---*/ + if (nVolumeOutputFiles == 0){ + nVolumeOutputFiles = 3; + VolumeOutputFiles = new unsigned short[nVolumeOutputFiles]; + VolumeOutputFiles[0] = RESTART_BINARY; + VolumeOutputFiles[1] = PARAVIEW_BINARY; + VolumeOutputFiles[2] = SURFACE_PARAVIEW_BINARY; + } + + if (Kind_Solver == NAVIER_STOKES && Kind_Turb_Model != NONE){ + SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= NAVIER_STOKES", CURRENT_FUNCTION); + } + if (Kind_Solver == INC_NAVIER_STOKES && Kind_Turb_Model != NONE){ + SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= INC_NAVIER_STOKES", CURRENT_FUNCTION); + } + if (Kind_Solver == RANS && Kind_Turb_Model == NONE){ + SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= RANS", CURRENT_FUNCTION); + } + if (Kind_Solver == INC_RANS && Kind_Turb_Model == NONE){ + SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= INC_RANS", CURRENT_FUNCTION); + } #ifndef HAVE_TECIO if (Output_FileFormat == TECPLOT_BINARY) { @@ -3087,9 +3089,31 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } - /*--- Low memory only for ASCII Tecplot ---*/ - - if (Output_FileFormat != TECPLOT) Low_MemoryOutput = NO; + /*--- Check for unsteady problem ---*/ + + if ((TimeMarching == TIME_STEPPING || + TimeMarching == DT_STEPPING_1ST || + TimeMarching == DT_STEPPING_2ND) && !Time_Domain){ + SU2_MPI::Error("TIME_DOMAIN must be set to YES if UNSTEADY_SIMULATION is " + "TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER or DUAL_TIME_STEPPING-2ND_ORDER", CURRENT_FUNCTION); + } + + if (Time_Domain){ + if (TimeMarching == TIME_STEPPING){ + InnerIter = 1; + } + if (!OptionIsSet("OUTPUT_WRT_FREQ")) + VolumeWrtFreq = 1; + if (Restart == NO){ + Restart_Iter = 0; + } + if (!OptionIsSet("HISTORY_WRT_FREQ_INNER")){ + HistoryWrtFreq[2] = 0; + } + if (!OptionIsSet("HISTORY_WRT_FREQ_OUTER")){ + HistoryWrtFreq[1] = 0; + } + } /*--- The that Discard_InFiles is false, owerwise the gradient could be wrong ---*/ @@ -3099,7 +3123,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Deactivate the multigrid in the adjoint problem ---*/ if ((ContinuousAdjoint && !MG_AdjointFlow) || - (Unsteady_Simulation == TIME_STEPPING)) { nMGLevels = 0; } + (TimeMarching == TIME_STEPPING)) { nMGLevels = 0; } /*--- If Fluid Structure Interaction, set the solver for each zone. *--- ZONE_0 is the zone of the fluid. @@ -3157,31 +3181,23 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Kind_Solver == FEM_ELASTICITY) { nMGLevels = 0; - if (Dynamic_Analysis == STATIC) nExtIter = 1; } /*--- Initialize the ofstream ConvHistFile. ---*/ - ofstream ConvHistFile; - - /*--- Decide whether we should be writing unsteady solution files. ---*/ - - if (Unsteady_Simulation == STEADY || - Unsteady_Simulation == HARMONIC_BALANCE) - { Wrt_Unsteady = false; } - else { Wrt_Unsteady = true; } +// ofstream ConvHistFile; - if (Kind_Solver == FEM_ELASTICITY) { +// if (Kind_Solver == FEM_ELASTICITY) { - if (Dynamic_Analysis == STATIC) { Wrt_Dynamic = false; } - else { Wrt_Dynamic = true; } +// if (Dynamic_Analysis == STATIC) { Wrt_Dynamic = false; } +// else { Wrt_Dynamic = true; } - } else { - Wrt_Dynamic = false; - } +// } else { +// Wrt_Dynamic = false; +// } /*--- Check for unsupported features. ---*/ - if ((Kind_Solver != EULER && Kind_Solver != NAVIER_STOKES && Kind_Solver != RANS) && (Unsteady_Simulation == HARMONIC_BALANCE)){ + if ((Kind_Solver != EULER && Kind_Solver != NAVIER_STOKES && Kind_Solver != RANS) && (TimeMarching == HARMONIC_BALANCE)){ SU2_MPI::Error("Harmonic Balance not yet implemented for the incompressible solver.", CURRENT_FUNCTION); } @@ -3269,8 +3285,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } - - /*--- Check for Boundary condition option agreement ---*/ + /*--- Check for Boundary condition option agreement ---*/ if (Kind_InitOption == REYNOLDS){ if ((Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS) && Reynolds <=0){ SU2_MPI::Error("Reynolds number required for NAVIER_STOKES and RANS !!", CURRENT_FUNCTION); @@ -3285,13 +3300,61 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Number of KIND_SURFACE_MOVEMENT must match number of MARKER_MOVING", CURRENT_FUNCTION); } + if (Time_Domain && Time_Step <= 0.0 && Unst_CFL == 0.0){ + SU2_MPI::Error("Invalid value for TIME_STEP.", CURRENT_FUNCTION); + } + + if (TimeMarching == TIME_STEPPING){ + nIter = 1; + nInnerIter = 1; + } + + if (!Time_Domain){ + nTimeIter = 1; + Time_Step = 0; + + ScreenWrtFreq[0] = 1; + HistoryWrtFreq[0] = 1; + + if (TimeMarching != HARMONIC_BALANCE) + TimeMarching = STEADY; + } + + if (Time_Domain){ + Delta_UnstTime = Time_Step; + Delta_DynTime = Time_Step; + /*--- Set the default write frequency to 1 if unsteady ---*/ + if (!OptionIsSet("OUTPUT_WRT_FREQ")){ + VolumeWrtFreq = 1; + } + } + + if (!Multizone_Problem){ + ScreenWrtFreq[1] = 0; + HistoryWrtFreq[1] = 0; + if (!Time_Domain){ + /*--- If not running multizone or unsteady, INNER_ITER and ITER are interchangeable, + * but precedence will be given to INNER_ITER if both options are present. ---*/ + if (!OptionIsSet("INNER_ITER")){ + nInnerIter = nIter; + } + } + } + + + if ((Multizone_Problem || Time_Domain) && OptionIsSet("ITER")){ + SU2_MPI::Error("ITER must not be used when running multizone and/or unsteady problems.\n" + "Use TIME_ITER, OUTER_ITER or INNER_ITER to specify number of time iterations,\n" + "outer iterations or inner iterations, respectively.", CURRENT_FUNCTION); + } + /*--- If we're solving a purely steady problem with no prescribed grid movement (both rotating frame and moving walls can be steady), make sure that there is no grid motion ---*/ if (GetGrid_Movement()){ if ((Kind_SU2 == SU2_CFD || Kind_SU2 == SU2_SOL) && - (Unsteady_Simulation == STEADY && !Time_Domain)){ + (TimeMarching == STEADY && !Time_Domain)){ if((Kind_GridMovement != ROTATING_FRAME) && (Kind_GridMovement != STEADY_TRANSLATION) && @@ -3305,7 +3368,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } } - /*--- The Line Search should be applied only in the deformation stage. ---*/ if (Kind_SU2 != SU2_DEF) { @@ -3325,20 +3387,6 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ else Rotating_Frame = false; - /*--- THIS IS A TEMPORARY WORKAROUND to run the new multizone driver without adapting the config file. - * Will be removed soon. ---*/ - if (Multizone_Problem){ - if (Unsteady_Simulation != STEADY || Time_Domain == YES){ - if (Delta_UnstTime != 0){ - Time_Domain = YES; - Time_Iter = nExtIter; - Outer_Iter = Unst_nIntIter; - Inner_Iter = 1; - Time_Step = Delta_UnstTime; - } - } - } - /*--- In case the grid movement parameters have not been declared in the config file, set them equal to zero for safety. Also check to make sure that for each option, a value has been declared for each moving marker. ---*/ @@ -3447,8 +3495,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ MoveMotion_Origin = new unsigned short[nMoveMotion_Origin]; for (iMarker = 0; iMarker < nMarker_Moving; iMarker++){ MoveMotion_Origin[iMarker] = NO; + } } - } if (nMoveMotion_Origin != nMarker_Moving){ SU2_MPI::Error("Number of MOVE_MOTION_ORIGIN must match number of MARKER_MOVING.", CURRENT_FUNCTION); } @@ -3456,7 +3504,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*-- Setting Harmonic Balance period from the config file */ - if (Unsteady_Simulation == HARMONIC_BALANCE) { + if (TimeMarching == HARMONIC_BALANCE) { HarmonicBalance_Period = GetHarmonicBalance_Period(); if (HarmonicBalance_Period < 0) { SU2_MPI::Error("Not a valid value for time period!!", CURRENT_FUNCTION); @@ -3470,7 +3518,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (nOmega_HB != nTimeInstances) { SU2_MPI::Error("Length of omega_HB must match the number TIME_INSTANCES!!" , CURRENT_FUNCTION); } - } + } } /*--- Force number of span-wise section to 1 if 2D case ---*/ @@ -3478,40 +3526,40 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ nSpanWiseSections_User=1; Kind_SpanWise= EQUISPACED; } - + /*--- Set number of TurboPerformance markers ---*/ if(nMarker_Turbomachinery > 0){ if(nMarker_Turbomachinery > 1){ nMarker_TurboPerformance = nMarker_Turbomachinery + SU2_TYPE::Int(nMarker_Turbomachinery/2) + 1; - } else { + }else{ nMarker_TurboPerformance = nMarker_Turbomachinery; } } else { nMarker_TurboPerformance = 0; nSpanWiseSections =1; } - + /*--- Set number of TurboPerformance markers ---*/ if(nMarker_Turbomachinery != 0){ nSpan_iZones = new unsigned short[nZone]; } - + /*--- Set number of TurboPerformance markers ---*/ if(GetGrid_Movement() && RampRotatingFrame && !DiscreteAdjoint){ FinalRotation_Rate_Z = Rotation_Rate[2]; if(abs(FinalRotation_Rate_Z) > 0.0){ Rotation_Rate[2] = RampRotatingFrame_Coeff[0]; + } + } - - } - + if(RampOutletPressure && !DiscreteAdjoint){ for (iMarker = 0; iMarker < nMarker_Giles; iMarker++){ if (Kind_Data_Giles[iMarker] == STATIC_PRESSURE || Kind_Data_Giles[iMarker] == STATIC_PRESSURE_1D || Kind_Data_Giles[iMarker] == RADIAL_EQUILIBRIUM ){ FinalOutletPressure = Giles_Var1[iMarker]; Giles_Var1[iMarker] = RampOutletPressure_Coeff[0]; + } } - } for (iMarker = 0; iMarker < nMarker_Riemann; iMarker++){ if (Kind_Data_Riemann[iMarker] == STATIC_PRESSURE || Kind_Data_Riemann[iMarker] == RADIAL_EQUILIBRIUM){ FinalOutletPressure = Riemann_Var1[iMarker]; @@ -3852,9 +3900,9 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Evaluate when the Cl should be evaluated ---*/ - Iter_Fixed_CL = SU2_TYPE::Int(nExtIter / (su2double(Update_Alpha)+1)); - Iter_Fixed_CM = SU2_TYPE::Int(nExtIter / (su2double(Update_iH)+1)); - Iter_Fixed_NetThrust = SU2_TYPE::Int(nExtIter / (su2double(Update_BCThrust)+1)); + Iter_Fixed_CL = SU2_TYPE::Int(nInnerIter / (su2double(Update_Alpha)+1)); + Iter_Fixed_CM = SU2_TYPE::Int(nInnerIter / (su2double(Update_iH)+1)); + Iter_Fixed_NetThrust = SU2_TYPE::Int(nInnerIter / (su2double(Update_BCThrust)+1)); /*--- Setting relaxation factor and CFL for the adjoint runs ---*/ @@ -3876,9 +3924,9 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kappa_Flow[1] = Kappa_AdjFlow[1]; } - if (Iter_Fixed_CL == 0) { Iter_Fixed_CL = nExtIter+1; Update_Alpha = 0; } - if (Iter_Fixed_CM == 0) { Iter_Fixed_CM = nExtIter+1; Update_iH = 0; } - if (Iter_Fixed_NetThrust == 0) { Iter_Fixed_NetThrust = nExtIter+1; Update_BCThrust = 0; } + if (Iter_Fixed_CL == 0) { Iter_Fixed_CL = nInnerIter+1; Update_Alpha = 0; } + if (Iter_Fixed_CM == 0) { Iter_Fixed_CM = nInnerIter+1; Update_iH = 0; } + if (Iter_Fixed_NetThrust == 0) { Iter_Fixed_NetThrust = nInnerIter+1; Update_BCThrust = 0; } for (iCFL = 1; iCFL < nCFL; iCFL++) CFL[iCFL] = CFL[iCFL-1]; @@ -3922,7 +3970,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Kind_TimeIntScheme_FEM_Flow == ADER_DG) { - Unsteady_Simulation = TIME_STEPPING; // Only time stepping for ADER. + TimeMarching = TIME_STEPPING; // Only time stepping for ADER. /* If time accurate local time stepping is used, make sure that an unsteady CFL is specified. If not, terminate. */ @@ -4151,7 +4199,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } /*--- Set up the time stepping / unsteady CFL options. ---*/ - if ((Unsteady_Simulation == TIME_STEPPING) && (Unst_CFL != 0.0)) { + if ((TimeMarching == TIME_STEPPING) && (Unst_CFL != 0.0)) { for (iCFL = 0; iCFL < nCFL; iCFL++) CFL[iCFL] = Unst_CFL; } @@ -4163,8 +4211,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (!ContinuousAdjoint & !DiscreteAdjoint) { if ((Fixed_CL_Mode) || (Fixed_CM_Mode)) { ConvCriteria = RESIDUAL; - nExtIter += Iter_dCL_dAlpha; - OrderMagResidual = 24; + nInnerIter += Iter_dCL_dAlpha; MinLogResidual = -24; } } @@ -4392,8 +4439,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Comm_Level == COMM_NONE) SU2_MPI::Error("COMM_LEVEL = NONE not yet implemented.", CURRENT_FUNCTION); - Wrt_Sol_Freq = nExtIter+1; - Wrt_Sol_Freq_DualTime = nExtIter+1; + Wrt_Sol_Freq = nTimeIter+1; + Wrt_Sol_Freq_DualTime = nTimeIter+1; /*--- Write only the restart. ---*/ @@ -4437,7 +4484,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error(string("MESH_BOX_SIZE specified without 3 values.\n"), CURRENT_FUNCTION); } - + if (DiscreteAdjoint) { #if !defined CODI_REVERSE_TYPE if (Kind_SU2 == SU2_CFD) { @@ -4450,7 +4497,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Disable writing of limiters if enabled ---*/ Wrt_Limiters = false; - if (Unsteady_Simulation) { + if (TimeMarching) { Restart_Flow = false; @@ -4460,12 +4507,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ string("GRID_MOVEMENT = RIGID_MOTION."), CURRENT_FUNCTION); } - /*--- Quickfix to not trigger the error message below if SINGLEZONE_DRIVER is used. - Once the old driver (i.e. EXT_ITER with it) is removed, the Error conditional - can be changed. ---*/ - if (SinglezoneDriver) nExtIter = Time_Iter; - - if (Unst_AdjointIter- long(nExtIter) < 0){ + if (Unst_AdjointIter- long(nTimeIter) < 0){ SU2_MPI::Error(string("Invalid iteration number requested for unsteady adjoint.\n" ) + string("Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER."), CURRENT_FUNCTION); @@ -4474,7 +4516,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- If the averaging interval is not set, we average over all time-steps ---*/ if (Iter_Avg_Objective == 0.0) { - Iter_Avg_Objective = nExtIter; + Iter_Avg_Objective = nTimeIter; } } @@ -4517,9 +4559,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ RampOutletPressure = false; RampRotatingFrame = false; - } - } void CConfig::SetMarkers(unsigned short val_software) { @@ -5157,12 +5197,11 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { bool fea = ((Kind_Solver == FEM_ELASTICITY) || (Kind_Solver == DISC_ADJ_FEM)); - cout << endl <<"----------------- Physical Case Definition ( Zone " << iZone << " ) -------------------" << endl; if (val_software == SU2_CFD) { if (FSI_Problem) { cout << "Fluid-Structure Interaction." << endl; - } + } if (DiscreteAdjoint) { cout <<"Discrete Adjoint equations using Algorithmic Differentiation " << endl; @@ -5279,12 +5318,8 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { if (Restart) { if (Read_Binary_Restart) cout << "Reading and writing binary SU2 native restart files." << endl; else cout << "Reading and writing ASCII SU2 native restart files." << endl; - if (!ContinuousAdjoint && Kind_Solver != FEM_ELASTICITY) cout << "Read flow solution from: " << Solution_FlowFileName << "." << endl; + if (!ContinuousAdjoint && Kind_Solver != FEM_ELASTICITY) cout << "Read flow solution from: " << Solution_FileName << "." << endl; if (ContinuousAdjoint) cout << "Read adjoint solution from: " << Solution_AdjFileName << "." << endl; - if (Kind_Solver == FEM_ELASTICITY) cout << "Read structural solution from: " << Solution_FEMFileName << "." << endl; - if (Kind_Solver == DISC_ADJ_FEM){ - cout << "Read structural adjoint solution from: " << Solution_AdjFEMFileName << "." << endl; - } } else { if (fea) cout << "No restart solution, initialize from undeformed configuration." << endl; @@ -5292,8 +5327,8 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } if (ContinuousAdjoint) - cout << "Read flow solution from: " << Solution_FlowFileName << "." << endl; - + cout << "Read flow solution from: " << Solution_FileName << "." << endl; + if (!fea){ if (Kind_Regime == COMPRESSIBLE) { if (Ref_NonDim == DIMENSIONAL) { cout << "Dimensional simulation." << endl; } @@ -5320,32 +5355,32 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { if (SystemMeasurements == US) cout << " ft." << endl; else cout << " m." << endl; if (nMarker_Monitoring != 0){ - if ((nRefOriginMoment_X > 1) || (nRefOriginMoment_Y > 1) || (nRefOriginMoment_Z > 1)) { - cout << "Surface(s) where the force coefficients are evaluated and \n"; - cout << "their reference origin for moment computation: \n"; - - for (iMarker_Monitoring = 0; iMarker_Monitoring < nMarker_Monitoring; iMarker_Monitoring++) { - cout << " - " << Marker_Monitoring[iMarker_Monitoring] << " (" << RefOriginMoment_X[iMarker_Monitoring] <<", "< 1) || (nRefOriginMoment_Y > 1) || (nRefOriginMoment_Z > 1)) { + cout << "Surface(s) where the force coefficients are evaluated and \n"; + cout << "their reference origin for moment computation: \n"; + + for (iMarker_Monitoring = 0; iMarker_Monitoring < nMarker_Monitoring; iMarker_Monitoring++) { + cout << " - " << Marker_Monitoring[iMarker_Monitoring] << " (" << RefOriginMoment_X[iMarker_Monitoring] <<", "< & option_value) { - const string delimiters(" ()[]{}:,\t\n\v\f\r"); + const string delimiters(" (){}:,\t\n\v\f\r"); // check for comments or empty string string::size_type pos, last_pos; pos = str.find_first_of("%"); @@ -7128,7 +7068,6 @@ CConfig::~CConfig(void) { if (MarkerPlunging_Omega != NULL) delete [] MarkerPlunging_Omega; /*--- plunging amplitude: ---*/ - if (MarkerPlunging_Ampl != NULL) delete [] MarkerPlunging_Ampl; /*--- reference origin for moments ---*/ @@ -7489,6 +7428,7 @@ CConfig::~CConfig(void) { if (default_body_force != NULL) delete [] default_body_force; if (default_sineload_coeff!= NULL) delete [] default_sineload_coeff; if (default_nacelle_location != NULL) delete [] default_nacelle_location; + if (default_wrt_freq != NULL) delete [] default_wrt_freq; if (default_cp_polycoeffs != NULL) delete [] default_cp_polycoeffs; if (default_mu_polycoeffs != NULL) delete [] default_mu_polycoeffs; @@ -7525,13 +7465,44 @@ CConfig::~CConfig(void) { if (top_optim_kernels != NULL) delete [] top_optim_kernels; if (top_optim_kernel_params != NULL) delete [] top_optim_kernel_params; if (top_optim_filter_radius != NULL) delete [] top_optim_filter_radius; + + if (ScreenOutput != NULL) delete [] ScreenOutput; + if (HistoryOutput != NULL) delete [] HistoryOutput; + if (VolumeOutput != NULL) delete [] VolumeOutput; + if (Mesh_Box_Size != NULL) delete [] Mesh_Box_Size; + if (VolumeOutputFiles != NULL) delete [] VolumeOutputFiles; - if (Kind_SurfaceMovement != NULL) delete [] Kind_SurfaceMovement; } -string CConfig::GetUnsteady_FileName(string val_filename, int val_iter) { +string CConfig::GetFilename(string filename, string ext, unsigned long Iter){ + + /*--- Remove any extension --- */ + + unsigned short lastindex = filename.find_last_of("."); + filename = filename.substr(0, lastindex); + + /*--- Add the extension --- */ + + filename = filename + string(ext); + + /*--- Append the zone number if multizone problems ---*/ + if (GetnZone() > 1) + filename = GetMultizone_FileName(filename, GetiZone(), ext); + + /*--- Append the zone number if multiple instance problems ---*/ + if (GetnTimeInstances() > 1) + filename = GetMultiInstance_FileName(filename, GetiInst(), ext); - string UnstExt, UnstFilename = val_filename; + if (GetTime_Domain()){ + filename = GetUnsteady_FileName(filename, (int)Iter, ext); + } + + return filename; +} + +string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, string ext) { + + string UnstExt="", UnstFilename = val_filename; char buffer[50]; /*--- Check that a positive value iteration is requested (for now). ---*/ @@ -7539,62 +7510,68 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter) { if (val_iter < 0) { SU2_MPI::Error("Requesting a negative iteration number for the restart file!!", CURRENT_FUNCTION); } - + + unsigned short lastindex = UnstFilename.find_last_of("."); + UnstFilename = UnstFilename.substr(0, lastindex); + /*--- Append iteration number for unsteady cases ---*/ - if ((Wrt_Unsteady) || (Wrt_Dynamic)) { - unsigned short lastindex = UnstFilename.find_last_of("."); - UnstFilename = UnstFilename.substr(0, lastindex); - if ((val_iter >= 0) && (val_iter < 10)) SPRINTF (buffer, "_0000%d.dat", val_iter); - if ((val_iter >= 10) && (val_iter < 100)) SPRINTF (buffer, "_000%d.dat", val_iter); - if ((val_iter >= 100) && (val_iter < 1000)) SPRINTF (buffer, "_00%d.dat", val_iter); - if ((val_iter >= 1000) && (val_iter < 10000)) SPRINTF (buffer, "_0%d.dat", val_iter); - if (val_iter >= 10000) SPRINTF (buffer, "_%d.dat", val_iter); - string UnstExt = string(buffer); - UnstFilename.append(UnstExt); + if (Time_Domain) { + + if ((val_iter >= 0) && (val_iter < 10)) SPRINTF (buffer, "_0000%d", val_iter); + if ((val_iter >= 10) && (val_iter < 100)) SPRINTF (buffer, "_000%d", val_iter); + if ((val_iter >= 100) && (val_iter < 1000)) SPRINTF (buffer, "_00%d", val_iter); + if ((val_iter >= 1000) && (val_iter < 10000)) SPRINTF (buffer, "_0%d", val_iter); + if (val_iter >= 10000) SPRINTF (buffer, "_%d", val_iter); + UnstExt = string(buffer); } + UnstExt += ext; + UnstFilename.append(UnstExt); return UnstFilename; } -string CConfig::GetMultizone_FileName(string val_filename, int val_iZone) { +string CConfig::GetMultizone_FileName(string val_filename, int val_iZone, string ext) { string multizone_filename = val_filename; char buffer[50]; + unsigned short lastindex = multizone_filename.find_last_of("."); + multizone_filename = multizone_filename.substr(0, lastindex); + if (GetnZone() > 1 ) { - unsigned short lastindex = multizone_filename.find_last_of("."); - multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); + SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); multizone_filename.append(string(buffer)); } + + multizone_filename += ext; return multizone_filename; } -string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone) { +string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone, string ext) { string multizone_filename = val_filename; char buffer[50]; - + unsigned short lastindex = multizone_filename.find_last_of("."); + multizone_filename = multizone_filename.substr(0, lastindex); if (GetnZone() > 1 ) { - unsigned short lastindex = multizone_filename.find_last_of("."); - multizone_filename = multizone_filename.substr(0, lastindex); SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); multizone_filename.append(string(buffer)); } + multizone_filename += ext; return multizone_filename; } -string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst) { +string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, string ext) { string multizone_filename = val_filename; char buffer[50]; unsigned short lastindex = multizone_filename.find_last_of("."); multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iInst)); + SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); - + multizone_filename += ext; return multizone_filename; } @@ -7717,13 +7694,12 @@ void CConfig::SetKind_ConvNumScheme(unsigned short val_kind_convnumscheme, } void CConfig::SetGlobalParam(unsigned short val_solver, - unsigned short val_system, - unsigned long val_extiter) { + unsigned short val_system) { /*--- Set the simulation global time ---*/ - Current_UnstTime = static_cast(val_extiter)*Delta_UnstTime; - Current_UnstTimeND = static_cast(val_extiter)*Delta_UnstTimeND; + Current_UnstTime = static_cast(TimeIter)*Delta_UnstTime; + Current_UnstTimeND = static_cast(TimeIter)*Delta_UnstTimeND; /*--- Set the solver methods ---*/ @@ -7859,7 +7835,7 @@ void CConfig::SetGlobalParam(unsigned short val_solver, case FEM_ELASTICITY: - Current_DynTime = static_cast(val_extiter)*Delta_DynTime; + Current_DynTime = static_cast(TimeIter)*Delta_DynTime; if (val_system == RUNTIME_FEA_SYS) { SetKind_ConvNumScheme(NONE, NONE, NONE, NONE, NONE, NONE); @@ -9401,49 +9377,29 @@ void CConfig::SetFreeStreamTurboNormal(su2double* turboNormal){ } void CConfig::SetMultizone(CConfig *driver_config, CConfig **config_container){ - - unsigned short iMarker_CfgFile, iMarker_ZoneInterface; - - /*--- If the command MARKER_ZONE_INTERFACE is not in the config file, nMarker_ZoneInterface will be 0 ---*/ - if (nMarker_ZoneInterface == 0){ - - /*--- Copy the marker interface from the driver configuration file ---*/ - - nMarker_ZoneInterface = driver_config->GetnMarker_ZoneInterface(); - Marker_ZoneInterface = new string[nMarker_ZoneInterface]; - - /*--- Set the Markers at the interface from the main config file ---*/ - for (iMarker_ZoneInterface = 0; iMarker_ZoneInterface < nMarker_ZoneInterface; iMarker_ZoneInterface++){ - Marker_ZoneInterface[iMarker_ZoneInterface] = driver_config->GetMarkerTag_ZoneInterface(iMarker_ZoneInterface); + + for (unsigned short iZone = 0; iZone < nZone; iZone++){ + + if (config_container[iZone]->GetTime_Domain() != GetTime_Domain()){ + SU2_MPI::Error("Option TIME_DOMAIN must be the same in all zones.", CURRENT_FUNCTION); } - - /*--- Identification of Multizone markers ---*/ - if (rank == MASTER_NODE) cout << endl << "-------------------- Interface Boundary Information ---------------------" << endl; - if (rank == MASTER_NODE) cout << "The interface markers are: "; - - unsigned short indexOutput = 0; - for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) { - unsigned short indexMarker = 0; - Marker_CfgFile_ZoneInterface[iMarker_CfgFile] = NO; - for (iMarker_ZoneInterface = 0; iMarker_ZoneInterface < nMarker_ZoneInterface; iMarker_ZoneInterface++){ - if (Marker_CfgFile_TagBound[iMarker_CfgFile] == Marker_ZoneInterface[iMarker_ZoneInterface]){ - indexMarker = (int)(iMarker_ZoneInterface/2+1); - indexOutput++; - if (rank == MASTER_NODE) cout << Marker_CfgFile_TagBound[iMarker_CfgFile]; - } - } - Marker_CfgFile_ZoneInterface[iMarker_CfgFile] = indexMarker; - if (rank == MASTER_NODE){ - if (indexMarker > 0 && (indexOutput < (nMarker_ZoneInterface/2))) cout << ", "; - else if (indexMarker > 0 && (indexOutput == (nMarker_ZoneInterface/2))) cout << "."; - } + if (config_container[iZone]->GetnTime_Iter() != GetnTime_Iter()){ + SU2_MPI::Error("Option TIME_ITER must be the same in all zones.", CURRENT_FUNCTION); + } + if (config_container[iZone]->GetnOuter_Iter() != GetnOuter_Iter()){ + SU2_MPI::Error("Option OUTER_ITER must be the same in all zones.", CURRENT_FUNCTION); + } + if (config_container[iZone]->GetTime_Step() != GetTime_Step()){ + SU2_MPI::Error("Option TIME_STEP must be the same in all zones.", CURRENT_FUNCTION); + } + if (config_container[iZone]->GetMultizone_Problem() != GetMultizone_Problem()){ + SU2_MPI::Error("Option MULTIZONE must be the same in all zones.", CURRENT_FUNCTION); + } + if (config_container[iZone]->GetMultizone_Mesh() != GetMultizone_Mesh()){ + SU2_MPI::Error("Option MULTIZONE_MESH must be the same in all zones.", CURRENT_FUNCTION); } - if (rank == MASTER_NODE) cout << endl; } - /*--- Set the Multizone Boolean to true ---*/ - Multizone_Problem = true; - /*--- Set the Restart iter for time dependent problems ---*/ if (driver_config->GetRestart()){ Unst_RestartIter = driver_config->GetRestart_Iter(); diff --git a/Common/src/dual_grid_structure.cpp b/Common/src/dual_grid_structure.cpp index 2054f7c9771e..233c8c06dc7e 100644 --- a/Common/src/dual_grid_structure.cpp +++ b/Common/src/dual_grid_structure.cpp @@ -59,7 +59,7 @@ CPoint::CPoint(unsigned short val_nDim, unsigned long val_globalindex, CConfig * /*--- Volume (0 -> Vol_nP1, 1-> Vol_n, 2 -> Vol_nM1 ) and coordinates of the control volume ---*/ - if (config->GetUnsteady_Simulation() == NO) { + if (config->GetTime_Marching() == NO) { Volume = new su2double[1]; Volume[0] = 0.0; } @@ -133,7 +133,7 @@ CPoint::CPoint(unsigned short val_nDim, unsigned long val_globalindex, CConfig * /*--- Structures for storing old node coordinates for computing grid velocities via finite differencing with dynamically deforming meshes. ---*/ /*--- In the case of deformable mesh solver, these coordinates are stored as solutions to the mesh problem ---*/ - if ( config->GetGrid_Movement() && (config->GetUnsteady_Simulation() != NO)) { + if ( config->GetGrid_Movement() && (config->GetTime_Marching() != NO)) { Coord_p1 = new su2double[nDim]; Coord_n = new su2double[nDim]; Coord_n1 = new su2double[nDim]; @@ -147,6 +147,9 @@ CPoint::CPoint(unsigned short val_nDim, unsigned long val_globalindex, CConfig * /*--- Intialize the value of the periodic volume. ---*/ Periodic_Volume = 0.0; + /*--- Init walldistance ---*/ + + Wall_Distance = 0.0; } CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, unsigned long val_globalindex, CConfig *config) : CDualGrid(2) { @@ -165,7 +168,7 @@ CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, unsigned long val_g /*--- Volume (0 -> Vol_nP1, 1-> Vol_n, 2 -> Vol_nM1 ) and coordinates of the control volume ---*/ - if (config->GetUnsteady_Simulation() == NO) { + if (config->GetTime_Marching() == NO) { Volume = new su2double[1]; Volume[0] = 0.0; } @@ -238,7 +241,7 @@ CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, unsigned long val_g /*--- Structures for storing old node coordinates for computing grid velocities via finite differencing with dynamically deforming meshes. ---*/ /*--- In the case of deformable mesh solver, these coordinates are stored as solutions to the mesh problem ---*/ - if ( config->GetGrid_Movement() && (config->GetUnsteady_Simulation() != NO)) { + if ( config->GetGrid_Movement() && (config->GetTime_Marching() != NO)) { Coord_p1 = new su2double[nDim]; Coord_n = new su2double[nDim]; Coord_n1 = new su2double[nDim]; @@ -274,7 +277,7 @@ CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, su2double val_coord GridVel = NULL; GridVel_Grad = NULL; /*--- Volume (0 -> Vol_nP1, 1-> Vol_n, 2 -> Vol_nM1 ) and coordinates of the control volume ---*/ - if ( config->GetUnsteady_Simulation() == NO ) { + if ( config->GetTime_Marching() == NO ) { Volume = new su2double[1]; Volume[0] = 0.0; } @@ -349,7 +352,7 @@ CPoint::CPoint(su2double val_coord_0, su2double val_coord_1, su2double val_coord /*--- Structures for storing old node coordinates for computing grid velocities via finite differencing with dynamically deforming meshes. ---*/ /*--- In the case of deformable mesh solver, these coordinates are stored as solutions to the mesh problem ---*/ - if ( config->GetGrid_Movement() && (config->GetUnsteady_Simulation() != NO)) { + if ( config->GetGrid_Movement() && (config->GetTime_Marching() != NO)) { Coord_p1 = new su2double[nDim]; Coord_n = new su2double[nDim]; Coord_n1 = new su2double[nDim]; diff --git a/Common/src/fem_geometry_structure.cpp b/Common/src/fem_geometry_structure.cpp index 3f5e1c50b2a7..cf5407e35bd1 100644 --- a/Common/src/fem_geometry_structure.cpp +++ b/Common/src/fem_geometry_structure.cpp @@ -5435,14 +5435,14 @@ void CMeshFEM_DG::MetricTermsVolumeElements(CConfig *config) { bool FullMassMatrix = false, FullInverseMassMatrix = false; bool LumpedMassMatrix = false, DerMetricTerms = false; - if(config->GetUnsteady_Simulation() == STEADY || - config->GetUnsteady_Simulation() == ROTATIONAL_FRAME) { + if(config->GetTime_Marching() == STEADY || + config->GetTime_Marching() == ROTATIONAL_FRAME) { if( UseLumpedMassMatrix) LumpedMassMatrix = true; else FullInverseMassMatrix = true; } - else if(config->GetUnsteady_Simulation() == DT_STEPPING_1ST || - config->GetUnsteady_Simulation() == DT_STEPPING_2ND || - config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + else if(config->GetTime_Marching() == DT_STEPPING_1ST || + config->GetTime_Marching() == DT_STEPPING_2ND || + config->GetTime_Marching() == HARMONIC_BALANCE) { if( UseLumpedMassMatrix ) FullMassMatrix = LumpedMassMatrix = true; else FullInverseMassMatrix = true; } diff --git a/Common/src/geometry_structure.cpp b/Common/src/geometry_structure.cpp index 888974480a74..0ffdbce65b4e 100644 --- a/Common/src/geometry_structure.cpp +++ b/Common/src/geometry_structure.cpp @@ -784,7 +784,7 @@ void CGeometry::InitiateComms(CGeometry *geometry, MPI_TYPE = COMM_TYPE_DOUBLE; break; case COORDINATES_OLD: - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) COUNT_PER_POINT = nDim*2; else COUNT_PER_POINT = nDim; @@ -865,7 +865,7 @@ void CGeometry::InitiateComms(CGeometry *geometry, for (iDim = 0; iDim < nDim; iDim++) { bufDSend[buf_offset+iDim] = vector[iDim]; } - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) { + if (config->GetTime_Marching() == DT_STEPPING_2ND) { vector = node[iPoint]->GetCoord_n1(); for (iDim = 0; iDim < nDim; iDim++) { bufDSend[buf_offset+nDim+iDim] = vector[iDim]; @@ -964,7 +964,7 @@ void CGeometry::CompleteComms(CGeometry *geometry, break; case COORDINATES_OLD: node[iPoint]->SetCoord_n(&bufDRecv[buf_offset]); - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) node[iPoint]->SetCoord_n1(&bufDRecv[buf_offset+nDim]); break; case MAX_LENGTH: @@ -3706,6 +3706,42 @@ void CGeometry::SetElemVolume(CConfig *config) } } +void CGeometry::UpdateBoundaries(CConfig *config){ + + unsigned short iMarker; + unsigned long iElem_Surface, iNode_Surface, Point_Surface; + + for (iMarker = 0; iMarker GetnMarker_All(); iMarker++){ + for (iElem_Surface = 0; iElem_Surface < nElem_Bound[iMarker]; iElem_Surface++) { + for (iNode_Surface = 0; iNode_Surface < bound[iMarker][iElem_Surface]->GetnNodes(); iNode_Surface++) { + + Point_Surface = bound[iMarker][iElem_Surface]->GetNode(iNode_Surface); + + node[Point_Surface]->SetPhysicalBoundary(false); + node[Point_Surface]->SetSolidBoundary(false); + + if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE && + config->GetMarker_All_KindBC(iMarker) != INTERFACE_BOUNDARY && + config->GetMarker_All_KindBC(iMarker) != NEARFIELD_BOUNDARY && + config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) + node[Point_Surface]->SetPhysicalBoundary(true); + + if (config->GetSolid_Wall(iMarker)) + node[Point_Surface]->SetSolidBoundary(true); + } + } + } + + /*--- Update the normal neighbors ---*/ + + FindNormal_Neighbor(config); + + /*--- Compute wall distance ---- */ + + ComputeWall_Distance(config); + +} + CPhysicalGeometry::CPhysicalGeometry() : CGeometry() { size = SU2_MPI::GetSize(); @@ -3834,7 +3870,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, Read_SU2_Format_Parallel_FEM(config, val_mesh_filename, val_iZone, val_nZone); break; - case CGNS: + case CGNS_GRID: Read_CGNS_Format_Parallel_FEM(config, val_mesh_filename, val_iZone, val_nZone); break; @@ -3846,7 +3882,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, else { switch (val_format) { - case SU2: case CGNS: case RECTANGLE: case BOX: + case SU2: case CGNS_GRID: case RECTANGLE: case BOX: Read_Mesh_FVM(config, val_mesh_filename, val_iZone, val_nZone); break; default: @@ -3886,7 +3922,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, string str = "boundary.dat"; - str = config->GetMultizone_FileName(str, val_iZone); + str = config->GetMultizone_FileName(str, val_iZone, ".dat"); /*--- Open .su2 grid file ---*/ @@ -5963,7 +5999,7 @@ void CPhysicalGeometry::DistributeMarkerTags(CConfig *config, CGeometry *geometr SU2_MPI::Bcast(&nMarker_Global, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - char *mpi_str_buf = new char[nMarker_Global*MAX_STRING_SIZE]; + char *mpi_str_buf = new char[nMarker_Global*MAX_STRING_SIZE](); if (rank == MASTER_NODE) { for (iMarker = 0; iMarker < nMarker_Global; iMarker++) { SPRINTF(&mpi_str_buf[iMarker*MAX_STRING_SIZE], "%s", @@ -7616,7 +7652,7 @@ void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, case SU2: MeshFVM = new CSU2ASCIIMeshReaderFVM(config, val_iZone, val_nZone); break; - case CGNS: + case CGNS_GRID: MeshFVM = new CCGNSMeshReaderFVM(config, val_iZone, val_nZone); break; case RECTANGLE: @@ -7997,7 +8033,7 @@ void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig *config, /*--- Update config file lists in order to store the boundary information for this marker in the correct place. ---*/ - + Tag_to_Marker[config->GetMarker_CfgFile_TagBound(Marker_Tag)] = Marker_Tag; config->SetMarker_All_TagBound(iMarker, Marker_Tag); config->SetMarker_All_KindBC(iMarker, config->GetMarker_CfgFile_KindBC(Marker_Tag)); @@ -8009,13 +8045,15 @@ void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig *config, config->SetMarker_All_ZoneInterface(iMarker, config->GetMarker_CfgFile_ZoneInterface(Marker_Tag)); config->SetMarker_All_DV(iMarker, config->GetMarker_CfgFile_DV(Marker_Tag)); config->SetMarker_All_Moving(iMarker, config->GetMarker_CfgFile_Moving(Marker_Tag)); + config->SetMarker_All_Deform_Mesh(iMarker, config->GetMarker_CfgFile_Deform_Mesh(Marker_Tag)); + config->SetMarker_All_Fluid_Load(iMarker, config->GetMarker_CfgFile_Fluid_Load(Marker_Tag)); config->SetMarker_All_PyCustom(iMarker, config->GetMarker_CfgFile_PyCustom(Marker_Tag)); config->SetMarker_All_PerBound(iMarker, config->GetMarker_CfgFile_PerBound(Marker_Tag)); config->SetMarker_All_SendRecv(iMarker, NONE); config->SetMarker_All_Turbomachinery(iMarker, config->GetMarker_CfgFile_Turbomachinery(Marker_Tag)); config->SetMarker_All_TurbomachineryFlag(iMarker, config->GetMarker_CfgFile_TurbomachineryFlag(Marker_Tag)); config->SetMarker_All_MixingPlaneInterface(iMarker, config->GetMarker_CfgFile_MixingPlaneInterface(Marker_Tag)); - + } } @@ -13306,9 +13344,9 @@ void CPhysicalGeometry::SetGridVelocity(CConfig *config, unsigned long iter) { /*--- Compute mesh velocity with 1st or 2nd-order approximation ---*/ for (iDim = 0; iDim < nDim; iDim++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) GridVel = ( Coord_nP1[iDim] - Coord_n[iDim] ) / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) GridVel = ( 3.0*Coord_nP1[iDim] - 4.0*Coord_n[iDim] + 1.0*Coord_nM1[iDim] ) / (2.0*TimeStep); @@ -13502,28 +13540,28 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { /*--- Time-average any unsteady surface sensitivities ---*/ - unsigned long iExtIter, nExtIter; + unsigned long iTimeIter, nTimeIter; su2double delta_T, total_T; - if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - nExtIter = config->GetUnst_AdjointIter(); - delta_T = config->GetDelta_UnstTime(); - total_T = (su2double)nExtIter*delta_T; - } else if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() && config->GetTime_Domain()) { + nTimeIter = config->GetUnst_AdjointIter(); + delta_T = config->GetTime_Step(); + total_T = (su2double)nTimeIter*delta_T; + } else if (config->GetTime_Marching() == HARMONIC_BALANCE) { /*--- Compute period of oscillation & compute time interval using nTimeInstances ---*/ su2double period = config->GetHarmonicBalance_Period(); - nExtIter = config->GetnTimeInstances(); - delta_T = period/(su2double)nExtIter; + nTimeIter = config->GetnTimeInstances(); + delta_T = period/(su2double)nTimeIter; total_T = period; } else { - nExtIter = 1; + nTimeIter = 1; delta_T = 1.0; total_T = 1.0; } - for (iExtIter = 0; iExtIter < nExtIter; iExtIter++) { + for (iTimeIter = 0; iTimeIter < nTimeIter; iTimeIter++) { /*--- Prepare to read surface sensitivity files (CSV) ---*/ @@ -13535,16 +13573,16 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { strcpy (cstr, surfadj_filename.c_str()); /*--- Write file name with extension if unsteady or steady ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) - SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iExtIter)); + if (config->GetTime_Marching() == HARMONIC_BALANCE) + SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); - if ((config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) || - (config->GetUnsteady_Simulation() == HARMONIC_BALANCE)) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.csv", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iExtIter)); + if ((config->GetTime_Marching() && config->GetTime_Domain()) || + (config->GetTime_Marching() == HARMONIC_BALANCE)) { + if ((SU2_TYPE::Int(iTimeIter) >= 0) && (SU2_TYPE::Int(iTimeIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iTimeIter)); + if ((SU2_TYPE::Int(iTimeIter) >= 10) && (SU2_TYPE::Int(iTimeIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iTimeIter)); + if ((SU2_TYPE::Int(iTimeIter) >= 100) && (SU2_TYPE::Int(iTimeIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iTimeIter)); + if ((SU2_TYPE::Int(iTimeIter) >= 1000) && (SU2_TYPE::Int(iTimeIter) < 10000)) SPRINTF (buffer, "_0%d.csv", SU2_TYPE::Int(iTimeIter)); + if (SU2_TYPE::Int(iTimeIter) >= 10000) SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); } else SPRINTF (buffer, ".csv"); @@ -13556,17 +13594,27 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { string::size_type position; Surface_file.open(cstr, ios::in); - - /*--- Read extra inofmration ---*/ + + /*--- File header ---*/ getline(Surface_file, text_line); - text_line.erase (0,9); - su2double AoASens = atof(text_line.c_str()); - config->SetAoA_Sens(AoASens); - /*--- File header ---*/ + vector split_line; - getline(Surface_file, text_line); + char delimiter = ','; + split_line = PrintingToolbox::split(text_line, delimiter); + + for (unsigned short iField = 0; iField < split_line.size(); iField++){ + PrintingToolbox::trim(split_line[iField]); + } + + std::vector::iterator it = std::find(split_line.begin(), split_line.end(), "\"Surface_Sensitivity\""); + + if (it == split_line.end()){ + SU2_MPI::Error("Surface sensitivity not found in file.", CURRENT_FUNCTION); + } + + unsigned short sens_index = std::distance(split_line.begin(), it); while (getline(Surface_file, text_line)) { for (icommas = 0; icommas < 50; icommas++) { @@ -13574,7 +13622,10 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { if (position!=string::npos) text_line.erase (position,1); } stringstream point_line(text_line); - point_line >> iPoint >> Sensitivity; + point_line >> iPoint; + + for (int i = 1; i <= sens_index; i++) + point_line >> Sensitivity; if (PointInDomain[iPoint]) { @@ -13603,52 +13654,24 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { ifstream restart_file; string filename = config->GetSolution_AdjFileName(); - bool sst = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); - bool sa = (config->GetKind_Turb_Model() == SA) || (config->GetKind_Turb_Model() == SA_NEG) || - (config->GetKind_Turb_Model() == SA_E) || (config->GetKind_Turb_Model() == SA_COMP) || - (config->GetKind_Turb_Model() == SA_E_COMP); - bool frozen_visc = config->GetFrozen_Visc_Disc(); - unsigned short Kind_Solver = config->GetKind_Solver(); - bool flow = ((Kind_Solver == DISC_ADJ_EULER) || - (Kind_Solver == DISC_ADJ_RANS) || - (Kind_Solver == DISC_ADJ_NAVIER_STOKES) || - (Kind_Solver == DISC_ADJ_INC_EULER) || - (Kind_Solver == DISC_ADJ_INC_RANS) || - (Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES) || - (Kind_Solver == ADJ_EULER) || - (Kind_Solver == ADJ_NAVIER_STOKES) || - (Kind_Solver == ADJ_RANS)); - su2double Sens, dull_val, AoASens; - unsigned short nExtIter, iDim; + + su2double AoASens; + unsigned short nTimeIter, iDim; unsigned long iPoint, index; string::size_type position; int counter = 0; Sensitivity = new su2double[nPoint*nDim]; - if (config->GetUnsteady_Simulation()) { - nExtIter = config->GetnExtIter(); + if (config->GetTime_Domain()) { + nTimeIter = config->GetnTime_Iter(); }else { - nExtIter = 1; + nTimeIter = 1; } if (rank == MASTER_NODE) - cout << "Reading in sensitivity at iteration " << nExtIter-1 << "."<< endl; + cout << "Reading in sensitivity at iteration " << nTimeIter-1 << "."<< endl; - unsigned short skipVar = nDim, skipMult = 1; - - if (flow) { - skipVar += skipMult*(nDim+2); - if (sst && !frozen_visc) { skipVar += skipMult*2;} - if (sa && !frozen_visc) { skipVar += skipMult*1;} - } - else if (Kind_Solver == DISC_ADJ_HEAT) { - skipVar += 1; - } - else { - cout << "WARNING: Reading in sensitivities not defined for specified solver!" << endl; - } - /*--- Read all lines in the restart file ---*/ long iPoint_Local; unsigned long iPoint_Global = 0; string text_line; @@ -13664,16 +13687,11 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { filename = config->GetSolution_AdjFileName(); filename = config->GetObjFunc_Extension(filename); - - if (config->GetUnsteady_Simulation()) { - filename = config->GetUnsteady_FileName(filename, nExtIter-1); - } - - if (config->GetnZone() > 1){ - filename = config->GetMultizone_FileName(filename, config->GetiZone()); - } + if (config->GetRead_Binary_Restart()) { + + filename = config->GetFilename(filename, ".dat", nTimeIter-1); char str_buf[CGNS_STRING_SIZE], fname[100]; unsigned short iVar; @@ -13938,6 +13956,28 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { delete [] displace; #endif + + std::vector::iterator itx = std::find(config->fields.begin(), config->fields.end(), "\"Sensitivity_x\""); + std::vector::iterator ity = std::find(config->fields.begin(), config->fields.end(), "\"Sensitivity_y\""); + std::vector::iterator itz = std::find(config->fields.begin(), config->fields.end(), "\"Sensitivity_z\""); + + if (itx == config->fields.end()){ + SU2_MPI::Error("Sensitivity x not found in file.", CURRENT_FUNCTION); + } + if (ity == config->fields.end()){ + SU2_MPI::Error("Sensitivity y not found in file.", CURRENT_FUNCTION); + } + if (nDim == 3){ + if (itz == config->fields.end()){ + SU2_MPI::Error("Sensitivity z not found in file.", CURRENT_FUNCTION); + } + } + + unsigned short sens_x_idx = std::distance(config->fields.begin(), itx); + unsigned short sens_y_idx = std::distance(config->fields.begin(), ity); + unsigned short sens_z_idx = 0; + if (nDim == 3) + sens_z_idx = std::distance(config->fields.begin(), itz); /*--- Load the data from the binary restart. ---*/ @@ -13954,9 +13994,15 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- We need to store this point's data, so jump to the correct offset in the buffer of data from the restart file and load it. ---*/ - index = counter*nFields + skipVar; - for (iDim = 0; iDim < nDim; iDim++) Sensitivity[iPoint_Local*nDim+iDim] = Restart_Data[index+iDim]; - + index = counter*nFields + sens_x_idx - 1; + Sensitivity[iPoint_Local*nDim+0] = Restart_Data[index]; + index = counter*nFields + sens_y_idx - 1; + Sensitivity[iPoint_Local*nDim+1] = Restart_Data[index]; + + if (nDim == 3){ + index = counter*nFields + sens_z_idx - 1; + Sensitivity[iPoint_Local*nDim+2] = Restart_Data[index]; + } /*--- Increment the overall counter for how many points have been loaded. ---*/ counter++; } @@ -13967,6 +14013,8 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { config->SetAoA_Sens(Restart_Meta[4]); } else { + + filename = config->GetFilename(filename, ".csv", nTimeIter-1); /*--- First, check that this is not a binary restart file. ---*/ @@ -14057,11 +14105,40 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { getline (restart_file, text_line); + vector fields = PrintingToolbox::split(text_line, ','); + + for (unsigned short iField = 0; iField < fields.size(); iField++){ + PrintingToolbox::trim(fields[iField]); + } + + std::vector::iterator itx = std::find(fields.begin(), fields.end(), "\"Sensitivity_x\""); + std::vector::iterator ity = std::find(fields.begin(), fields.end(), "\"Sensitivity_y\""); + std::vector::iterator itz = std::find(fields.begin(), fields.end(), "\"Sensitivity_z\""); + + if (itx == fields.end()){ + SU2_MPI::Error("Sensitivity x not found in file.", CURRENT_FUNCTION); + } + if (ity ==fields.end()){ + SU2_MPI::Error("Sensitivity y not found in file.", CURRENT_FUNCTION); + } + if (nDim == 3){ + if (itz == fields.end()){ + SU2_MPI::Error("Sensitivity z not found in file.", CURRENT_FUNCTION); + } + } + + unsigned short sens_x_idx = std::distance(fields.begin(), itx); + unsigned short sens_y_idx = std::distance(fields.begin(), ity); + unsigned short sens_z_idx = 0; + if (nDim == 3) + sens_z_idx = std::distance(fields.begin(), itz); + + for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++ ) { getline (restart_file, text_line); - - istringstream point_line(text_line); + + vector point_line = PrintingToolbox::split(text_line, ','); /*--- Retrieve local index. If this node from the restart file lives on the current processor, we will load and instantiate the vars. ---*/ @@ -14069,13 +14146,11 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { iPoint_Local = GetGlobal_to_Local_Point(iPoint_Global); if (iPoint_Local > -1) { - - point_line >> index; - for (iDim = 0; iDim < skipVar; iDim++) { point_line >> dull_val;} - for (iDim = 0; iDim < nDim; iDim++) { - point_line >> Sens; - Sensitivity[iPoint_Local*nDim+iDim] = Sens; - } + Sensitivity[iPoint_Local*nDim+0] = PrintingToolbox::stod(point_line[sens_x_idx]); + Sensitivity[iPoint_Local*nDim+1] = PrintingToolbox::stod(point_line[sens_y_idx]); + if (nDim == 3) + Sensitivity[iPoint_Local*nDim+2] = PrintingToolbox::stod(point_line[sens_z_idx]); + } } @@ -14918,7 +14993,7 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, /*--- Write an output file---*/ - if (config->GetOutput_FileFormat() == PARAVIEW) { + if (config->GetTabular_FileFormat() == TAB_CSV) { Wing_File.open("wing_description.csv", ios::out); if (config->GetSystemMeasurements() == US) Wing_File << "\"yCoord/SemiSpan\",\"Area (in^2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" << endl; @@ -15010,7 +15085,7 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - if (config->GetOutput_FileFormat() == PARAVIEW) { + if (config->GetTabular_FileFormat() == TAB_CSV) { Wing_File << Ycoord_Airfoil[iPlane][0]/SemiSpan <<", "<< Area[iPlane] <<", "<< MaxThickness[iPlane] <<", "<< Chord[iPlane] <<", "<< LERadius[iPlane] <<", "<< ToC[iPlane] <<", "<< Twist[iPlane] <<", "<< Curvature[iPlane] <<", "<< Dihedral[iPlane] <<", "<< LeadingEdge[iPlane][0]/SemiSpan <<", "<< LeadingEdge[iPlane][2]/SemiSpan @@ -15213,7 +15288,7 @@ void CPhysicalGeometry::Compute_Fuselage(CConfig *config, bool original_surface, /*--- Write an output file---*/ - if (config->GetOutput_FileFormat() == PARAVIEW) { + if (config->GetTabular_FileFormat() == TAB_CSV) { Fuselage_File.open("fuselage_description.csv", ios::out); if (config->GetSystemMeasurements() == US) Fuselage_File << "\"x (in)\",\"Area (in^2)\",\"Length (in)\",\"Width (in)\",\"Waterline width (in)\",\"Height (in)\",\"Curvature (1/in)\",\"Generatrix Curve X (in)\",\"Generatrix Curve Y (in)\",\"Generatrix Curve Z (in)\",\"Axis Curve X (in)\",\"Axis Curve Y (in)\",\"Axis Curve Z (in)\"" << endl; @@ -15296,7 +15371,7 @@ void CPhysicalGeometry::Compute_Fuselage(CConfig *config, bool original_surface, for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - if (config->GetOutput_FileFormat() == PARAVIEW) { + if (config->GetTabular_FileFormat() == TAB_CSV) { Fuselage_File << -Ycoord_Airfoil[iPlane][0] <<", "<< Area[iPlane] <<", "<< Length[iPlane] <<", "<< Width[iPlane] <<", "<< WaterLineWidth[iPlane] <<", "<< Height[iPlane] <<", "<< Curvature[iPlane] <<", "<< -LeadingEdge[iPlane][1] <<", "<< LeadingEdge[iPlane][0] <<", "<< LeadingEdge[iPlane][2] <<", "<< -TrailingEdge[iPlane][1] <<", "<< TrailingEdge[iPlane][0] <<", "<< TrailingEdge[iPlane][2] << endl; @@ -15524,7 +15599,7 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, /*--- Write an output file---*/ - if (config->GetOutput_FileFormat() == PARAVIEW) { + if (config->GetTabular_FileFormat() == TAB_CSV) { Nacelle_File.open("nacelle_description.csv", ios::out); if (config->GetSystemMeasurements() == US) Nacelle_File << "\"Theta (deg)\",\"Area (in^2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" << endl; @@ -15586,7 +15661,7 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, su2double theta_deg = atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2])/PI_NUMBER*180 + 180; if (Xcoord_Airfoil[iPlane].size() > 1) { - if (config->GetOutput_FileFormat() == PARAVIEW) { + if (config->GetTabular_FileFormat() == TAB_CSV) { Nacelle_File << theta_deg <<", "<< Area[iPlane] <<", "<< MaxThickness[iPlane] <<", "<< Chord[iPlane] <<", "<< LERadius[iPlane] <<", "<< ToC[iPlane] <<", "<< Twist[iPlane] <<", "<< LeadingEdge[iPlane][0] <<", "<< LeadingEdge[iPlane][2] <<", "<< TrailingEdge[iPlane][0] <<", "<< TrailingEdge[iPlane][2] << endl; @@ -17120,9 +17195,9 @@ void CMultiGridGeometry::SetGridVelocity(CConfig *config, unsigned long iter) { /*--- Compute mesh velocity with 1st or 2nd-order approximation ---*/ for (iDim = 0; iDim < nDim; iDim++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) GridVel = ( Coord_nP1[iDim] - Coord_n[iDim] ) / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) GridVel = ( 3.0*Coord_nP1[iDim] - 4.0*Coord_n[iDim] + 1.0*Coord_nM1[iDim] ) / (2.0*TimeStep); @@ -17432,6 +17507,7 @@ CDummyGeometry::CDummyGeometry(CConfig *config){ nDim = CConfig::GetnDim(config->GetMesh_FileName(), config->GetMesh_FileFormat()); + config->SetnSpanWiseSections(0); } CDummyGeometry::~CDummyGeometry(){} diff --git a/Common/src/geometry_structure_fem_part.cpp b/Common/src/geometry_structure_fem_part.cpp index c7e05d0045b0..0c3e2355f5f9 100644 --- a/Common/src/geometry_structure_fem_part.cpp +++ b/Common/src/geometry_structure_fem_part.cpp @@ -424,7 +424,7 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, string::size_type position; unsigned long nDOFsGrid_Local = 0, loc_element_count = 0; bool domain_flag = false; - bool time_spectral = config->GetUnsteady_Simulation() == HARMONIC_BALANCE; + bool time_spectral = config->GetTime_Marching() == HARMONIC_BALANCE; unsigned short nMarker_Max = config->GetnMarker_Max(); nZone = val_nZone; diff --git a/Common/src/grid_adaptation_structure.cpp b/Common/src/grid_adaptation_structure.cpp index 74c190b3e412..5efb6d9f1b78 100644 --- a/Common/src/grid_adaptation_structure.cpp +++ b/Common/src/grid_adaptation_structure.cpp @@ -123,7 +123,7 @@ void CGridAdaptation::GetFlowSolution(CGeometry *geometry, CConfig *config) { string text_line; - string mesh_filename = config->GetSolution_FlowFileName(); + string mesh_filename = config->GetSolution_FileName(); ifstream restart_file; char *cstr = new char [mesh_filename.size()+1]; @@ -160,7 +160,7 @@ void CGridAdaptation::GetFlowResidual(CGeometry *geometry, CConfig *config) { su2double dummy; string text_line; - string mesh_filename = config->GetSolution_FlowFileName(); + string mesh_filename = config->GetSolution_FileName(); ifstream restart_file; char *cstr = new char [mesh_filename.size()+1]; diff --git a/Common/src/grid_movement_structure.cpp b/Common/src/grid_movement_structure.cpp index 2adb86203694..067e19a385be 100644 --- a/Common/src/grid_movement_structure.cpp +++ b/Common/src/grid_movement_structure.cpp @@ -1903,7 +1903,7 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, su2double rotMatrix[3][3] = {{0.0,0.0,0.0}, {0.0,0.0,0.0}, {0.0,0.0,0.0}}; su2double dtheta, dphi, dpsi, cosTheta, sinTheta; su2double cosPhi, sinPhi, cosPsi, sinPsi; - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); @@ -1915,7 +1915,7 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, /*--- For the unsteady adjoint, use reverse time ---*/ if (adjoint) { /*--- Set the first adjoint mesh position to the final direct one ---*/ - if (iter == 0) dt = ((su2double)config->GetnExtIter()-1)*dt; + if (iter == 0) dt = ((su2double)config->GetnTime_Iter()-1)*dt; /*--- Reverse the rotation direction for the adjoint ---*/ else dt = -1.0*dt; } else { @@ -2066,7 +2066,7 @@ void CVolumetricMovement::Rigid_Pitching(CGeometry *geometry, CConfig *config, u unsigned short iDim; unsigned short nDim = geometry->GetnDim(); unsigned long iPoint; - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); @@ -2095,7 +2095,7 @@ void CVolumetricMovement::Rigid_Pitching(CGeometry *geometry, CConfig *config, u if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnExtIter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; time_new = static_cast(directIter)*deltaT; time_old = time_new; @@ -2213,7 +2213,7 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u su2double deltaT, time_new, time_old; unsigned short iDim, nDim = geometry->GetnDim(); unsigned long iPoint; - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); @@ -2240,7 +2240,7 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnExtIter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; time_new = static_cast(directIter)*deltaT; time_old = time_new; @@ -2345,7 +2345,7 @@ void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config su2double deltaT, time_new, time_old; unsigned short iDim, nDim = geometry->GetnDim(); unsigned long iPoint; - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); @@ -2370,7 +2370,7 @@ void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnExtIter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; time_new = static_cast(directIter)*deltaT; time_old = time_new; @@ -2712,23 +2712,28 @@ void CSurfaceMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *conf /*--- Output original FFD FFDBox ---*/ if (rank == MASTER_NODE) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { - cout << "Writing a Paraview file of the FFD boxes." << endl; - FFDBox[iFFDBox]->SetParaview(geometry, iFFDBox, true); - } - else if (config->GetOutput_FileFormat() == TECPLOT ) { - cout << "Writing a Tecplot file of the FFD boxes." << endl; - FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, true); - } - else { - cout << "Writing a CGNS file of the FFD boxes." << endl; - FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, true); + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + unsigned short *FileFormat = config->GetVolumeOutputFiles(); + if (FileFormat[iFile] == PARAVIEW) { + cout << "Writing a Paraview file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetParaview(geometry, iFFDBox, true); + } + } else if (FileFormat[iFile] == TECPLOT) { + cout << "Writing a Tecplot file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, true); + } + } + else if (FileFormat[iFile] == CGNS) { + cout << "Writing a CGNS file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, true); + } + } } - } - + } } - } else { @@ -2790,23 +2795,27 @@ void CSurfaceMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *conf /*--- Output original FFD FFDBox ---*/ - if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_DOT)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { - cout << "Writing a Paraview file of the FFD boxes." << endl; - for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - FFDBox[iFFDBox]->SetParaview(geometry, iFFDBox, true); - } - } - else if (config->GetOutput_FileFormat() == TECPLOT) { - cout << "Writing a Tecplot file of the FFD boxes." << endl; - for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, true); + if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_DOT)) { + + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + unsigned short *FileFormat = config->GetVolumeOutputFiles(); + + if (FileFormat[iFile] == PARAVIEW) { + cout << "Writing a Paraview file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetParaview(geometry, iFFDBox, true); + } + } else if (FileFormat[iFile] == TECPLOT) { + cout << "Writing a Tecplot file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, true); + } } - } - else { - cout << "Writing a CGNS file of the FFD boxes." << endl; - for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, true); + else if (FileFormat[iFile] == CGNS) { + cout << "Writing a CGNS file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, true); + } } } } @@ -2966,26 +2975,29 @@ void CSurfaceMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *conf /*--- Output the deformed FFD Boxes ---*/ if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_DOT)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { - cout << "Writing a Paraview file of the FFD boxes." << endl; - for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - FFDBox[iFFDBox]->SetParaview(geometry, iFFDBox, false); - } - } - else if (config->GetOutput_FileFormat() == TECPLOT) { - cout << "Writing a Tecplot file of the FFD boxes." << endl; - for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, false); + + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + unsigned short *FileFormat = config->GetVolumeOutputFiles(); + + if (FileFormat[iFile] == PARAVIEW) { + cout << "Writing a Paraview file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetParaview(geometry, iFFDBox, false); + } + } else if (FileFormat[iFile] == TECPLOT) { + cout << "Writing a Tecplot file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, false); + } } - } - else { - cout << "Writing a CGNS file of the FFD boxes." << endl; - for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, false); + else if (FileFormat[iFile] == CGNS) { + cout << "Writing a CGNS file of the FFD boxes." << endl; + for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { + FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, false); + } } } } - } } @@ -6263,7 +6275,7 @@ void CSurfaceMovement::Surface_Rotating(CGeometry *geometry, CConfig *config, } } -void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long ExtIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements) { +void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long TimeIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements) { /* The sign conventions of these are those of the Typical Section Wing Model, below the signs are corrected */ su2double dh = -displacements[0]; // relative plunge @@ -6283,7 +6295,7 @@ void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, u su2double Omega, dt, psi; dt = config->GetDelta_UnstTimeND(); Omega = (config->GetRotation_Rate(3)/config->GetOmega_Ref()); - psi = Omega*(dt*ExtIter); + psi = Omega*(dt*TimeIter); /*--- Correct for the airfoil starting position (This is hardcoded in here) ---*/ if (Monitoring_Tag == "Airfoil1") { @@ -6370,7 +6382,7 @@ void CSurfaceMovement::SetBoundary_Flutter3D(CGeometry *geometry, CConfig *confi /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnExtIter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; time_new = static_cast(directIter)*deltaT; time_old = time_new; @@ -6442,7 +6454,7 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con char buffer[50]; string DV_Filename, UnstExt, text_line; ifstream surface_positions; - bool unsteady = config->GetUnsteady_Simulation(); + bool unsteady = config->GetTime_Marching(); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Load stuff from config ---*/ @@ -6456,7 +6468,7 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnExtIter() - 1; + unsigned long nFlowIter = config->GetnTime_Iter() - 1; flowIter = nFlowIter - iter; unsigned short lastindex = DV_Filename.find_last_of("."); DV_Filename = DV_Filename.substr(0, lastindex); @@ -6545,7 +6557,7 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con /*--- For the unsteady adjoint, use reverse time ---*/ if (adjoint) { /*--- Set the first adjoint mesh position to the final direct one ---*/ - if (iter == 0) dt = ((su2double)config->GetnExtIter()-1) * dt; + if (iter == 0) dt = ((su2double)config->GetnTime_Iter()-1) * dt; /*--- Reverse the rotation direction for the adjoint ---*/ else dt = -1.0*dt; } else { @@ -7838,6 +7850,12 @@ void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeomet /*--- Read the name of the output file ---*/ str = config[ZONE_0]->GetMesh_Out_FileName(); + + unsigned short lastindex = str.find_last_of("."); + str = str.substr(0, lastindex); + + str += ".su2"; + strcpy (mesh_file, str.c_str()); strcpy (cstr, mesh_file); diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index 19cd6b605e65..e99f62a46cdf 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -44,6 +44,7 @@ CSysSolve::CSysSolve(const bool mesh_deform_mode) : cg_ready(false), mesh_deform = mesh_deform_mode; LinSysRes_ptr = NULL; LinSysSol_ptr = NULL; + Residual = 0.0; } template @@ -489,7 +490,7 @@ unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector::BCGSTAB_LinSolver(const CSysVectorGetUnsteady_Simulation() != TIME_STEPPING) && - (config->GetUnsteady_Simulation() != DT_STEPPING_1ST) && - (config->GetUnsteady_Simulation() != DT_STEPPING_2ND)) + if((config->GetTime_Marching() != TIME_STEPPING) && + (config->GetTime_Marching() != DT_STEPPING_1ST) && + (config->GetTime_Marching() != DT_STEPPING_2ND)) SU2_MPI::Error("Unsteady mode must be selected for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp index 6a5136d881cb..11e35e48f69e 100644 --- a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp +++ b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp @@ -71,9 +71,9 @@ CInviscidVortexSolution::CInviscidVortexSolution(unsigned short val_nDim, gamOvGm1 = ovGm1*Gamma; /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetUnsteady_Simulation() != TIME_STEPPING) && - (config->GetUnsteady_Simulation() != DT_STEPPING_1ST) && - (config->GetUnsteady_Simulation() != DT_STEPPING_2ND)) + if((config->GetTime_Marching() != TIME_STEPPING) && + (config->GetTime_Marching() != DT_STEPPING_1ST) && + (config->GetTime_Marching() != DT_STEPPING_2ND)) SU2_MPI::Error("Unsteady mode must be selected for the inviscid vortex", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp index 19df6207057e..b7d1fb4b465f 100644 --- a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp @@ -71,7 +71,7 @@ CMMSIncEulerSolution::CMMSIncEulerSolution(unsigned short val_nDim, epsilon = 0.001; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the MMS incompressible Euler case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp index 762208dfb546..c60ea393e693 100644 --- a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp @@ -72,7 +72,7 @@ CMMSIncNSSolution::CMMSIncNSSolution(unsigned short val_nDim, epsilon = 0.001; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the MMS incompressible NS case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp index 0a691dd6ab25..cebfa3bd8bef 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp @@ -89,7 +89,7 @@ CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(unsigned short val_nD a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the MMS NS Two Half Circles case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp index 827cfb790cbd..72be6be29833 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp @@ -94,7 +94,7 @@ CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution(unsigned short val_nD SU2_MPI::Error("Grid must be 3D for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp index bcc77e882b7f..b3bee18b42d6 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp @@ -98,7 +98,7 @@ CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution(unsigned short val_nDim, v_y = 4.0; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp index 5f5a517bb631..dc94d1525626 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp @@ -91,7 +91,7 @@ CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(unsigned short val_nD a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp index 103667f6f015..2e64ad54dfd7 100644 --- a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp @@ -64,7 +64,7 @@ CNSUnitQuadSolution::CNSUnitQuadSolution(unsigned short val_nDim, Viscosity = config->GetMu_ConstantND(); /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the NS Unit Quad case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CRinglebSolution.cpp b/Common/src/toolboxes/MMS/CRinglebSolution.cpp index 77f53bdcabb5..e52728710b36 100644 --- a/Common/src/toolboxes/MMS/CRinglebSolution.cpp +++ b/Common/src/toolboxes/MMS/CRinglebSolution.cpp @@ -61,7 +61,7 @@ CRinglebSolution::CRinglebSolution(unsigned short val_nDim, tGamOvGm1 = Gamma*tovGm1; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetUnsteady_Simulation() != STEADY) + if(config->GetTime_Marching() != STEADY) SU2_MPI::Error("Steady mode must be selected for the Ringleb case", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/MMS/CTGVSolution.cpp b/Common/src/toolboxes/MMS/CTGVSolution.cpp index 7ade895e3c40..bdaa7e9e089e 100644 --- a/Common/src/toolboxes/MMS/CTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CTGVSolution.cpp @@ -68,9 +68,9 @@ CTGVSolution::CTGVSolution(unsigned short val_nDim, /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetUnsteady_Simulation() != TIME_STEPPING) && - (config->GetUnsteady_Simulation() != DT_STEPPING_1ST) && - (config->GetUnsteady_Simulation() != DT_STEPPING_2ND)) + if((config->GetTime_Marching() != TIME_STEPPING) && + (config->GetTime_Marching() != DT_STEPPING_1ST) && + (config->GetTime_Marching() != DT_STEPPING_2ND)) SU2_MPI::Error("Unsteady mode must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); diff --git a/Common/src/toolboxes/printing_toolbox.cpp b/Common/src/toolboxes/printing_toolbox.cpp index eb5775f0e37d..69527d734359 100644 --- a/Common/src/toolboxes/printing_toolbox.cpp +++ b/Common/src/toolboxes/printing_toolbox.cpp @@ -12,6 +12,8 @@ PrintingToolbox::CTablePrinter::CTablePrinter(std::ostream * output, const std:: print_header_bottom_line_ = true; print_header_top_line_ = true; align_ = RIGHT; + inner_separator_ = separator; + precision_ = 6; } PrintingToolbox::CTablePrinter::~CTablePrinter(){ @@ -30,6 +32,10 @@ void PrintingToolbox::CTablePrinter::SetSeparator(const std::string &separator){ separator_ = separator; } +void PrintingToolbox::CTablePrinter::SetInnerSeparator(const std::string &inner_separator){ + inner_separator_ = inner_separator; +} + void PrintingToolbox::CTablePrinter::SetPrintHeaderBottomLine(bool print){ print_header_bottom_line_ = print; } @@ -42,6 +48,11 @@ void PrintingToolbox::CTablePrinter::SetAlign(int align){ align_ = align; } +void PrintingToolbox::CTablePrinter::SetPrecision(int precision){ + precision_ = precision; + out_stream_->precision(precision_); +} + void PrintingToolbox::CTablePrinter::AddColumn(const std::string & header_name, int column_width){ if (column_width < 4){ throw std::invalid_argument("Column size has to be >= 4"); @@ -67,7 +78,7 @@ void PrintingToolbox::CTablePrinter::PrintHeader(){ if (print_header_top_line_) PrintHorizontalLine(); - *out_stream_ << "|"; + *out_stream_ << separator_; int indent = 0; for (int i=0; i &data){ + su2double avg = 0.0; + for (std::vector::iterator it = data.begin(); it != data.end(); it++){ + avg += (*it); + } + return avg/=data.size(); +} diff --git a/QuickStart/inv_NACA0012.cfg b/QuickStart/inv_NACA0012.cfg index 156d0c707d86..3d160fc0136f 100644 --- a/QuickStart/inv_NACA0012.cfg +++ b/QuickStart/inv_NACA0012.cfg @@ -21,7 +21,7 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO - +SCREEN_OUTPUT=(INNER_ITER, WALL_TIME, RMS_DENSITY, LIFT, DRAG, CAUCHY_SENS_PRESS, CAUCHY_DRAG) % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -98,7 +98,7 @@ OBJECTIVE_FUNCTION= DRAG CFL_NUMBER= 4.0 % % Number of total iterations -EXT_ITER= 250 +ITER= 250 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -240,26 +240,19 @@ VISUALIZE_VOLUME_DEF= NO % --------------------------- CONVERGENCE PARAMETERS --------------------------% % Convergence criteria (CAUCHY, RESIDUAL) % -CONV_CRITERIA= CAUCHY -% -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 +CONV_FIELD= RMS_DENSITY % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 -% -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG +CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -272,25 +265,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -299,7 +292,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -343,5 +336,6 @@ OPT_OBJECTIVE= DRAG * 0.001 % ex= (Objective = Value ) * Scale, use '>','<','=' OPT_CONSTRAINT= ( LIFT > 0.328188 ) * 0.001; ( MOMENT_Z > 0.034068 ) * 0.001; ( AIRFOIL_THICKNESS > 0.11 ) * 0.001 % + % Optimization design variables, separated by semicolons -DEFINITION_DV= ( 1, 1.0 | airfoil | 0, 0.05 ); ( 1, 1.0 | airfoil | 0, 0.10 ); ( 1, 1.0 | airfoil | 0, 0.15 ); ( 1, 1.0 | airfoil | 0, 0.20 ); ( 1, 1.0 | airfoil | 0, 0.25 ); ( 1, 1.0 | airfoil | 0, 0.30 ); ( 1, 1.0 | airfoil | 0, 0.35 ); ( 1, 1.0 | airfoil | 0, 0.40 ); ( 1, 1.0 | airfoil | 0, 0.45 ); ( 1, 1.0 | airfoil | 0, 0.50 ); ( 1, 1.0 | airfoil | 0, 0.55 ); ( 1, 1.0 | airfoil | 0, 0.60 ); ( 1, 1.0 | airfoil | 0, 0.65 ); ( 1, 1.0 | airfoil | 0, 0.70 ); ( 1, 1.0 | airfoil | 0, 0.75 ); ( 1, 1.0 | airfoil | 0, 0.80 ); ( 1, 1.0 | airfoil | 0, 0.85 ); ( 1, 1.0 | airfoil | 0, 0.90 ); ( 1, 1.0 | airfoil | 0, 0.95 ); ( 1, 1.0 | airfoil | 1, 0.05 ); ( 1, 1.0 | airfoil | 1, 0.10 ); ( 1, 1.0 | airfoil | 1, 0.15 ); ( 1, 1.0 | airfoil | 1, 0.20 ); ( 1, 1.0 | airfoil | 1, 0.25 ); ( 1, 1.0 | airfoil | 1, 0.30 ); ( 1, 1.0 | airfoil | 1, 0.35 ); ( 1, 1.0 | airfoil | 1, 0.40 ); ( 1, 1.0 | airfoil | 1, 0.45 ); ( 1, 1.0 | airfoil | 1, 0.50 ); ( 1, 1.0 | airfoil | 1, 0.55 ); ( 1, 1.0 | airfoil | 1, 0.60 ); ( 1, 1.0 | airfoil | 1, 0.65 ); ( 1, 1.0 | airfoil | 1, 0.70 ); ( 1, 1.0 | airfoil | 1, 0.75 ); ( 1, 1.0 | airfoil | 1, 0.80 ); ( 1, 1.0 | airfoil | 1, 0.85 ); ( 1, 1.0 | airfoil | 1, 0.90 ); ( 1, 1.0 | airfoil | 1, 0.95 ) +DEFINITION_DV= ( 30, 1.0 | airfoil | 0, 0.05 ); ( 30, 1.0 | airfoil | 0, 0.10 ); ( 30, 1.0 | airfoil | 0, 0.15 ); ( 30, 1.0 | airfoil | 0, 0.20 ); ( 30, 1.0 | airfoil | 0, 0.25 ); ( 30, 1.0 | airfoil | 0, 0.30 ); ( 30, 1.0 | airfoil | 0, 0.35 ); ( 30, 1.0 | airfoil | 0, 0.40 ); ( 30, 1.0 | airfoil | 0, 0.45 ); ( 30, 1.0 | airfoil | 0, 0.50 ); ( 30, 1.0 | airfoil | 0, 0.55 ); ( 30, 1.0 | airfoil | 0, 0.60 ); ( 30, 1.0 | airfoil | 0, 0.65 ); ( 30, 1.0 | airfoil | 0, 0.70 ); ( 30, 1.0 | airfoil | 0, 0.75 ); ( 30, 1.0 | airfoil | 0, 0.80 ); ( 30, 1.0 | airfoil | 0, 0.85 ); ( 30, 1.0 | airfoil | 0, 0.90 ); ( 30, 1.0 | airfoil | 0, 0.95 ); ( 30, 1.0 | airfoil | 1, 0.05 ); ( 30, 1.0 | airfoil | 1, 0.10 ); ( 30, 1.0 | airfoil | 1, 0.15 ); ( 30, 1.0 | airfoil | 1, 0.20 ); ( 30, 1.0 | airfoil | 1, 0.25 ); ( 30, 1.0 | airfoil | 1, 0.30 ); ( 30, 1.0 | airfoil | 1, 0.35 ); ( 30, 1.0 | airfoil | 1, 0.40 ); ( 30, 1.0 | airfoil | 1, 0.45 ); ( 30, 1.0 | airfoil | 1, 0.50 ); ( 30, 1.0 | airfoil | 1, 0.55 ); ( 30, 1.0 | airfoil | 1, 0.60 ); ( 30, 1.0 | airfoil | 1, 0.65 ); ( 30, 1.0 | airfoil | 1, 0.70 ); ( 30, 1.0 | airfoil | 1, 0.75 ); ( 30, 1.0 | airfoil | 1, 0.80 ); ( 30, 1.0 | airfoil | 1, 0.85 ); ( 30, 1.0 | airfoil | 1, 0.90 ); ( 30, 1.0 | airfoil | 1, 0.95 ) diff --git a/SU2_CFD/include/SU2_CFD.hpp b/SU2_CFD/include/SU2_CFD.hpp index 58da93d28758..5925bd6bf722 100644 --- a/SU2_CFD/include/SU2_CFD.hpp +++ b/SU2_CFD/include/SU2_CFD.hpp @@ -50,7 +50,7 @@ #include "drivers/CDummyDriver.hpp" #include "solver_structure.hpp" #include "integration_structure.hpp" -#include "output_structure.hpp" +#include "output/COutput.hpp" #include "numerics_structure.hpp" #include "../../Common/include/fem_geometry_structure.hpp" #include "../../Common/include/geometry_structure.hpp" diff --git a/SU2_CFD/include/definition_structure.hpp b/SU2_CFD/include/definition_structure.hpp index 12fcb876ed00..6c96cc27674f 100644 --- a/SU2_CFD/include/definition_structure.hpp +++ b/SU2_CFD/include/definition_structure.hpp @@ -42,19 +42,9 @@ #include -#include "../../Common/include/gauss_structure.hpp" -#include "../../Common/include/element_structure.hpp" -#include "drivers/CDriver.hpp" -#include "iteration_structure.hpp" -#include "solver_structure.hpp" -#include "integration_structure.hpp" -#include "output_structure.hpp" -#include "numerics_structure.hpp" -#include "../../Common/include/fem_geometry_structure.hpp" -#include "../../Common/include/geometry_structure.hpp" #include "../../Common/include/config_structure.hpp" -#include "../../Common/include/interpolation_structure.hpp" - +#include "../../Common/include/geometry_structure.hpp" +#include "../../Common/include/fem_geometry_structure.hpp" using namespace std; diff --git a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp index 3cb1c038952a..00071ffe5ae2 100644 --- a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp @@ -60,9 +60,11 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { CIntegration **integration; /*!< \brief Container vector with all the integration methods. */ CGeometry *geometry; /*!< \brief Geometrical definition of the problem. */ CSolver **solver; /*!< \brief Container vector with all the solutions. */ + COutput *direct_output; CNumerics ***numerics; /*!< \brief Container vector with all the numerics. */ - - + + COutputLegacy* output_legacy; + public: /*! diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index b1832879bede..e77961bbb260 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -38,11 +38,11 @@ #pragma once -#include "../../../Common/include/mpi_structure.hpp" +#include "../../Common/include/mpi_structure.hpp" #include "../iteration_structure.hpp" #include "../solver_structure.hpp" #include "../integration_structure.hpp" -#include "../output_structure.hpp" + #include "../numerics_structure.hpp" /*--- Transfer includes ---*/ #include "../interfaces/CInterface.hpp" @@ -63,6 +63,20 @@ #include "../../../Common/include/config_structure.hpp" #include "../../../Common/include/interpolation_structure.hpp" +#include "../output/COutputLegacy.hpp" + +#include "../output/COutput.hpp" +#include "../output/CMultizoneOutput.hpp" +#include "../output/CElasticityOutput.hpp" +#include "../output/CAdjElasticityOutput.hpp" +#include "../output/CFlowCompOutput.hpp" +#include "../output/CAdjFlowOutput.hpp" +#include "../output/CFlowCompFEMOutput.hpp" +#include "../output/CFlowIncOutput.hpp" +#include "../output/CAdjFlowIncOutput.hpp" +#include "../output/CHeatOutput.hpp" +#include "../output/CAdjHeatOutput.hpp" + using namespace std; /*! @@ -90,7 +104,7 @@ class CDriver { su2double MpointsDomain; /*!< \brief Total number of grid points in millions in the calculation (excluding ghost points).*/ su2double MDOFs; /*!< \brief Total number of DOFs in millions in the calculation (including ghost points).*/ su2double MDOFsDomain; /*!< \brief Total number of DOFs in millions in the calculation (excluding ghost points).*/ - unsigned long ExtIter; /*!< \brief External iteration.*/ + unsigned long TimeIter; /*!< \brief External iteration.*/ ofstream **ConvHist_file; /*!< \brief Convergence history file.*/ ofstream FSIHist_file; /*!< \brief FSI convergence history file.*/ unsigned short iMesh, /*!< \brief Iterator on mesh levels.*/ @@ -105,13 +119,14 @@ class CDriver { fsi, /*!< \brief FSI simulation flag.*/ fem_solver; /*!< \brief FEM fluid solver simulation flag. */ CIteration ***iteration_container; /*!< \brief Container vector with all the iteration methods. */ - COutput *output; /*!< \brief Pointer to the COutput class. */ + COutput **output_container; /*!< \brief Pointer to the COutput class. */ CIntegration ****integration_container; /*!< \brief Container vector with all the integration methods. */ CGeometry ****geometry_container; /*!< \brief Geometrical definition of the problem. */ CSolver *****solver_container; /*!< \brief Container vector with all the solutions. */ CNumerics ******numerics_container; /*!< \brief Description of the numerical method (the way in which the equations are solved). */ CConfig **config_container; /*!< \brief Definition of the particular problem. */ CConfig *driver_config; /*!< \brief Definition of the driver configuration. */ + COutput *driver_output; /*!< \brief Definition of the driver output. */ CSurfaceMovement **surface_movement; /*!< \brief Surface movement classes of the problem. */ CVolumetricMovement ***grid_movement; /*!< \brief Volume grid movement classes of the problem. */ CFreeFormDefBox*** FFDBox; /*!< \brief FFD FFDBoxes of the problem. */ @@ -262,6 +277,11 @@ class CDriver { */ void PythonInterface_Preprocessing(CConfig** config, CGeometry**** geometry, CSolver***** solver); + /*! + * \brief Preprocess the output container. + */ + void Output_Preprocessing(CConfig **config, CConfig *driver_config, COutput **&output_container, COutput *&driver_output); + /*! * \brief Initiate value for static mesh movement such as the gridVel for the ROTATING frame. */ @@ -274,35 +294,33 @@ class CDriver { CInterface*** interface); - void Output_Preprocessing(CConfig **config, COutput *&output); - /*! * \brief A virtual member. * \param[in] donorZone - zone in which the displacements will be predicted. * \param[in] targetZone - zone which receives the predicted displacements. */ - virtual void Predict_Displacements(unsigned short donorZone, unsigned short targetZone) {}; + virtual void Predict_Displacements(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. * \param[in] donorZone - zone in which the tractions will be predicted. * \param[in] targetZone - zone which receives the predicted traction. */ - virtual void Predict_Tractions(unsigned short donorZone, unsigned short targetZone) {}; + virtual void Predict_Tractions(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. * \param[in] donorZone - zone in which the displacements will be transferred. * \param[in] targetZone - zone which receives the tractions transferred. */ - virtual void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) {}; + virtual void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. * \param[in] donorZone - zone from which the tractions will be transferred. * \param[in] targetZone - zone which receives the tractions transferred. */ - virtual void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) {}; + virtual void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. @@ -310,7 +328,7 @@ class CDriver { * \param[in] targetZone - destination of the information. * \param[in] iOuterIter - Fluid-Structure Interaction subiteration. */ - virtual void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {}; + virtual void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} /*! * \brief A virtual member. @@ -318,29 +336,29 @@ class CDriver { * \param[in] targetZone - destination of the information. * \param[in] iOuterIter - Fluid-Structure Interaction subiteration. */ - virtual void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {}; + virtual void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} /*! * \brief A virtual member to run a Block Gauss-Seidel iteration in multizone problems. */ - virtual void Run_GaussSeidel(){}; + virtual void Run_GaussSeidel(){} /*! * \brief A virtual member to run a Block-Jacobi iteration in multizone problems. */ - virtual void Run_Jacobi(){}; + virtual void Run_Jacobi(){} /*! * \brief A virtual member. */ - virtual void Update() {}; + virtual void Update() {} public: /*! * \brief Launch the computation for all zones and all physics. */ - virtual void StartSolver(); + virtual void StartSolver() {} /*! * \brief Deallocation routine @@ -355,42 +373,42 @@ class CDriver { /*! * \brief Perform some pre-processing before an iteration of the physics. */ - void PreprocessExtIter(unsigned long ExtIter); + virtual void Preprocess(unsigned long TimeIter){ } /*! * \brief Monitor the computation. */ - virtual bool Monitor(unsigned long ExtIter); + virtual bool Monitor(unsigned long TimeIter){ return false; } /*! * \brief Output the solution in solution file. */ - void Output(unsigned long ExtIter); + virtual void Output(unsigned long TimeIter){ } /*! * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. */ - virtual void DynamicMeshUpdate(unsigned long ExtIter) { }; + virtual void DynamicMeshUpdate(unsigned long TimeIter) { } /*! * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. */ - virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long ExtIter) { }; + virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) { } /*! * \brief Perform a static mesh deformation, without considering grid velocity. */ - virtual void StaticMeshUpdate() { }; + virtual void StaticMeshUpdate() { } /*! * \brief Perform a mesh deformation as initial condition. */ - virtual void SetInitialMesh() { }; + virtual void SetInitialMesh() { } /*! * \brief Process the boundary conditions and update the multigrid structure. */ - virtual void BoundaryConditionsUpdate() { }; + virtual void BoundaryConditionsUpdate() { } /*! * \brief Get the total drag. @@ -466,13 +484,13 @@ class CDriver { * \brief Get the number of external iterations. * \return Number of external iterations. */ - unsigned long GetnExtIter(); + unsigned long GetnTimeIter(); /*! * \brief Get the current external iteration. * \return Current external iteration. */ - unsigned long GetExtIter(); + unsigned long GetTime_Iter(); /*! * \brief Get the unsteady time step. @@ -852,6 +870,10 @@ class CDriver { * \author T. Economon, G. Gori */ class CFluidDriver : public CDriver { + +protected: + unsigned long Max_Iter; + public: /*! @@ -869,6 +891,11 @@ class CFluidDriver : public CDriver { * \brief Destructor of the class. */ ~CFluidDriver(void); + + /*! + * \brief Launch the computation for all zones and all physics. + */ + void StartSolver(); /*! * \brief Run a single iteration of the physics within multiple zones. @@ -879,11 +906,26 @@ class CFluidDriver : public CDriver { * \brief Update the dual-time solution within multiple zones. */ void Update(); + + /*! + * \brief Output the solution in solution file. + */ + void Output(unsigned long InnerIter); + + /*! + * \brief Monitor the computation. + */ + bool Monitor(unsigned long ExtIter); + + /*! + * \brief Perform some pre-processing before an iteration of the physics. + */ + void Preprocess(unsigned long Iter); /*! * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure (multiple zone). */ - void DynamicMeshUpdate(unsigned long ExtIter); + void DynamicMeshUpdate(unsigned long TimeIter); /*! * \brief Perform a static mesh deformation, without considering grid velocity (multiple zone). @@ -948,6 +990,9 @@ class CFluidDriver : public CDriver { * \author S. Vitale */ class CTurbomachineryDriver : public CFluidDriver { +private: + COutputLegacy* output_legacy; + public: /*! @@ -986,7 +1031,7 @@ class CTurbomachineryDriver : public CFluidDriver { /*! * \brief Monitor the computation. */ - bool Monitor(unsigned long ExtIter); + bool Monitor(unsigned long TimeIter); @@ -997,10 +1042,10 @@ class CTurbomachineryDriver : public CFluidDriver { * \brief Class for driving an iteration of Harmonic Balance (HB) method problem using multiple time zones. * \author T. Economon */ -class CHBDriver : public CDriver { +class CHBDriver : public CFluidDriver { private: - + COutputLegacy* output_legacy; unsigned short nInstHB; su2double **D; /*!< \brief Harmonic Balance operator. */ @@ -1057,112 +1102,6 @@ class CHBDriver : public CDriver { void ResetConvergence(); }; - -/*! - * \class CFSIDriver - * \brief Class for driving a BGS iteration for a fluid-structure interaction problem in multiple zones. - * \author R. Sanchez. - */ -class CFSIDriver : public CDriver { - - su2double *init_res_flow, /*!< \brief Stores the initial residual for the flow. */ - *init_res_struct, /*!< \brief Stores the initial residual for the structure. */ - *residual_flow, /*!< \brief Stores the current residual for the flow. */ - *residual_struct, /*!< \brief Stores the current residual for the structure. */ - *residual_flow_rel, - *residual_struct_rel; - - su2double flow_criteria, - flow_criteria_rel, - structure_criteria, - structure_criteria_rel; - -public: - - /*! - * \brief Constructor of the class. - * \param[in] confFile - Configuration file name. - * \param[in] val_nZone - Total number of zones. - * \param[in] MPICommunicator - MPI communicator for SU2. - */ - CFSIDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); - - /*! - * \brief Destructor of the class. - */ - ~CFSIDriver(void); - - /*! - * \brief Run a Block Gauss-Seidel iteration of the FSI problem. - */ - void Run(); - - /*! - * \brief Predict the structural displacements to pass them into the fluid solver on a BGS implementation. - * \param[in] donorZone - zone in which the displacements will be predicted. - * \param[in] targetZone - zone which receives the predicted displacements. - */ - void Predict_Displacements(unsigned short donorZone, unsigned short targetZone); - - /*! - * \brief Predict the fluid tractions to pass them into the structural solver on a BGS implementation. - * \param[in] donorZone - zone in which the tractions will be predicted. - * \param[in] targetZone - zone which receives the predicted traction. - */ - void Predict_Tractions(unsigned short donorZone, unsigned short targetZone); - - /*! - * \brief Transfer the displacements computed on the structural solver into the fluid solver. - * \param[in] donorZone - zone in which the displacements will be transferred. - * \param[in] targetZone - zone which receives the tractions transferred. - */ - void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone); - - /*! - * \brief Transfer the tractions computed on the fluid solver into the structural solver. - * \param[in] donorZone - zone from which the tractions will be transferred. - * \param[in] targetZone - zone which receives the tractions transferred. - */ - void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone); - - /*! - * \brief Apply a relaxation method into the computed displacements. - * \param[in] donorZone - origin of the information. - * \param[in] targetZone - destination of the information. - * \param[in] iOuterIter - Fluid-Structure Interaction subiteration. - */ - void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter); - - /*! - * \brief Apply a relaxation method into the computed tractions. - * \param[in] donorZone - origin of the information. - * \param[in] targetZone - destination of the information. - * \param[in] iOuterIter - Fluid-Structure Interaction subiteration. - */ - void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter); - - /*! - * \brief Check the convergence of BGS subiteration process - * \param[in] ZONE_FLOW - zone of the fluid solver. - * \param[in] ZONE_STRUCT - zone of the structural solver. - * \param[in] kind_recording - kind of recording (flow, structure, mesh, cross terms) - */ - bool BGSConvergence(unsigned long IntIter, unsigned short ZONE_FLOW, unsigned short ZONE_STRUCT); - - /*! - * \brief Enforce the coupling condition at the end of the time step - */ - void Update(void); - - /*! - * \brief Overload, does nothing but avoids dynamic mesh updates in FSI problems before the iteration - */ - void DynamicMeshUpdate(unsigned long ExtIter); - -}; - /*! * \class CDiscAdjFSIDriver * \brief Overload: Class for driving a discrete adjoint FSI iteration. @@ -1170,7 +1109,8 @@ class CFSIDriver : public CDriver { * \version 6.2.0 "Falcon" */ class CDiscAdjFSIDriver : public CDriver { - + + COutputLegacy* output_legacy; CIteration** direct_iteration; unsigned short RecordingState; unsigned short CurrentRecording; /*!< \brief Stores the current status of the recording. */ @@ -1411,7 +1351,7 @@ class CDiscAdjFSIDriver : public CDriver { /*! * \brief Overload, does nothing but avoids dynamic mesh updates in adjoint FSI problems before the iteration */ - void DynamicMeshUpdate(unsigned long ExtIter); + void DynamicMeshUpdate(unsigned long TimeIter); /*! * \brief Transfer the displacements computed on the structural solver into the fluid solver. diff --git a/SU2_CFD/include/drivers/CMultizoneDriver.hpp b/SU2_CFD/include/drivers/CMultizoneDriver.hpp index 02a8eb364ad6..5be1d0e9601f 100644 --- a/SU2_CFD/include/drivers/CMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CMultizoneDriver.hpp @@ -126,17 +126,19 @@ class CMultizoneDriver : public CDriver { /*! * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure (multiple zone). */ - void DynamicMeshUpdate(unsigned long ExtIter); + void DynamicMeshUpdate(unsigned long TimeIter); /*! * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. */ - void DynamicMeshUpdate(unsigned short val_iZone, unsigned long ExtIter); + void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter); /*! * \brief Routine to provide all the desired physical transfers between the different zones during one iteration. * \return Boolean that determines whether the mesh needs to be updated for this particular transfer */ bool Transfer_Data(unsigned short donorZone, unsigned short targetZone); + + bool Monitor(unsigned long TimeIter); -}; \ No newline at end of file +}; diff --git a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp index 90d856906fb9..298b74f875ea 100644 --- a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp @@ -95,12 +95,22 @@ class CSinglezoneDriver : public CDriver { /*! * \brief Output the solution in solution file. */ - void Output(unsigned long ExtIter); + void Output(unsigned long TimeIter); /*! * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure. */ - void DynamicMeshUpdate(unsigned long ExtIter); + void DynamicMeshUpdate(unsigned long TimeIter); + /*! + * \brief Monitor + * \param ExtIter + */ + virtual bool Monitor(unsigned long TimeIter); + + /*! + * \brief Runtime_Parsing + */ + virtual void Runtime_Options(); }; diff --git a/SU2_CFD/include/integration_structure.hpp b/SU2_CFD/include/integration_structure.hpp index 4e1d624cad63..a6a72ea496ac 100644 --- a/SU2_CFD/include/integration_structure.hpp +++ b/SU2_CFD/include/integration_structure.hpp @@ -105,10 +105,9 @@ class CIntegration { * \param[in] solver - Description of the numerical method. * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ void Space_Integration_FEM(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config, - unsigned short RunTime_EqSystem, unsigned long Iteration); + unsigned short RunTime_EqSystem); /*! * \brief Do the time integration (explicit or implicit) of the numerical system. @@ -117,10 +116,9 @@ class CIntegration { * \param[in] config - Definition of the particular problem. * \param[in] iRKStep - Current step of the Runge-Kutta iteration. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ void Time_Integration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iRKStep, unsigned short RunTime_EqSystem, unsigned long Iteration); + unsigned short iRKStep, unsigned short RunTime_EqSystem); /*! * \brief Do the time integration (explicit or implicit) of the numerical system on a FEM framework. @@ -132,7 +130,7 @@ class CIntegration { * \param[in] Iteration - Current iteration. */ void Time_Integration_FEM(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config, - unsigned short RunTime_EqSystem, unsigned long Iteration); + unsigned short RunTime_EqSystem); /*! * \brief Initialize the adjoint solution using the primal problem. @@ -145,16 +143,6 @@ class CIntegration { void Adjoint_Setup(CGeometry ****geometry, CSolver *****solver_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone); - /*! - * \brief Do the convergence analysis to determine if the code must stop the execution. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] Iteration - Current iteration. - * \param[in] monitor - Objective function that is use to study its convergence. - */ - void Convergence_Monitoring(CGeometry *geometry, CConfig *config, - unsigned long Iteration, su2double monitor, unsigned short iMesh); - /*! * \brief Average the scalar output in case there is a unsteady solution. * \param[in] geometry - Geometrical definition of the problem. @@ -166,37 +154,6 @@ class CIntegration { void Average_Monitoring(CGeometry *geometry, CConfig *config, unsigned long Iteration, su2double monitor, unsigned short iMesh); - /*! - * \brief Do the convergence analysis to determine if the structural FEM analysis has converged. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] solver - Solution of the problem - * \param[in] Iteration - Current iteration. - * \param[in] monitor - Objective function that is use to study its convergence. - */ - void Convergence_Monitoring_FEM(CGeometry *geometry, CConfig *config, CSolver *solver, unsigned long iOuterIter); - - /*! - * \brief Do the convergence analysis to determine if the adjoint FEM analysis has converged. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] solver - Solution of the problem - * \param[in] Iteration - Current iteration. - * \param[in] monitor - Objective function that is use to study its convergence. - */ - void Convergence_Monitoring_FEM_Adj(CGeometry *geometry, CConfig *config, CSolver *solver, unsigned long iOuterIter); - - - /*! - * \brief Do the convergence analysis to determine if the FSI problem has converged on the structural side. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] Iteration - Current iteration. - * \param[in] monitor - Objective function that is use to study its convergence. - */ - void Convergence_Monitoring_FSI(CGeometry *fea_geometry, CConfig *fea_config, CSolver *fea_solver, unsigned long iOuterIter); - - /*! * \brief Get the value of the convergence. * \return Level of convergence of the solution. @@ -271,10 +228,9 @@ class CIntegration { * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ virtual void MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! * \brief A virtual member. @@ -285,11 +241,10 @@ class CIntegration { * \param[in] iMesh - Index of the mesh in multigrid computations. * \param[in] mu - Variable for controlling the kind of multigrid algorithm. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ virtual void MultiGrid_Cycle(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, CConfig **config, unsigned short iMesh, unsigned short mu, unsigned short RunTime_EqSystem, - unsigned long Iteration, unsigned short iZone, unsigned short iInst); + unsigned short iZone, unsigned short iInst); /*! * \brief A virtual member. @@ -297,11 +252,10 @@ class CIntegration { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. * \param[in] monitor - value of the non-dimensional parameters for monitoring the convergence. */ virtual void NonDimensional_Parameters(CGeometry **geometry, CSolver ***solver_container, CNumerics ****numerics_container, - CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, unsigned long Iteration, + CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, su2double *monitor); /*! @@ -398,10 +352,9 @@ class CIntegration { * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ virtual void SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! @@ -411,10 +364,9 @@ class CIntegration { * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ virtual void Structural_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! @@ -474,7 +426,7 @@ class CMultiGridIntegration : public CIntegration { * \param[in] Iteration - Current iteration. */ void MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! * \brief Perform a Full-Approximation Storage (FAS) Multigrid. @@ -488,8 +440,7 @@ class CMultiGridIntegration : public CIntegration { * \param[in] Iteration - Current iteration. */ void MultiGrid_Cycle(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short iMesh, unsigned short mu, unsigned short RunTime_EqSystem, - unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short iMesh, unsigned short mu, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! * \brief Compute the non-dimensional parameters. @@ -501,7 +452,7 @@ class CMultiGridIntegration : public CIntegration { * \param[in] monitor - value of the non-dimensional parameters for monitoring the convergence. */ void NonDimensional_Parameters(CGeometry **geometry, CSolver ***solver_container, CNumerics ****numerics_container, - CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, unsigned long Iteration, + CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, su2double *monitor); /*! @@ -640,10 +591,9 @@ class CSingleGridIntegration : public CIntegration { * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ void SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! * \brief Restrict solution from fine grid to a coarse grid. @@ -700,10 +650,9 @@ class CStructuralIntegration : public CIntegration { * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ void Structural_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); }; @@ -734,10 +683,9 @@ class CFEM_DG_Integration : public CIntegration { * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). * \param[in] config - Definition of the particular problem. * \param[in] RunTime_EqSystem - System of equations which is going to be solved. - * \param[in] Iteration - Current iteration. */ void SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst); + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst); /*! * \brief Perform the spatial integration of the numerical system. * \param[in] geometry - Geometrical definition of the problem. @@ -763,7 +711,7 @@ class CFEM_DG_Integration : public CIntegration { * \param[in] Iteration - Current iteration. */ void Time_Integration(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iStep, unsigned short RunTime_EqSystem, unsigned long Iteration); + unsigned short iStep, unsigned short RunTime_EqSystem); }; #include "integration_structure.inl" diff --git a/SU2_CFD/include/integration_structure.inl b/SU2_CFD/include/integration_structure.inl index 91b7f6bfbf86..c2ef06be85ef 100644 --- a/SU2_CFD/include/integration_structure.inl +++ b/SU2_CFD/include/integration_structure.inl @@ -50,14 +50,14 @@ inline void CIntegration::SetConvergence(bool value) { Convergence = value; } inline void CIntegration::SetConvergence_FSI(bool valueFSI) { Convergence_FSI = valueFSI; } inline void CIntegration::MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst) { } + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { } inline void CIntegration::MultiGrid_Cycle(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, CConfig **config, unsigned short iMesh, unsigned short mu, unsigned short RunTime_EqSystem, - unsigned long Iteration, unsigned short iZone, unsigned short iInst) { } + unsigned short iZone, unsigned short iInst) { } inline void CIntegration::NonDimensional_Parameters(CGeometry **geometry, CSolver ***solver_container, CNumerics ****numerics_container, - CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, unsigned long Iteration, + CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, su2double *monitor) { } inline void CIntegration::SetProlongated_Correction(CSolver *sol_fine, CGeometry *geo_fine, CConfig *config, unsigned short iMesh) { } @@ -81,10 +81,10 @@ inline void CIntegration::SetForcing_Term(CSolver *sol_fine, CSolver *sol_coarse CConfig *config, unsigned short iMesh) { } inline void CIntegration::SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst) { } + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { } inline void CIntegration::Structural_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, - CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst) { } + CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { } inline void CIntegration::SetPotential_Solver(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, diff --git a/SU2_CFD/include/iteration_structure.hpp b/SU2_CFD/include/iteration_structure.hpp index 6d8f7a76a46f..cbf3f0177c7f 100644 --- a/SU2_CFD/include/iteration_structure.hpp +++ b/SU2_CFD/include/iteration_structure.hpp @@ -44,7 +44,7 @@ #include "solver_structure.hpp" #include "integration_structure.hpp" -#include "output_structure.hpp" +#include "output/COutput.hpp" #include "numerics_structure.hpp" #include "../../Common/include/geometry_structure.hpp" #include "../../Common/include/grid_movement_structure.hpp" @@ -98,7 +98,7 @@ class CIteration { */ virtual void SetGrid_Movement(CGeometry **geometry, CSurfaceMovement *surface_movement, CVolumetricMovement *grid_movement, - CSolver ***solver, CConfig *config, unsigned long IntIter, unsigned long ExtIter); + CSolver ***solver, CConfig *config, unsigned long IntIter, unsigned long TimeIter); /*! * \brief Run the mesh deformation algorithms. * \author R. Sanchez @@ -274,7 +274,7 @@ class CIteration { CGeometry ****geometry, CSolver *****solver, CConfig **config, - unsigned long ExtIter, + unsigned long InnerIter, bool StopCalc, unsigned short val_iZone, unsigned short val_iInst); @@ -384,7 +384,7 @@ class CFluidIteration : public CIteration { * \brief Preprocessing to prepare for an iteration of the physics. * \param[in] ??? - Description here. */ - void Preprocess(COutput *output, +virtual void Preprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, @@ -408,7 +408,7 @@ class CFluidIteration : public CIteration { * \param[in] grid_movement - Volume grid movement classes of the problem. * \param[in] FFDBox - FFD FFDBoxes of the problem. */ - void Iterate(COutput *output, +virtual void Iterate(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, @@ -432,7 +432,7 @@ class CFluidIteration : public CIteration { * \param[in] grid_movement - Volume grid movement classes of the problem. * \param[in] FFDBox - FFD FFDBoxes of the problem. */ - void Solve(COutput *output, + virtual void Solve(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, @@ -448,7 +448,7 @@ class CFluidIteration : public CIteration { * \brief Updates the containers for the fluid system. * \param[in] ??? - Description here. */ - void Update(COutput *output, +virtual void Update(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, @@ -464,7 +464,7 @@ class CFluidIteration : public CIteration { * \brief Monitors the convergence and other metrics for the fluid system. * \param[in] ??? - Description here. */ - bool Monitor(COutput *output, +virtual bool Monitor(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, @@ -482,7 +482,7 @@ class CFluidIteration : public CIteration { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Postprocess(COutput *output, + virtual void Postprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, CSolver *****solver, @@ -580,7 +580,7 @@ class CTurboIteration : public CFluidIteration { * \author T. Economon, E. van der Weide * \version 6.2.0 "Falcon" */ -class CFEMFluidIteration : public CIteration { +class CFEMFluidIteration : public CFluidIteration { public: /*! @@ -657,22 +657,6 @@ class CFEMFluidIteration : public CIteration { unsigned short val_iZone, unsigned short val_iInst); - /*! - * \brief Monitors the convergence and other metrics for the finite element flow system. - * \param[in] ??? - Description here. - */ - 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); - /*! * \brief Postprocess routine for the finite element flow system. * \param[in] solver - Container vector with all the solutions. @@ -1012,7 +996,7 @@ class CFEAIteration : public CIteration { * \brief Class for driving an iteration of the adjoint fluid system. * \author T. Economon */ -class CAdjFluidIteration : public CIteration { +class CAdjFluidIteration : public CFluidIteration { public: /*! @@ -1082,38 +1066,6 @@ class CAdjFluidIteration : public CIteration { unsigned short val_iZone, unsigned short val_iInst); - /*! - * \brief Monitors the convergence and other metrics for the adjoint fluid system. - */ - 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); - - /*! - * \brief Postprocess ???. - * \param[in] solver - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Postprocess(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); }; @@ -1816,7 +1768,7 @@ class CDiscAdjHeatIteration : public CIteration { CGeometry ****geometry, CSolver *****solver, CConfig **config, - unsigned long ExtIter, + unsigned long InnerIter, bool StopCalc, unsigned short val_iZone, unsigned short val_iInst); diff --git a/SU2_CFD/include/output/CAdjElasticityOutput.hpp b/SU2_CFD/include/output/CAdjElasticityOutput.hpp new file mode 100644 index 000000000000..c236be31cef5 --- /dev/null +++ b/SU2_CFD/include/output/CAdjElasticityOutput.hpp @@ -0,0 +1,90 @@ +/*! + * \file CAdjElasticityOutput.hpp + * \brief Headers of the adjoint elasticity output class. + * \author T. Albring, R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CAdjElasticityOutput + * \brief Output class for elasticity discrete adjoint problems. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CAdjElasticityOutput final : public COutput { +private: + unsigned short nVar_FEM; //!< Number of FEM variables + +public: + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CAdjElasticityOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CAdjElasticityOutput(void) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + +}; diff --git a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp new file mode 100644 index 000000000000..59b7d464a334 --- /dev/null +++ b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp @@ -0,0 +1,121 @@ +/*! + * \file CAdjFlowIncOutput.hpp + * \brief Headers of the adjoint incompressible flow output. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CAdjFlowIncOutput + * \brief Output class for incompressible flow discrete adjoint problems. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CAdjFlowIncOutput final: public COutput { +private: + + unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + bool heat, /*!< \brief Boolean indicating whether have a heat problem*/ + weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ + +public: + + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CAdjFlowIncOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CAdjFlowIncOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override; + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + bool SetInit_Residuals(CConfig *config) override; + + /*! + * \brief Check whether the averaged values should be updated + * \param[in] config - Definition of the particular problem. + * \return averages should be updated. + */ + bool SetUpdate_Averages(CConfig *config) override; + +}; diff --git a/SU2_CFD/include/output/CAdjFlowOutput.hpp b/SU2_CFD/include/output/CAdjFlowOutput.hpp new file mode 100644 index 000000000000..bb1a552a8625 --- /dev/null +++ b/SU2_CFD/include/output/CAdjFlowOutput.hpp @@ -0,0 +1,119 @@ +/*! + * \file CAdjFlowCompOutput.hpp + * \brief Headers of the adjoint compressible flow output. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CAdjFlowCompOutput + * \brief Output class for compressible flow adjoint problems. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CAdjFlowCompOutput final: public COutput { +private: + + bool cont_adj; /*!< \brief Boolean indicating whether we run a cont. adjoint problem */ + unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CAdjFlowCompOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CAdjFlowCompOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override; + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + bool SetInit_Residuals(CConfig *config) override; + + /*! + * \brief Check whether the averaged values should be updated + * \param[in] config - Definition of the particular problem. + * \return averages should be updated. + */ + bool SetUpdate_Averages(CConfig *config) override; + +}; diff --git a/SU2_CFD/include/output/CAdjHeatOutput.hpp b/SU2_CFD/include/output/CAdjHeatOutput.hpp new file mode 100644 index 000000000000..032437a862cc --- /dev/null +++ b/SU2_CFD/include/output/CAdjHeatOutput.hpp @@ -0,0 +1,99 @@ +/*! + * \file output_fea_discadj.hpp + * \brief Headers of the adjoint heat output. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CAdjHeatOutput + * \brief Output class for adjoint heat output. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CAdjHeatOutput final: public COutput { +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CAdjHeatOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CAdjHeatOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override; +}; diff --git a/SU2_CFD/include/output/CBaselineOutput.hpp b/SU2_CFD/include/output/CBaselineOutput.hpp new file mode 100644 index 000000000000..4bbc6fc8b8f6 --- /dev/null +++ b/SU2_CFD/include/output/CBaselineOutput.hpp @@ -0,0 +1,78 @@ +/*! + * \file CBaselineOutput.hpp + * \brief Headers of the baseline output. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CBaselineOutput + * \brief Output class for baseline solver output. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CBaselineOutput : public COutput { + + std::vector fields; +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CBaselineOutput(CConfig *config, unsigned short nDim, CSolver *solver); + + /*! + * \brief Destructor of the class. + */ + ~CBaselineOutput(void) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + +}; diff --git a/SU2_CFD/include/output/CElasticityOutput.hpp b/SU2_CFD/include/output/CElasticityOutput.hpp new file mode 100644 index 000000000000..5d7d54509492 --- /dev/null +++ b/SU2_CFD/include/output/CElasticityOutput.hpp @@ -0,0 +1,101 @@ +/*! + * \file CElasticityOutput.hpp + * \brief Headers of the elasticity output. + * \author F. Palacios, T. Economon, M. Colonno + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CElasticityOutput + * \brief Output class for FEA problems. + * \author R. Sanchez, T. Albring. + * \date May 24, 2018. + */ +class CElasticityOutput final: public COutput { +protected: + + unsigned short nVar_FEM; //!< Number of FEM variables + bool linear_analysis, //!< Boolean indicating a linear analysis + nonlinear_analysis, //!< Boolean indicating a nonlinear analysis + dynamic; //!< Boolean indicating a dynamic analysis + +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CElasticityOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CElasticityOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + bool SetInit_Residuals(CConfig *config) override; +}; diff --git a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp new file mode 100644 index 000000000000..fa407f93c497 --- /dev/null +++ b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp @@ -0,0 +1,133 @@ +/*! + * \file CFlowCompFEMOutput.hpp + * \brief Headers of the compressible FEM flow output. + * \author R. Sanchez, T. Albring. + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CFlowOutput.hpp" + +class CVariable; + +/*! \class CFlowCompFEMOutput + * \brief Output class for the compressible FEM flow output. + * \author R. Sanchez, T. Albring. + * \date May 30, 2018. + */ +class CFlowCompFEMOutput final: public CFlowOutput { +private: + + unsigned short nVar; //!< Number of variables + unsigned short turb_model; //!< Kind of turbulence model + +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CFlowCompFEMOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CFlowCompFEMOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iElem - Index of the element. + * \param[in] index - Index of the value. + * \param[in] dof - Index of the local degree of freedom. + */ + void LoadVolumeDataFEM(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iElem, unsigned long index, unsigned short dof) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Compute value of the Q criteration for vortex idenfitication + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] node_flow - The flow variable node + * \return Value of the Q criteration at the node + */ + su2double GetQ_Criterion(CConfig *config, CGeometry *geometry, CVariable *node_flow); + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + bool SetInit_Residuals(CConfig *config) override; + + /*! + * \brief Check whether the averaged values should be updated + * \param[in] config - Definition of the particular problem. + * \return averages should be updated. + */ + bool SetUpdate_Averages(CConfig *config) override; + +}; diff --git a/SU2_CFD/include/output/CFlowCompOutput.hpp b/SU2_CFD/include/output/CFlowCompOutput.hpp new file mode 100644 index 000000000000..06385afeaba5 --- /dev/null +++ b/SU2_CFD/include/output/CFlowCompOutput.hpp @@ -0,0 +1,131 @@ +/*! + * \file CFlowCompOutput.hpp + * \brief Headers of the compressible flow output. + * \author R. Sanchez, T. Albring. + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CFlowOutput.hpp" + +class CVariable; + +/*! \class CFlowCompOutput + * \brief Output class for compressible flow problems. + * \author R. Sanchez, T. Albring. + * \date May 30, 2018. + */ +class CFlowCompOutput final: public CFlowOutput { +private: + + unsigned short turb_model; //!< Kind of turbulence model + +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CFlowCompOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CFlowCompOutput(void) override; + + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Compute value of the Q criteration for vortex idenfitication + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] node_flow - The flow variable node + * \return Value of the Q criteration at the node + */ + su2double GetQ_Criterion(CConfig *config, CGeometry *geometry, CVariable *node_flow); + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + bool SetInit_Residuals(CConfig *config) override; + + /*! + * \brief Check whether the averaged values should be updated + * \param[in] config - Definition of the particular problem. + * \return averages should be updated. + */ + bool SetUpdate_Averages(CConfig *config) override; + + +}; diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp new file mode 100644 index 000000000000..7efeb9467777 --- /dev/null +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -0,0 +1,131 @@ +/*! + * \file CFlowIncCompOutput.hpp + * \brief Headers of the incompressible flow output. + * \author T. Albring, R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CFlowOutput.hpp" + +class CVariable; + +/*! \class CFlowIncOutput + * \brief Output class for incompressible flow problems. + * \author R. Sanchez, T. Albring. + * \date May 30, 2018. + */ +class CFlowIncOutput final: public CFlowOutput { +private: + + unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + bool heat, /*!< \brief Boolean indicating whether have a heat problem*/ + weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ + +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CFlowIncOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CFlowIncOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; + + /*! + * \brief Compute value of the Q criteration for vortex idenfitication + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] node_flow - The flow variable node + * \return Value of the Q criteration at the node + */ + su2double GetQ_Criterion(CConfig *config, CGeometry *geometry, CVariable *node_flow); + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + bool SetInit_Residuals(CConfig *config) override; + + /*! + * \brief Check whether the averaged values should be updated + * \param[in] config - Definition of the particular problem. + * \return averages should be updated. + */ + bool SetUpdate_Averages(CConfig *config) override; + +}; diff --git a/SU2_CFD/include/output/CFlowOutput.hpp b/SU2_CFD/include/output/CFlowOutput.hpp new file mode 100644 index 000000000000..f5d0e3aa1f5b --- /dev/null +++ b/SU2_CFD/include/output/CFlowOutput.hpp @@ -0,0 +1,140 @@ +/*! + * \file CFlowOutput.hpp + * \brief Headers of the flow output. + * \author F. Palacios, T. Economon, M. Colonno + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" +#include "../variables/CVariable.hpp" + +class CFlowOutput : public COutput{ +public: + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CFlowOutput(CConfig *config, unsigned short nDim, bool femOutput); + + /*! + * \brief Destructor of the class. + */ + ~CFlowOutput(void) override; + +protected: + /*! + * \brief Add flow surface output fields + * \param[in] config - Definition of the particular problem. + */ + void AddAnalyzeSurfaceOutput(CConfig *config); + + /*! + * \brief Set flow surface output field values + * \param[in] solver - The container holding all solution data. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] output - Boolean indicating whether information should be written to screen + */ + void SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfig *config, bool output); + + /*! + * \brief Add aerodynamic coefficients as output fields + * \param[in] config - Definition of the particular problem. + */ + void AddAerodynamicCoefficients(CConfig *config); + + /*! + * \brief Set the value of the aerodynamic coefficients + * \param[in] config - Definition of the particular problem. + * \param[in] flow_solver - The container holding all solution data. + */ + void SetAerodynamicCoefficients(CConfig *config, CSolver *flow_solver); + + /*! + * \brief Add CP inverse design output as history fields + * \param[in] config - Definition of the particular problem. + */ + void Add_CpInverseDesignOutput(CConfig *config); + + /*! + * \brief Set CP inverse design output field values + * \param[in] solver - The container holding all solution data. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + */ + void Set_CpInverseDesign(CSolver *solver, CGeometry *geometry, CConfig *config); + + /*! + * \brief Write information to meta data file + * \param[in] output - Container holding the output instances per zone. + * \param[in] config - Definition of the particular problem per zone. + */ + void WriteMetaData(CConfig *config, CGeometry *geometry); + + /*! + * \brief Write any additional files defined for the current solver. + * \param[in] config - Definition of the particular problem per zone. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - The container holding all solution data. + */ + void WriteAdditionalFiles(CConfig *config, CGeometry *geometry, CSolver **solver_container) override; + + /*! + * \brief Determines if the the volume output should be written. + * \param[in] config - Definition of the particular problem. + * \param[in] Iter - Current iteration index. + */ + bool WriteVolume_Output(CConfig *config, unsigned long Iter) override; + + /*! + * \brief Write the forces breakdown file + * \param[in] config - Definition of the particular problem per zone. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - The container holding all solution data. + */ + void WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSolver **solver_container); + + /*! + * \brief Set the time averaged output fields. + */ + void SetTimeAveragedFields(); + + /*! + * \brief Load the time averaged output fields. + * \param iPoint + * \param node_flow + */ + void LoadTimeAveragedData(unsigned long iPoint, CVariable *node_flow); +}; diff --git a/SU2_CFD/include/output/CHeatOutput.hpp b/SU2_CFD/include/output/CHeatOutput.hpp new file mode 100644 index 000000000000..8a41c49f45b8 --- /dev/null +++ b/SU2_CFD/include/output/CHeatOutput.hpp @@ -0,0 +1,88 @@ +/*! + * \file CHeatOutput.hpp + * \brief Headers of the heat output. + * \author R. Sanchez, T. Albring. + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + + +/*! \class CHeatOutput + * \brief Output class for heat problems. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CHeatOutput final: public COutput { +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CHeatOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CHeatOutput(void) override; + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryOutputFields(CConfig *config) override; +}; diff --git a/SU2_CFD/include/output/CMeshOutput.hpp b/SU2_CFD/include/output/CMeshOutput.hpp new file mode 100644 index 000000000000..8d2124f0d3b8 --- /dev/null +++ b/SU2_CFD/include/output/CMeshOutput.hpp @@ -0,0 +1,77 @@ +/*! + * \file CMeshOutput.hpp + * \brief Headers of the mesh output. + * \author R. Sanchez, T. Albring. + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "COutput.hpp" + +/*! \class CMeshOutput + * \brief Output class for mesh solution. + * \author R. Sanchez, T. Albring. + * \date June 5, 2018. + */ +class CMeshOutput final: public COutput { + +public: + + /*! + * \brief Constructor of the class + * \param[in] config - Definition of the particular problem. + */ + CMeshOutput(CConfig *config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CMeshOutput(void) override; + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFields(CConfig *config) override; + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) override; + +}; diff --git a/SU2_CFD/include/output/CMultizoneOutput.hpp b/SU2_CFD/include/output/CMultizoneOutput.hpp new file mode 100644 index 000000000000..754d57b830d1 --- /dev/null +++ b/SU2_CFD/include/output/CMultizoneOutput.hpp @@ -0,0 +1,114 @@ +/*! + * \file CDriverOutput.hpp + * \brief Headers of the main subroutines for screen and history output in multizone problems. + * \author R. Sanchez, T. Albring + * \version 6.1.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "../../../Common/include/mpi_structure.hpp" + +#ifdef HAVE_CGNS + #include "cgnslib.h" +#endif +#ifdef HAVE_TECIO + #include "TECIO.h" +#endif +#include +#include +#include +#include + +#include "COutput.hpp" +#include "../../../Common/include/config_structure.hpp" + +using namespace std; + +/*! + * \class CDriverOutput + * \brief Class for writing the multizone output. + * \author R. Sanchez, T. Albring. + */ +class CMultizoneOutput final: public COutput { + +protected: + unsigned short nZone; //!< Number of zones + + string bgs_res_name; //!< Block-Gauss seidel residual name + bool write_zone; //!< Boolean indicating whether the individual zones write to screen + +public: + + /*! + * \brief Constructor of the class. + */ + CMultizoneOutput(CConfig *driver_config, CConfig** config, unsigned short nDim); + + /*! + * \brief Destructor of the class. + */ + ~CMultizoneOutput(void) override; + + /*! + * \brief Load the multizone history output field values + * \param[in] output - Container holding the output instances per zone. + * \param[in] config - Definition of the particular problem. + */ + void LoadMultizoneHistoryData(COutput **output, CConfig **config) override; + + /*! + * \brief Set the available multizone history output fields + * \param[in] output - Container holding the output instances per zone. + * \param[in] config - Definition of the particular problem per zone. + */ + void SetMultizoneHistoryOutputFields(COutput **output, CConfig **config) override; + + /*! + * \brief Determines if the history file output. + * \param[in] config - Definition of the particular problem. + */ + bool WriteHistoryFile_Output(CConfig *config) override; + + /*! + * \brief Determines if the screen header should be written. + * \param[in] config - Definition of the particular problem. + */ + bool WriteScreen_Header(CConfig *config) override; + + /*! + * \brief Determines if the screen header should be written. + * \param[in] config - Definition of the particular problem. + */ + bool WriteScreen_Output(CConfig *config) override; +}; diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp new file mode 100644 index 000000000000..d9b3cb6be8b3 --- /dev/null +++ b/SU2_CFD/include/output/COutput.hpp @@ -0,0 +1,782 @@ +/*! + * \file COutput.hpp + * \brief Headers of the output class. + * \author T.Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../../Common/include/toolboxes/printing_toolbox.hpp" +#include "../../../Common/include/toolboxes/signal_processing_toolbox.hpp" +#include "../../../Common/include/option_structure.hpp" + +class CGeometry; +class CSolver; +class CFileWriter; +class CParallelDataSorter; +class CConfig; + +using namespace std; + +/*! + * \class COutput + * \brief Class for writing the convergence history and to write solution data to file. + * \author T.Albring + */ +class COutput { +protected: + + /*----------------------------- General ----------------------------*/ + + int rank, /*!< \brief MPI Rank. */ + size; /*!< \brief MPI Size. */ + + unsigned short nDim; /*!< \brief Physical Dimension */ + + bool multiZone, /*!< \brief Boolean to store whether we are running a multizone problem */ + gridMovement, /*!< \brief Boolean to store whether we have grid movement enabled */ + femOutput; /*!< \brief Boolean to store whether we should use the FEM routines */ + + /*----------------------------- Screen and history output ----------------------------*/ + + string historySep; /*!< \brief Character which separates values in the history file */ + unsigned short fieldWidth; /*!< \brief Width of each column for the screen output (hardcoded for now) */ + bool noWriting; /*!< \brief Boolean indicating whether a screen/history output should be written */ + unsigned long curTimeIter, /*!< \brief Current value of the time iteration index */ + curAbsTimeIter, /*!< \brief Current value of the time iteration index */ + curOuterIter, /*!< \brief Current value of the outer iteration index */ + curInnerIter; /*!< \brief Current value of the inner iteration index */ + + string historyFilename; /*!< \brief The history filename*/ + + /*! \brief Temporary variable to store the history filename */ + char char_histfile[200]; + /*! \brief Output file stream for the history */ + ofstream histFile; + + /** \brief Enum to identify the screen output format. */ + enum class ScreenOutputFormat { + INTEGER, /*!< \brief Integer format. Example: 34 */ + FIXED, /*!< \brief Format with fixed precision for floating point values. Example: 344.54 */ + SCIENTIFIC /*!< \brief Scientific format for floating point values. Example: 3.4454E02 */ + }; + + /** \brief Enum to identify the screen/history field type. */ + enum class HistoryFieldType { + RESIDUAL, /*!< \brief A user-defined residual field type*/ + AUTO_RESIDUAL, /*!< \brief An automatically generated residual field type */ + COEFFICIENT, /*!< \brief User defined coefficient field type */ + AUTO_COEFFICIENT, /*!< \brief Automatically generated coefficient field type */ + DEFAULT /*!< \brief Default field type */ + }; + + /** \brief Structure to store information for a history output field. + * + * The stored information is printed to the history file and to screen. + * Each individual instance represents a single field (i.e. column) in the history file or on screen. + */ + struct HistoryOutputField { + /*! \brief The name of the field, i.e. the name that is printed in the screen or file header.*/ + string fieldName = ""; + /*! \brief The value of the field. */ + su2double value = 0.0; + /*! \brief The format that is used to print this value to screen. */ + ScreenOutputFormat screenFormat = ScreenOutputFormat::FIXED; + /*! \brief The group this field belongs to. */ + string outputGroup =""; + /*! \brief The field type*/ + HistoryFieldType fieldType = HistoryFieldType::DEFAULT; + /*! \brief String containing the description of the field */ + string description = ""; + /*! \brief Default constructor. */ + HistoryOutputField() {} + /*! \brief Constructor to initialize all members. */ + HistoryOutputField(string fieldName_, ScreenOutputFormat screenFormat_, string OutputGroup_, + HistoryFieldType fieldType_, string description_): + fieldName(std::move(fieldName_)), value(0.0), screenFormat(screenFormat_), + outputGroup(std::move(OutputGroup_)), fieldType(fieldType_), description(std::move(description_)){} + }; + + /*! \brief Associative map to access data stored in the history output fields by a string identifier. */ + std::map historyOutput_Map; + /*! \brief Vector that contains the keys of the ::historyOutput_Map in the order of their insertion. */ + std::vector historyOutput_List; + /*! \brief Associative map to access data stored in the history per surface output fields by a string identifier. */ + std::map > historyOutputPerSurface_Map; + /*! \brief Vector that contains the keys of the ::historyOutputPerSurface_Map in the order of their insertion. */ + std::vector historyOutputPerSurface_List; + + /*! \brief Requested history field names in the config file. */ + std::vector requestedHistoryFields; + /*! \brief Number of requested history field names in the config file. */ + unsigned short nRequestedHistoryFields; + /*! \brief Requested screen field names in the config file. */ + std::vector requestedScreenFields; + /*! \brief Number of requested screen field names in the config file. */ + unsigned short nRequestedScreenFields; + + PrintingToolbox::CTablePrinter* convergenceTable; //!< Convergence output table structure + PrintingToolbox::CTablePrinter* multiZoneHeaderTable; //!< Multizone header output structure + PrintingToolbox::CTablePrinter* historyFileTable; //!< Table structure for writing to history file + PrintingToolbox::CTablePrinter* fileWritingTable; //!< File writing header + std::string multiZoneHeaderString; //!< Multizone header string + bool headerNeeded; //!< Boolean that stores whether a screen header is needed + + //! Structure to store the value of the running averages + map runningAverages; + + //! Structure to store the value initial residuals for relative residual computation + std::map initialResiduals; + + /*----------------------------- Volume output ----------------------------*/ + + CParallelDataSorter* volumeDataSorter; //!< Volume data sorter + CParallelDataSorter* surfaceDataSorter; //!< Surface data sorter + + vector volumeFieldNames; //!< Vector containing the volume field names + unsigned short nVolumeFields; /*!< \brief Number of fields in the volume output */ + + string volumeFilename, //!< Volume output filename + surfaceFilename, //!< Surface output filename + restartFilename; //!< Restart output filename + + /** \brief Structure to store information for a volume output field. + * + * The stored information is used to create the volume solution file. + */ + struct VolumeOutputField { + /*! \brief The name of the field, i.e. the name that is printed in the file header.*/ + string fieldName; + /*! \brief This value identifies the position of the values of this field at each node in the ::Local_Data array. */ + short offset; + /*! \brief The group this field belongs to. */ + string outputGroup; + /*! \brief String containing the description of the field */ + string description; + /*! \brief Default constructor. */ + VolumeOutputField () {} + /*! \brief Constructor to initialize all members. */ + VolumeOutputField(string fieldName_, int offset_, string volumeOutputGroup_, string description_): + fieldName(std::move(fieldName_)), offset(std::move(offset_)), + outputGroup(std::move(volumeOutputGroup_)), description(std::move(description_)){} + }; + + /*! \brief Associative map to access data stored in the volume output fields by a string identifier. */ + std::map volumeOutput_Map; + /*! \brief Vector that contains the keys of the ::volumeOutput_Map in the order of their insertion. */ + std::vector volumeOutput_List; + + /*! \brief Vector to cache the positions of the field in the data array */ + std::vector fieldIndexCache; + /*! \brief Current value of the cache index */ + unsigned short cachePosition; + /*! \brief Boolean to store whether the field index cache should be build. */ + bool buildFieldIndexCache; + /*! \brief Vector to cache the positions of the field in the data array */ + std::vector fieldGetIndexCache; + /*! \brief Current value of the cache index */ + unsigned short curGetFieldIndex; + + /*! \brief Requested volume field names in the config file. */ + std::vector requestedVolumeFields; + /*! \brief Number of requested volume field names in the config file. */ + unsigned short nRequestedVolumeFields; + + /*----------------------------- Convergence monitoring ----------------------------*/ + + su2double cauchyValue, /*!< \brief Summed value of the convergence indicator. */ + cauchyFunc; /*!< \brief Current value of the convergence indicator at one iteration. */ + unsigned short Cauchy_Counter; /*!< \brief Number of elements of the Cauchy serial. */ + vector> cauchySerie; /*!< \brief Complete Cauchy serial. */ + unsigned long nCauchy_Elems; /*!< \brief Total number of cauchy elems to monitor */ + su2double cauchyEps; /*!< \brief Defines the threshold when to stop the solver. */ + su2double minLogResidual; /*!< \brief Minimum value of the residual to reach */ + vector oldFunc, /*!< \brief Old value of the coefficient. */ + newFunc; /*!< \brief Current value of the coefficient. */ + bool convergence; /*!< \brief To indicate if the solver has converged or not. */ + su2double initResidual; /*!< \brief Initial value of the residual to evaluate the convergence level. */ + vector convFields; /*!< \brief Name of the field to be monitored for convergence */ + + /*----------------------------- Adaptive CFL ----------------------------*/ + + su2double rhoResNew, /*!< New value of the residual for adaptive CFL routine */ + rhoResOld; /*!< Old value of the residual for adaptive CFL routine */ + +public: + + /*----------------------------- Public member functions ----------------------------*/ + + /*! + * \brief Constructor of the class. + */ + COutput(CConfig *config, unsigned short nDim, bool femOutput); + + /*! + * \brief Preprocess the volume output by setting the requested volume output fields. + * \param[in] config - Definition of the particular problem. + */ + void PreprocessVolumeOutput(CConfig *config); + + /*! + * \brief Load the data from the solvers into the data sorters and sort it for the linear partitioning. + * + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - The container holding all solution data. + */ + void Load_Data(CGeometry *geometry, CConfig *config, CSolver **solver_container); + + /*! + * \brief Preprocess the history output by setting the history fields and opening the history file. + * \param[in] config - Definition of the particular problem. + * \param[in] wrt - If prepares history file for writing. + */ + void PreprocessHistoryOutput(CConfig *config, bool wrt = true); + + /*! + * \brief Preprocess the history output by setting the history fields and opening the history file. + * \param[in] output - Container holding the output instances per zone. + * \param[in] config - Definition of the particular problem per zone. + * \param[in] wrt - If prepares history file for writing. + */ + void PreprocessMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, bool wrt = true); + + /*! + * \brief Collects history data from the solvers, monitors the convergence and writes to screen and history file. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + * \param[in] TimeIter - Value of the time iteration index + * \param[in] OuterIter - Value of outer iteration index + * \param[in] InnerIter - Value of the inner iteration index + */ + void SetHistory_Output(CGeometry *geometry, CSolver **solver_container, CConfig *config, + unsigned long TimeIter, unsigned long OuterIter, unsigned long InnerIter); + + /*! + * \brief Collects history data from the solvers and monitors the convergence. Does not write to screen or file. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + */ + void SetHistory_Output(CGeometry *geometry, CSolver **solver_container, CConfig *config); + + /*! + * Collects history data from the individual output per zone, + * monitors the convergence and writes to screen and history file. + + * \param[in] output - Container holding the output instances per zone. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem per zone. + * \param[in] driver_config - Base definition of the particular problem. + * \param[in] TimeIter - Value of the time iteration index + * \param[in] OuterIter - Value of outer iteration index + */ + void SetMultizoneHistory_Output(COutput** output, CConfig **config, CConfig *driver_config, + unsigned long TimeIter, unsigned long OuterIter); + + /*! + * \brief Sets the volume output filename + * \param[in] filename - the new filename + */ + inline void SetVolume_Filename(string filename) {volumeFilename = filename;} + + /*! + * \brief Sets the surface output filename + * \param[in] filename - the new filename + */ + inline void SetSurface_Filename(string filename) {surfaceFilename = filename;} + + /*! + * \brief Returns the current volume filename + * \return - The current volume filename + */ + inline string GetVolume_Filename() {return volumeFilename;} + + /*! + * \brief Returns the current surface filename + * \return - The current surface filename + */ + inline string GetSurface_Filename() {return surfaceFilename;} + + /*! + * \brief Sets the restart filename + * \param[in] filename - the new filename + */ + inline void SetRestart_Filename(string filename) {restartFilename = filename;} + + /*! + * \brief Returns the current restart filename + * \return - The current restart filename + */ + inline string GetRestart_Filename() {return restartFilename;} + + /*! + * \brief Set the CFL number based on the current residuals + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + */ + void SetCFL_Number(CSolver ****solver_container, CConfig *config); + + /*! + * \brief Set the current iteration indices + * \param[in] TimeIter - Timer iteration index + * \param[in] OuterIter - Outer iteration index + * \param[in] InnerIter - Inner iteration index + */ + inline void SetIteration(unsigned long TimeIter, unsigned long OuterIter, unsigned long InnerIter){ + curTimeIter = TimeIter; + curOuterIter = OuterIter; + curInnerIter = InnerIter; + } + + /*! + * \brief Get the value of particular history output field + * \param[in] field - Name of the field + * \return Value of the field + */ + su2double GetHistoryFieldValue(string field){ + return historyOutput_Map[field].value; + } + + /*! + * \brief Get a vector with all output fields in a particular group + * \param groupname - Name of the history group + * \return Vector containing all output fields of a group + */ + vector GetHistoryGroup(string groupname){ + vector HistoryGroup; + for (unsigned short iField = 0; iField < historyOutput_Map.size(); iField++){ + if (historyOutput_Map[historyOutput_List[iField]].outputGroup == groupname){ + HistoryGroup.push_back((historyOutput_Map[historyOutput_List[iField]])); + } + } + return HistoryGroup; + } + + /*! + * \brief Get the list of all output fields + * \return Vector container all output fields + */ + vector GetHistoryOutput_List(){ + return historyOutput_List; + } + + /*! + * \brief Get the map containing all output fields + * \return Map containing all output fields + */ + map GetHistoryFields(){ + return historyOutput_Map; + } + + /*! + * \brief Monitor the convergence of an output field + * \param[in] config - Definition of the particular problem. + * \param[in] Iteration - Index of the current iteration. + * \return Boolean indicating whether the problem is converged. + */ + bool Convergence_Monitoring(CConfig *config, unsigned long Iteration); + + /*! + * \brief Print a summary of the convergence to screen. + */ + void PrintConvergenceSummary(); + + /*! + * \brief Get convergence of the problem. + * \return Boolean indicating whether the problem is converged. + */ + bool GetConvergence() {return convergence;} + + /*! + * \brief Set the value of the convergence flag. + * \param[in] conv - New value of the convergence flag. + */ + void SetConvergence(bool conv) {convergence = conv;} + + /*! + * \brief Print a list of all history output fields to screen. + */ + void PrintHistoryFields(); + + /*! + * \brief Print a list of all volume output fields to screen. + */ + void PrintVolumeFields(); + + /*! + * \brief Loop through all requested output files and write the volume output data. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] iter - The current time, outer or inner iteration index. + * \param[in] force_writing - If , writing of output files is forced without checking the output frequency. + * \return if output files have been written to disk. + */ + bool SetResult_Files(CGeometry *geometry, CConfig *config, CSolver** solver_container, + unsigned long iter, bool force_writing = false); + + /*! + * \brief Allocates the appropriate file writer based on the chosen format and writes sorted data to file. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] format - The output format. + * \param[in] fileName - The file name. If empty, the filenames are automatically determined. + */ + void WriteToFile(CConfig *config, CGeometry *geomery, unsigned short format, string fileName = ""); + +protected: + + /*----------------------------- Protected member functions ----------------------------*/ + + /*! + * \brief Set the history file header + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryFile_Header(CConfig *config); + + /*! + * \brief Write the history file output + * \param[in] config - Definition of the particular problem. + */ + void SetHistoryFile_Output(CConfig *config); + + /*! + * \brief Write the screen header. + * \param[in] config - Definition of the particular problem. + */ + void SetScreen_Header(CConfig *config); + + + /*! + * \brief Write the screen output. + * \param[in] config - Definition of the particular problem. + */ + void SetScreen_Output(CConfig *config); + + /*! + * \brief Add a new field to the history output. + * \param[in] name - Name for referencing it (in the config file and in the code). + * \param[in] field_name - Header that is printed on screen and in the history file. + * \param[in] format - The screen printing format (::ScreenOutputFormat). + * \param[in] groupname - The name of the group this field belongs to. + * \param[in] description - A description of the field. + * \param[in] field_type - The type of the field (::HistoryFieldType). + */ + inline void AddHistoryOutput(string name, string field_name, ScreenOutputFormat format, + string groupname, string description, + HistoryFieldType field_type = HistoryFieldType::DEFAULT ){ + historyOutput_Map[name] = HistoryOutputField(field_name, format, groupname, field_type, description); + historyOutput_List.push_back(name); + } + + /*! + * \brief Set the value of a history output field + * \param[in] name - Name of the field. + * \param[in] value - The new value of this field. + */ + inline void SetHistoryOutputValue(string name, su2double value){ + if (historyOutput_Map.count(name) > 0){ + historyOutput_Map[name].value = value; + } else { + SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); + } + } + + /*! + * \brief Add a new field per surface marker to the history output. + * \param[in] name - Name for referencing it (in the config file and in the code). + * \param[in] field_name - Header that is printed on screen and in the history file. + * \param[in] format - The screen printing format (::ScreenOutputFormat). + * \param[in] groupname - The name of the group this field belongs to. + * \param[in] marker_names - A list of markers. For every marker in this list a new field is created with "field_name + _marker_names[i]". + * \param[in] field_type - The type of the field (::HistoryFieldType). + */ + inline void AddHistoryOutputPerSurface(string name, string field_name, ScreenOutputFormat format, + string groupname, vector marker_names, + HistoryFieldType field_type = HistoryFieldType::DEFAULT){ + if (marker_names.size() != 0){ + historyOutputPerSurface_List.push_back(name); + for (unsigned short i = 0; i < marker_names.size(); i++){ + historyOutputPerSurface_Map[name].push_back(HistoryOutputField(field_name+"("+marker_names[i]+")", format, groupname, field_type, "")); + } + } + } + + /*! + * \brief Set the value of a history output field for a specific surface marker + * \param[in] name - Name of the field. + * \param[in] value - The new value of this field. + * \param[in] iMarker - The index of the marker. + */ + inline void SetHistoryOutputPerSurfaceValue(string name, su2double value, unsigned short iMarker){ + if (historyOutputPerSurface_Map.count(name) > 0){ + historyOutputPerSurface_Map[name][iMarker].value = value; + } else { + SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); + } + } + + /*! + * \brief Add a new field to the volume output. + * \param[in] name - Name for referencing it (in the config file and in the code). + * \param[in] field_name - Header that is printed in the output files. + * \param[in] groupname - The name of the group this field belongs to. + * \param[in] description - Description of the volume field. + */ + inline void AddVolumeOutput(string name, string field_name, string groupname, string description){ + volumeOutput_Map[name] = VolumeOutputField(field_name, -1, groupname, description); + volumeOutput_List.push_back(name); + } + + + /*! + * \brief Set the value of a volume output field + * \param[in] name - Name of the field. + * \param[in] value - The new value of this field. + */ + su2double GetVolumeOutputValue(string name, unsigned long iPoint); + + /*! + * \brief Set the value of a volume output field + * \param[in] name - Name of the field. + * \param[in] value - The new value of this field. + */ + void SetVolumeOutputValue(string name, unsigned long iPoint, su2double value); + + /*! + * \brief Set the value of a volume output field + * \param[in] name - Name of the field. + * \param[in] value - The new value of this field. + */ + void SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2double value); + + /*! + * \brief CheckHistoryOutput + */ + void CheckHistoryOutput(); + + /*! + * \brief Open the history file and write the header. + * \param[in] config - Definition of the particular problem. + */ + void PrepareHistoryFile(CConfig *config); + + /*! + * \brief Load up the values of the requested volume fields into ::Local_Data array. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - The container holding all solution data. + */ + void LoadDataIntoSorter(CConfig* config, CGeometry* geometry, CSolver** solver); + + /*! + * \brief Postprocess_HistoryData + * \param[in] config - Definition of the particular problem. + */ + void Postprocess_HistoryData(CConfig *config); + + /*! + * \brief Postprocess_HistoryFields + * \param[in] config - Definition of the particular problem. + */ + void Postprocess_HistoryFields(CConfig *config); + + /*! + * \brief Check whether we should print output. + * \param[in] iIter - Current iteration. + * \param[in] iFreq - Frequency of output printing. + */ + inline bool PrintOutput(unsigned long iIter, unsigned long iFreq) { + if (iFreq == 0){ + return false; + } + + return (iIter % iFreq == 0); + } + + /*! + * \brief Set the history fields common for all solvers. + * \param[in] config - Definition of the particular problem. + */ + void SetCommonHistoryFields(CConfig *config); + + /*! + * \brief Load values of the history fields common for all solvers. + * \param[in] config - Definition of the particular problem. + */ + void LoadCommonHistoryData(CConfig *config); + + /*! + * \brief Allocates the data sorters if necessary. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + */ + void AllocateDataSorters(CConfig *config, CGeometry *geometry); + + /*--------------------------------- Virtual functions ---------------------------------------- */ +public: + + /*! + * \brief Destructor of the class. + */ + virtual ~COutput(void); + +protected: + + /*! + * \brief Determines if the history file output. + * \param[in] config - Definition of the particular problem. + */ + virtual bool WriteHistoryFile_Output(CConfig *config); + + /*! + * \brief Determines if the screen header should be written. + * \param[in] config - Definition of the particular problem. + */ + virtual bool WriteScreen_Header(CConfig *config); + + /*! + * \brief Determines if the screen header should be written. + * \param[in] config - Definition of the particular problem. + */ + virtual bool WriteScreen_Output(CConfig *config); + + /*! + * \brief Determines if the the volume output should be written. + * \param[in] config - Definition of the particular problem. + * \param[in] Iter - Current iteration index. + */ + virtual bool WriteVolume_Output(CConfig *config, unsigned long Iter); + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + */ + inline virtual void LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){} + + /*! + * \brief Set the values of the volume output fields for a point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iElem - Index of the element. + * \param[in] index - Index of the value. + * \param[in] dof - Index of the local degree of freedom. + */ + inline virtual void LoadVolumeDataFEM(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iElem, unsigned long index, unsigned short dof){} + + /*! + * \brief Check whether the base values for relative residuals should be initialized + * \param[in] config - Definition of the particular problem. + * \return if the residuals should be initialized. + */ + inline virtual bool SetInit_Residuals(CConfig *config) {return false;} + + /*! + * \brief Check whether the averaged values should be updated + * \param[in] config - Definition of the particular problem. + * \return averages should be updated. + */ + inline virtual bool SetUpdate_Averages(CConfig *config){return false;} + + /*! + * \brief Set the values of the volume output fields for a surface point. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - The container holding all solution data. + * \param[in] iPoint - Index of the point. + * \param[in] iMarker - Index of the surface marker. + * \param[in] iVertex - Index of the vertex on the marker. + */ + inline virtual void LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, + unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){} + + /*! + * \brief Set the available volume output fields + * \param[in] config - Definition of the particular problem. + */ + inline virtual void SetVolumeOutputFields(CConfig *config){} + + + /*! + * \brief Load the history output field values + * \param[in] config - Definition of the particular problem. + */ + inline virtual void LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) {} + + /*! + * \brief Load the multizone history output field values + * \param[in] output - Container holding the output instances per zone. + * \param[in] config - Definition of the particular problem. + */ + inline virtual void LoadMultizoneHistoryData(COutput **output, CConfig **config) {} + + /*! + * \brief Set the available history output fields + * \param[in] config - Definition of the particular problem. + */ + inline virtual void SetHistoryOutputFields(CConfig *config) {} + + /*! + * \brief Set the available multizone history output fields + * \param[in] output - Container holding the output instances per zone. + * \param[in] config - Definition of the particular problem per zone. + */ + inline virtual void SetMultizoneHistoryOutputFields(COutput **output, CConfig **config) {} + + /*! + * \brief Write any additional files defined for the current solver. + * \param[in] config - Definition of the particular problem per zone. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - The container holding all solution data. + */ + inline virtual void WriteAdditionalFiles(CConfig *config, CGeometry* geometry, CSolver** solver_container){} + +}; + diff --git a/SU2_CFD/include/output_structure.hpp b/SU2_CFD/include/output/COutputLegacy.hpp similarity index 81% rename from SU2_CFD/include/output_structure.hpp rename to SU2_CFD/include/output/COutputLegacy.hpp index 7257fee20977..d430ee5373e8 100644 --- a/SU2_CFD/include/output_structure.hpp +++ b/SU2_CFD/include/output/COutputLegacy.hpp @@ -1,9 +1,9 @@ /*! - * \file output_structure.hpp + * \file output.hpp * \brief Headers of the main subroutines for generating the file outputs. * The subroutines and functions are in the output_structure.cpp file. * \author F. Palacios, T. Economon, M. Colonno - * \version 6.2.0 "Falcon" + * \version 6.1.0 "Falcon" * * The current SU2 release has been coordinated by the * SU2 International Developers Society @@ -19,7 +19,7 @@ * - Prof. Edwin van der Weide's group at the University of Twente. * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, * Tim Albring, and the SU2 contributors. * * SU2 is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ #pragma once -#include "../../Common/include/mpi_structure.hpp" +#include "../../../Common/include/mpi_structure.hpp" #ifdef HAVE_CGNS #include "cgnslib.h" @@ -49,28 +49,30 @@ #include #include #include -#include -#include -#include +#include +#include -#include "solver_structure.hpp" -#include "integration_structure.hpp" -#include "../../Common/include/geometry_structure.hpp" -#include "../../Common/include/fem_geometry_structure.hpp" -#include "../../Common/include/fem_standard_element.hpp" -#include "../../Common/include/config_structure.hpp" +//#include "../solver_structure.hpp" +//#include "../integration_structure.hpp" +//#include "../../../Common/include/geometry_structure.hpp" +//#include "../../../Common/include/fem_geometry_structure.hpp" +//#include "../../../Common/include/fem_standard_element.hpp" -#include "../../Common/include/toolboxes/printing_toolbox.hpp" +#include "../../../Common/include/option_structure.hpp" +class CGeometry; +class CConfig; +class CSolver; +class CIntegration; using namespace std; /*! - * \class COutput + * \class COutputLegacy * \brief Class for writing the flow, adjoint and linearized solver * solution (including the history solution, and parallel stuff). * \author F. Palacios, T. Economon, M. Colonno. */ -class COutput { +class COutputLegacy { unsigned long nGlobal_Poin; // Global number of nodes with halos unsigned long nSurf_Poin; // Global number of nodes of the surface @@ -219,12 +221,12 @@ class COutput { /*! * \brief Constructor of the class. */ - COutput(CConfig *congig); + COutputLegacy(CConfig *congig); /*! * \brief Destructor of the class. */ - ~COutput(void); + ~COutputLegacy(void); /*! * \brief Writes and organizes the all the output files, except the history one, for serial computations. @@ -529,103 +531,93 @@ class COutput { */ void SetCGNS_Solution(CConfig *config, CGeometry *geometry, unsigned short val_iZone); - /*! - * \brief Write a Paraview ASCII solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - */ - void SetParaview_ASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); - - /*! - * \brief Write a Paraview ASCII solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - */ - void SetParaview_MeshASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol, bool new_file); - - /*! - * \brief Write a Paraview ASCII solution file with parallel output. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. - */ - void WriteParaViewASCII_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_iInst, unsigned short val_nInst, bool surf_sol); - - /*! - * \brief Write a Paraview binary solution file with parallel output. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. - */ - void WriteParaViewBinary_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); +// /*! +// * \brief Write a Paraview ASCII solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// */ +// void SetParaview_ASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); + +// /*! +// * \brief Write a Paraview ASCII solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// */ +// void SetParaview_MeshASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol, bool new_file); + +// /*! +// * \brief Write a Paraview ASCII solution file with parallel output. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. +// */ +// void WriteParaViewASCII_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_iInst, unsigned short val_nInst, bool surf_sol); + +// /*! +// * \brief Write a Paraview binary solution file with parallel output. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. +// */ +// void WriteParaViewBinary_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); - /*! - * \brief Write a Tecplot ASCII solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - */ - void SetTecplotASCII(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); +// /*! +// * \brief Write a Tecplot ASCII solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// */ +// void SetTecplotASCII(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); - /*! - * \brief Write the nodal coordinates and connectivity to a Tecplot ASCII mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetTecplot_MeshASCII(CConfig *config, CGeometry *geometry, bool surf_sol, bool new_file); - - /*! - * \brief Write the nodal coordinates and connectivity to a stl ASCII mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetSTL_MeshASCII(CConfig *config, CGeometry *geometry); - - /*! - * \brief Write the nodal coordinates and connectivity to a n3d ASCII mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - */ - void SetCSV_MeshASCII(CConfig *config, CGeometry *geometry); +// /*! +// * \brief Write the nodal coordinates and connectivity to a Tecplot ASCII mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetTecplot_MeshASCII(CConfig *config, CGeometry *geometry, bool surf_sol, bool new_file); + +// /*! +// * \brief Write the nodal coordinates and connectivity to a stl ASCII mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetSTL_MeshASCII(CConfig *config, CGeometry *geometry); + +// /*! +// * \brief Write the nodal coordinates and connectivity to a n3d ASCII mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// */ +// void SetCSV_MeshASCII(CConfig *config, CGeometry *geometry); - /*! - * \brief Write the nodal coordinates and connectivity to a n3d ASCII mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetTecplotASCII_Mesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone, bool surf_sol, bool new_file); - - /*! - * \brief Write the solution data and connectivity to a Tecplot ASCII mesh file in parallel. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. - */ - void WriteTecplotASCII_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_iInst, unsigned short val_nInst, bool surf_sol); - - /*! - * \brief Write a Tecplot binary solution file with parallel output. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. - */ - void WriteTecplotBinary_Parallel(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol); +// /*! +// * \brief Write the nodal coordinates and connectivity to a n3d ASCII mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetTecplotASCII_Mesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone, bool surf_sol, bool new_file); + +// /*! +// * \brief Write the solution data and connectivity to a Tecplot ASCII mesh file in parallel. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// * \param[in] surf_sol - Flag controlling whether this is a volume or surface file. +// */ +// void WriteTecplotASCII_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_iInst, unsigned short val_nInst, bool surf_sol); /*! * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. @@ -659,79 +651,70 @@ class COutput { */ void WriteCoordinates_Binary(CConfig *config, CGeometry *geometry, unsigned short val_iZone); - /*! - * \brief Write a file with the adjoint sensitivities projected onto each surface node. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - */ - void WriteProjectedSensitivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone); - - /*! - * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetTecplotBinary_DomainMesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone); +// /*! +// * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetTecplotBinary_DomainMesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone); - /*! - * \brief Write the coordinates and connectivity to a Tecplot binary surface mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetTecplotBinary_SurfaceMesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone); +// /*! +// * \brief Write the coordinates and connectivity to a Tecplot binary surface mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetTecplotBinary_SurfaceMesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone); - /*! - * \brief Write solution data to a Tecplot binary volume solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetTecplotBinary_DomainSolution(CConfig *config, CGeometry *geometry, unsigned short val_iZone); - - /*! - * \brief Write solution data to a Tecplot binary surface solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetTecplotBinary_SurfaceSolution(CConfig *config, CGeometry *geometry, unsigned short val_iZone); +// /*! +// * \brief Write solution data to a Tecplot binary volume solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetTecplotBinary_DomainSolution(CConfig *config, CGeometry *geometry, unsigned short val_iZone); + +// /*! +// * \brief Write solution data to a Tecplot binary surface solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetTecplotBinary_SurfaceSolution(CConfig *config, CGeometry *geometry, unsigned short val_iZone); - /*! - * \brief Write a Tecplot ASCII solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - Current zone. - * \param[in] val_nZone - Total number of zones. - */ - void SetFieldViewASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone); +// /*! +// * \brief Write a Tecplot ASCII solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - Current zone. +// * \param[in] val_nZone - Total number of zones. +// */ +// void SetFieldViewASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone); - /*! - * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetFieldViewASCII_Mesh(CConfig *config, CGeometry *geometry); +// /*! +// * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetFieldViewASCII_Mesh(CConfig *config, CGeometry *geometry); - /*! - * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetFieldViewBinary_Mesh(CConfig *config, CGeometry *geometry); +// /*! +// * \brief Write the nodal coordinates and connectivity to a Tecplot binary mesh file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetFieldViewBinary_Mesh(CConfig *config, CGeometry *geometry); - /*! - * \brief Write solution data to a Tecplot binary volume solution file. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - */ - void SetFieldViewBinary(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone); +// /*! +// * \brief Write solution data to a Tecplot binary volume solution file. +// * \param[in] config - Definition of the particular problem. +// * \param[in] geometry - Geometrical definition of the problem. +// * \param[in] val_iZone - iZone index. +// */ +// void SetFieldViewBinary(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Deallocate temporary memory needed for merging and writing coordinates. @@ -951,10 +934,9 @@ class COutput { * \brief Sort the connectivities (volume and surface) into data structures used for output file writing. * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. - * \param[in] val_iZone - iZone index. - * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. + * \param[in] val_nZone - iZone index. */ - void SortConnectivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone, bool val_sort); + void SortConnectivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone); /*! * \brief Sort the connectivities (volume and surface) into data structures used for output file writing (DG-FEM solver). @@ -969,9 +951,8 @@ class COutput { * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. * \param[in] Elem_Type - VTK index of the element type being merged. - * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. */ - void SortVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type, bool val_sort); + void SortVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type); /*! * \brief Sort the connectivity for a single volume element type into a linear partitioning across all processors (DG-FEM solver). @@ -1081,4 +1062,4 @@ class COutput { }; -#include "output_structure.inl" +#include "output_structure_legacy.inl" diff --git a/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp b/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp new file mode 100644 index 000000000000..0f34e3e207cc --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp @@ -0,0 +1,65 @@ +/*! + * \file CCSVFileWriter.hpp + * \brief Headers fo the CSV file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once +#include "CFileWriter.hpp" + +class CCSVFileWriter final: public CFileWriter{ + +public: + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + */ + CCSVFileWriter(vector fields, unsigned short nDim, string fileName, CParallelDataSorter* data_sorter); + + /*! + * \brief Destructor + */ + ~CCSVFileWriter() override; + + /*! + * \brief Write sorted data to file in CSV file format + * \param[in] - The name of the file + * \param[in] - The parallel sorted data to write + */ + void Write_Data() override; + +}; + diff --git a/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp new file mode 100644 index 000000000000..94a8505345ce --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp @@ -0,0 +1,87 @@ +/*! + * \file CFEMDataSorter.hpp + * \brief Headers fo the FEM data sorter class. + * \author T. Albring, T. Economon + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CParallelDataSorter.hpp" + +class CFEMDataSorter final: public CParallelDataSorter{ + +public: + + /*! + * \brief Constructor + * \param[in] config - Pointer to the current config structure + * \param[in] geometry - Pointer to the current geometry + * \param[in] nFields - Number of output fields + */ + CFEMDataSorter(CConfig *config, CGeometry *geometry, unsigned short nFields); + + /*! + * \brief Destructor + */ + ~CFEMDataSorter() override; + + /*! + * \brief Sort the connectivities (volume and surface) into data structures used for output file writing. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. + */ + void SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) override; + + /*! + * \brief Get the global index of a point. + * \input iPoint - the point ID. + * \return Global index of a specific point. + */ + unsigned long GetGlobalIndex(unsigned long iPoint) override{ + return linearPartitioner->GetFirstIndexOnRank(rank) + iPoint; + } + +private: + + + /*! + * \brief Sort the connectivity for a single volume element type into a linear partitioning across all processors. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] Elem_Type - VTK index of the element type being merged. + */ + void SortVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type); + +}; diff --git a/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp new file mode 100644 index 000000000000..712764f8b74e --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp @@ -0,0 +1,106 @@ +/*! + * \file CFVMDataSorter.hpp + * \brief Headers fo the FVM data sorter class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CParallelDataSorter.hpp" +#include + +class CFVMDataSorter final: public CParallelDataSorter{ + +private: + + int* Local_Halo; //!< Array containing the flag whether a point is a halo node + +public: + + /*! + * \brief Constructor + * \param[in] config - Pointer to the current config structure + * \param[in] geometry - Pointer to the current geometry + * \param[in] nFields - Number of output fields + */ + CFVMDataSorter(CConfig *config, CGeometry *geometry, unsigned short nFields); + + /*! + * \brief Destructor + */ + ~CFVMDataSorter() override; + + /*! + * \brief Sort the connectivities (volume and surface) into data structures used for output file writing. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. + */ + void SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) override; + + /*! + * \brief Get the global index of a point. + * \input iPoint - the point ID. + * \return Global index of a specific point. + */ + unsigned long GetGlobalIndex(unsigned long iPoint) override { + return linearPartitioner->GetFirstIndexOnRank(rank) + iPoint; + } + + /*! + * \brief Get the boolean whether a point is a halo node + * \param[in] iPoint - ID of the point + * \return if the point is a halo node. + */ + bool GetHalo(unsigned long iPoint) {return Local_Halo[iPoint];} + +private: + + /*! + * \brief Initialize the halo point flags + * \param[in] geometry - Pointer to the current geometry + * \param[in] config - Pointer to the current config structure + */ + void SetHaloPoints(CGeometry *geometry, CConfig *config); + + /*! + * \brief Sort the connectivity for a single volume element type into a linear partitioning across all processors. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] Elem_Type - VTK index of the element type being merged. + * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. + */ + void SortVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type, bool val_sort); + +}; diff --git a/SU2_CFD/include/output/filewriter/CFileWriter.hpp b/SU2_CFD/include/output/filewriter/CFileWriter.hpp new file mode 100644 index 000000000000..edd3fd0d136f --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CFileWriter.hpp @@ -0,0 +1,142 @@ +/*! + * \file CFileWriter.hpp + * \brief Headers fo the file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once +#include "../../../Common/include/mpi_structure.hpp" +#include "../../../Common/include/option_structure.hpp" +#include +#include +#include +#include +#include + +#include "../../output/filewriter/CParallelDataSorter.hpp" + +using namespace std; + +class CFileWriter{ +protected: + + /*! + * \brief Vector containing the field names + */ + std::vector fieldnames; + + /*! + * \brief The physical dimension of the problem + */ + unsigned short nDim; + + /*! + * \brief The MPI rank + */ + int rank; + + /*! + * \brief The MPI size, aka the number of processors. + */ + int size; + + /*! + * \brief The file extension to be attached to the filename. + */ + std::string file_ext; + + su2double StartTime, /*!< \brief Start time for time measurement */ + StopTime , /*!< \brief Stop time for time measurement */ + UsedTime , /*!< \brief Used time for time measurement */ + Bandwidth, /*!< \brief Used bandwidth */ + file_size; /*!< \brief Size of the last written file */ + + /*! + * \brief Determine the file size + * \param[in] filename - Name of the file. + * \return + */ + inline unsigned long Determine_Filesize(std::string filename){ + struct stat stat_buf; + int rc = stat(filename.c_str(), &stat_buf); + return rc == 0 ? stat_buf.st_size : -1; + } + + /*! + * \brief Filename + */ + string fileName; + + /*! + * \brief The parallel data sorter + */ + CParallelDataSorter* dataSorter; + +public: + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] file_ext - The file extension to be attached to the filename + * \param[in] nDim - Physical dimension + */ + CFileWriter(std::vector fields, string fileName, CParallelDataSorter* dataSorter, string file_ext, unsigned short nDim); + + /*! + * \brief Destructor + */ + virtual ~CFileWriter(); + + /*! + * \brief Write sorted data to file + */ + virtual void Write_Data(){} + + /*! + * \brief Get the bandwith used for the last writing + */ + su2double Get_Bandwidth(){return Bandwidth;} + + /*! + * \brief Get the filesize of the last written file. + */ + su2double Get_Filesize(){return file_size;} + + /*! + * \brief Get the used time of the last file writing. + * \return + */ + su2double Get_UsedTime(){return UsedTime;} + +}; + diff --git a/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp b/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp new file mode 100644 index 000000000000..6d870afca6d0 --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp @@ -0,0 +1,245 @@ +/*! + * \file CParallelDataSorter.hpp + * \brief Headers fo the data sorter class. + * \author T. Albring, T. Economon + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "../../../Common/include/mpi_structure.hpp" +#include "../../../Common/include/option_structure.hpp" +#include "../../../Common/include/toolboxes/CLinearPartitioner.hpp" + +class CGeometry; +class CConfig; + +class CParallelDataSorter{ +protected: + + /*! + * \brief The MPI rank + */ + int rank; + + /*! + * \brief The MPI size, aka the number of processors. + */ + int size; + + unsigned long nGlobal_Poin_Par; //!< Global number of points without halos before sorting + unsigned long nGlobal_Elem_Par; //!< Global number of elems without halos before sorting + unsigned long nParallel_Poin; //!< Local number of points after sorting on this proc + unsigned long nParallel_Line, //!< Local number of line elements after sorting on this proc + nParallel_Tria, //!< Local number of triangle elements after sorting on this proc + nParallel_Quad, //!< Local number of quad elements after sorting on this proc + nParallel_Tetr, //!< Local number of tetrahedral elements after sorting on this proc + nParallel_Hexa, //!< Local number of hexhedral elements after sorting on this proc + nParallel_Pris, //!< Local number of prism elements after sorting on this proc + nParallel_Pyra; //!< Local number of pyramid elements after sorting on this proc + int *Conn_Line_Par; //!< Local connectivity of line elements after sorting on this proc + int *Conn_Tria_Par; //!< Local connectivity of triangle elements after sorting on this proc + int *Conn_Quad_Par; //!< Local connectivity of quad elements after sorting on this proc + int *Conn_Tetr_Par; //!< Local connectivity of tetrahedral elements after sorting on this proc + int *Conn_Hexa_Par; //!< Local connectivity of hexahedral elements after sorting on this proc + int *Conn_Pris_Par; //!< Local connectivity of prism elements after sorting on this proc + int *Conn_Pyra_Par; //!< Local connectivity of pyramid elements after sorting on this proc + + unsigned long nGlobalPoint_Sort; //!< Global number of points without halos after sorting + unsigned long nLocalPoint_Sort; //!< Local number of points without halos after sorting on this proc + + + CLinearPartitioner* linearPartitioner; //!< Linear partitioner based on the global number of points. + + unsigned short GlobalField_Counter; //!< Number of output fields + + bool connectivity_sorted; //!< Boolean to store information on whether the connectivity is sorted + + int *nPoint_Send; //!< Number of points this processor has to send to other processors + int *nPoint_Recv; //!< Number of points this processor receives from other processors + unsigned long *Index; //!< Index each point has in the send buffer + su2double *connSend; //!< Send buffer holding the data that will be send to other processors + passivedouble *passiveDoubleBuffer; //!< Buffer holding the sorted, partitioned data as passivedouble types + su2double *doubleBuffer; //!< Buffer holding the sorted, partitioned data as su2double types + /// Pointer used to allocate the memory used for ::passiveDoubleBuffer and ::doubleBuffer. + char *dataBuffer; + unsigned long *idSend; //!< Send buffer holding global indices that will be send to other processors + int nSends, //!< Number of sends + nRecvs; //!< Number of receives + + /*! + * \brief Prepare the send buffers by filling them with the global indices. + * After calling this function, the data buffer for sending can be filled with the + * ::SetUnsorted_Data() routine. + * \param[in] globalID - Vector containing the global indices of the points + */ + void PrepareSendBuffers(std::vector& globalID); + +public: + + /*! + * \brief Constructor + * \param[in] config - Pointer to the current config structure + * \param[in] nFields - Number of output fields + */ + CParallelDataSorter(CConfig *config, unsigned short nFields); + + /*! + * \brief Destructor + */ + virtual ~CParallelDataSorter(); + + /*! + * \brief Sort the output data for each grid node into a linear partitioning across all processors. + */ + virtual void SortOutputData(); + + /*! + * \brief Sort the connectivities (volume and surface) into data structures. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. + */ + virtual void SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort = true){} + + /*! + * \brief Get the number of points the local rank owns. + * \return local number of points. + */ + unsigned long GetnPoints(){return nParallel_Poin;} + + /*! + * \brief Get the number of points to sort. + * \return local number of points. + */ + unsigned long GetnLocalPointSort(){return nLocalPoint_Sort;} + + /*! + * \brief Get the global number of points (accumulated from all ranks) + * \return Global number of points. + */ + unsigned long GetnPointsGlobal(){return nGlobal_Poin_Par;} + + /*! + * \brief Get the global of elements (accumulated from all ranks and element types) + * \return Global number elements. + */ + unsigned long GetnElem(){return nGlobal_Elem_Par;} + + /*! + * \brief Get the local number of elements of a specific type that the current rank owns + * \input type - The type of element, ref GEO_TYPE + * \return Local number of elements of a specific type. + */ + unsigned long GetnElem(GEO_TYPE type); + + /*! + * \brief Get the connectivity of specific element. + * \input type - The type of element, ref GEO_TYPE + * \input iElem - The element ID + * \input iNode - The node ID + * \return the connected node. + */ + unsigned long GetElem_Connectivity(GEO_TYPE type, unsigned long iElem, unsigned long iNode); + + /*! + * \brief Beginning node ID of the linear partition owned by a specific processor. + * \input rank - the processor rank. + * \return The beginning node ID. + */ + unsigned long GetNodeBegin(unsigned short rank){return linearPartitioner->GetFirstIndexOnRank(rank);} + + /*! + * \brief Ending node ID of the linear partition owned by a specific processor. + * \input rank - the processor rank. + * \return The ending node ID. + */ + unsigned long GetNodeEnd(unsigned short rank){return linearPartitioner->GetLastIndexOnRank(rank);} + + /*! + * \brief Get the value of the linear partitioned data. + * \input iField - the output field ID. + * \input iPoint - the point ID. + * \return the value of the data field at a point. + */ + passivedouble GetData(unsigned short iField, unsigned long iPoint) {return passiveDoubleBuffer[iPoint*GlobalField_Counter + iField];} + + /*! + * \brief Get the pointer to the sorted linear partitioned data. + * \return Pointer to the sorted data. + */ + const passivedouble *GetData() {return passiveDoubleBuffer;} + + /*! + * \brief Get the global index of a point. + * \input iPoint - the point ID. + * \return Global index of a specific point. + */ + virtual unsigned long GetGlobalIndex(unsigned long iPoint){return 0;} + + /*! + * \brief Get the cumulated number of points + * \input rank - the processor rank. + * \return The cumulated number of points up to certain processor rank. + */ + unsigned long GetnPointCumulative(unsigned short rank){return linearPartitioner->GetCumulativeSizeBeforeRank(rank);} + + /*! + * \brief Get the linear number of points + * \input rank - the processor rank. + * \return The linear number of points up to certain processor rank. + */ + unsigned long GetnPointLinear(unsigned short rank){return linearPartitioner->GetSizeOnRank(rank);} + + /*! + * \brief Check whether the current connectivity is sorted (i.e. if SortConnectivity has been called) + * \return if the connectivity is sorted. + */ + bool GetConnectivitySorted(){return connectivity_sorted;} + + /*! + * \brief Set the value of a specific field at a point. + * ::PrepareSendBuffers must be called before using this function. + * + * \param[in] iPoint - ID of the point + * \param[in] iField - Index of the field + * \param[in] data - Value of the field + */ + void SetUnsorted_Data(unsigned long iPoint, unsigned short iField, su2double data){ + connSend[Index[iPoint] + iField] = data; + } + + su2double GetUnsorted_Data(unsigned long iPoint, unsigned short iField){ + return connSend[Index[iPoint] + iField]; + } +}; diff --git a/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp new file mode 100644 index 000000000000..aa59bcfde468 --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp @@ -0,0 +1,82 @@ +/*! + * \file CParaviewBinaryFileWriter.hpp + * \brief Headers fo paraview binary file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CFileWriter.hpp" + +class CParaviewBinaryFileWriter final: public CFileWriter{ + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] fileName - The name of the file + * \param[in] data_sorter - The parallel sorted data to write + */ + CParaviewBinaryFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter* data_sorter); + + /*! + * \brief Destructor + */ + ~CParaviewBinaryFileWriter() override; + + /*! + * \brief Write sorted data to file in paraview binary file format + */ + void Write_Data() override; + +private: + + /*! + * \brief Change storage of buffer from big endian to little endian + * \param buffer - Pointer to the beginning of the buffer + * \param nBytes - The size in bytes of an data entry + * \param nVar - The number of entries + */ + void SwapBytes(char *buffer, size_t nBytes, unsigned long nVar); + +}; + diff --git a/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp new file mode 100644 index 000000000000..f3a0f5f74748 --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp @@ -0,0 +1,73 @@ +/*! + * \file CParaviewFileWriter.hpp + * \brief Headers fo the paraview file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ +#pragma once + +#include "CFileWriter.hpp" + +class CParaviewFileWriter final: public CFileWriter{ + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] fileName - The name of the file + * \param[in] data_sorter - The parallel sorted data to write + */ + CParaviewFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter* data_sorter); + + /*! + * \brief Destructor + */ + ~CParaviewFileWriter() override; + + /*! + * \brief Write sorted data to file in paraview file format + * \param[in] - The name of the file + * \param[in] - The parallel sorted data to write + */ + void Write_Data() override; + +}; + diff --git a/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp new file mode 100644 index 000000000000..2e7bebc5e33b --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp @@ -0,0 +1,71 @@ +/*! + * \file CSU2BinaryFileWriter.hpp + * \brief Headers fo the SU2 binary file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once +#include "CFileWriter.hpp" + +class CSU2BinaryFileWriter final: public CFileWriter{ + + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] fileName - The name of the file + * \param[in] data_sorter - The parallel sorted data to write + */ + CSU2BinaryFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter* data_sorter); + + /*! + * \brief Destructor + */ + ~CSU2BinaryFileWriter() override; + + /*! + * \brief Write sorted data to file in SU2 binary file format + */ + void Write_Data() override; + +}; diff --git a/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp new file mode 100644 index 000000000000..4d10ff86d21c --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp @@ -0,0 +1,71 @@ +/*! + * \file CCSVFileWriter.hpp + * \brief Headers fo the CSV file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once +#include "CFileWriter.hpp" + +class CSU2FileWriter final: public CFileWriter{ + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] fileName - The name of the file + * \param[in] data_sorter - The parallel sorted data to write + */ + CSU2FileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter* data_sorter); + + /*! + * \brief Destructor + */ + ~CSU2FileWriter() override; + + /*! + * \brief Write sorted data to file in SU2 ASCII file format + */ + void Write_Data() override; + +}; + diff --git a/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp new file mode 100644 index 000000000000..b03efbc41be5 --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp @@ -0,0 +1,79 @@ +/*! + * \file CCSVFileWriter.hpp + * \brief Headers fo the CSV file writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ +#pragma once +#include "CFileWriter.hpp" + +class CSU2MeshFileWriter final: public CFileWriter{ + +private: + unsigned short iZone, //!< Index of the current zone + nZone; //!< Number of zones + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] fileName - The name of the file + * \param[in] data_sorter - The parallel sorted data to write + * \param[in] iZone - Index of the current zone + * \param[in] nZone - Number of zones + */ + CSU2MeshFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter* data_sorter, + unsigned short iZone, unsigned short nZone); + + /*! + * \brief Destructor + */ + ~CSU2MeshFileWriter() override; + + /*! + * \brief Write sorted data to file in SU2 mesh file format + * \param[in] - The name of the file + * \param[in] - The parallel sorted data to write + */ + void Write_Data() override; + +}; + diff --git a/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp new file mode 100644 index 000000000000..e04c0f58599d --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp @@ -0,0 +1,98 @@ +/*! + * \file CSurfaceFEMDataSorter.hpp + * \brief Headers fo the surface FEM data sorter class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ +#pragma once + +#include "CParallelDataSorter.hpp" +#include "CFEMDataSorter.hpp" + +class CSurfaceFEMDataSorter final: public CParallelDataSorter{ + + CFEMDataSorter* volume_sorter; //!< Pointer to the volume sorter instance + //! Structure to map the local sorted point ID to the global point ID + std::vector globalSurfaceDOFIDs; + +public: + + /*! + * \brief Constructor + * \param[in] config - Pointer to the current config structure + * \param[in] geometry - Pointer to the current geometry + * \param[in] nFields - Number of output fields + * \param[in] volume_sorter - Pointer to the corresponding volume sorter instance + */ + CSurfaceFEMDataSorter(CConfig *config, CGeometry *geometry, unsigned short nFields, CFEMDataSorter* volume_sorter); + + /*! + * \brief Destructor + */ + ~CSurfaceFEMDataSorter() override; + + /*! + * \brief Sort the output data for each grid node into a linear partitioning across all processors. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + */ + void SortOutputData() override; + + /*! + * \brief Sort the connectivities (volume and surface) into data structures used for output file writing. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] val_sort - boolean controlling whether the elements are sorted or simply loaded by their owning rank. + */ + void SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) override; + + /*! + * \brief Get the global index of a point. + * \input iPoint - the point ID. + * \return Global index of a specific point. + */ + unsigned long GetGlobalIndex(unsigned long iPoint) override { + return globalSurfaceDOFIDs[iPoint]; + } + +private: + + /*! + * \brief Sort the connectivity for a single surface element type into a linear partitioning across all processors (DG-FEM solver). + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] Elem_Type - VTK index of the element type being merged. + */ + void SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type); + +}; diff --git a/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp new file mode 100644 index 000000000000..79d8c282912a --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp @@ -0,0 +1,98 @@ +/*! + * \file CSurfaceFVMDataSorter.hpp + * \brief Headers fo the surface FVM data sorter class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ +#pragma once + +#include "CParallelDataSorter.hpp" +#include "CFVMDataSorter.hpp" + +class CSurfaceFVMDataSorter final: public CParallelDataSorter{ + + CFVMDataSorter* volume_sorter; //!< Pointer to the volume sorter instance + //! Structure to map the local sorted point ID to the global point ID + map Renumber2Global; +public: + + /*! + * \brief Constructor + * \param[in] config - Pointer to the current config structure + * \param[in] geometry - Pointer to the current geometry + * \param[in] nFields - Number of output fields + * \param[in] volume_sorter - Pointer to the corresponding volume sorter instance + */ + CSurfaceFVMDataSorter(CConfig *config, CGeometry* geometry, unsigned short nFields, CFVMDataSorter* volume_sorter); + + /*! + * \brief Destructor + */ + ~CSurfaceFVMDataSorter() override; + + /*! + * \brief Sort the output data for each grid node into a linear partitioning across all processors. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + */ + void SortOutputData() override; + + /*! + * \brief Sort the connectivities (volume and surface) into data structures used for output file writing. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] surf - boolean controlling whether surface or volume connectivity should be sorted. + */ + void SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) override; + + /*! + * \brief Get the global index of a point. + * \input iPoint - the point ID. + * \return Global index of a specific point. + */ + unsigned long GetGlobalIndex(unsigned long iPoint) override{ + return Renumber2Global[iPoint]; + } + + +private: + + /*! + * \brief Sort the connectivity for a single surface element type into a linear partitioning across all processors. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] Elem_Type - VTK index of the element type being merged. + */ + void SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type); + +}; diff --git a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp new file mode 100644 index 000000000000..8c0a93ecc5ef --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp @@ -0,0 +1,143 @@ +/*! + * \file CTecplotBinaryFileWriter.hpp + * \brief Headers fo the tecplot binary writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CFileWriter.hpp" + +#include + +class CTecplotBinaryFileWriter final: public CFileWriter{ + + unsigned long time_iter; //!< Current value of the time iteration + su2double timestep; //!< Current value of the time step + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] fileName - The name of the file + * \param[in] data_sorter - The parallel sorted data to write + */ + CTecplotBinaryFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter* data_sorter, + unsigned long time_iter, su2double timestep); + + /*! + * \brief Destructor + */ + ~CTecplotBinaryFileWriter() override; + + /*! + * \brief Write sorted data to file in tecplot binary file format + * \param[in] - The name of the file + * \param[in] - The parallel sorted data to write + */ + void Write_Data() override; + + /*! + * \brief Calculate the partitioning of nodes to determine: + * (a) For a given global node number, to which partition does it belong and what is its local node number; and + * (b) How many nodes are held by each partition. + */ + class NodePartitioner { + public: + /*! + * \param[in] global_num_nodes - The total number of nodes being output + * \param[in] num_ranks - The number of MPI ranks involved in the output + */ + NodePartitioner(unsigned long global_num_nodes, int num_ranks) + : m_num_ranks(num_ranks) { + /* rank i has (1-based) global nodes m_node_range[i] + 1 through m_node_range[i + 1] */ + unsigned long nodes_per_rank = global_num_nodes / num_ranks; + unsigned long num_extra_nodes = global_num_nodes - nodes_per_rank * num_ranks; + m_node_range.resize(num_ranks + 1); + m_node_range[0] = 0; + for (int ii = 1; ii <= num_ranks; ii++) { + m_node_range[ii] = m_node_range[ii - 1] + nodes_per_rank; + if (num_extra_nodes > 0) { + ++m_node_range[ii]; + --num_extra_nodes; + } + } + assert(m_node_range[num_ranks] == global_num_nodes); + } + + /*! + * \brief Determine the MPI rank that owns a global node number and its corresponding local node number. + * \param global_node_number[in] - The global node number; global node numbers are sequential across all MPI ranks. + * \param owning_rank[out] - The MPI rank that owns (will output) the global node + * \param node_number[out] - The rank-local node number for the given global node number + */ + void GetOwningRankAndNodeNumber(unsigned long global_node_number, int &owning_rank, unsigned long &node_number) + { + owning_rank = static_cast(global_node_number / m_node_range[1]); + if (owning_rank >= m_num_ranks) + owning_rank = m_num_ranks - 1; + while(global_node_number > m_node_range[owning_rank + 1]) + ++owning_rank; + while(global_node_number <= m_node_range[owning_rank]) + --owning_rank; + node_number = global_node_number - m_node_range[owning_rank]; + } + + /*! + * \brief Determine the number of nodes to be output by a particular rank + * \param which_rank[in] - The MPI rank + * \ret - The number of nodes that will be output by the give MPI rank. + */ + int64_t GetRankNumNodes(int which_rank) + { + return static_cast(m_node_range[which_rank + 1] - m_node_range[which_rank]); + } + + private: + int m_num_ranks; + vector m_node_range; + }; + + int64_t GetHaloNodeNumber(unsigned long global_node_number, unsigned long last_local_node, vector const &halo_node_list); + +}; + diff --git a/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp new file mode 100644 index 000000000000..8884eab01502 --- /dev/null +++ b/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp @@ -0,0 +1,75 @@ +/*! + * \file CTecplotFileWriter.hpp + * \brief Headers fo the tecplot ASCII writer class. + * \author T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once +#include "CFileWriter.hpp" + +class CTecplotFileWriter final: public CFileWriter{ + + unsigned long time_iter; //!< Current value of the time iteration + su2double timestep; //!< Current value of the time step + +public: + + /*! + * \brief File extension + */ + const static string fileExt; + + /*! + * \brief Construct a file writer using field names, file extension and dimension. + * \param[in] fields - A list of field names + * \param[in] nDim - Physical dimension + * \param[in] - The name of the file + * \param[in] - The parallel sorted data to write + */ + CTecplotFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter, + unsigned long time_iter, su2double timestep); + + /*! + * \brief Destructor + */ + ~CTecplotFileWriter() override; + + /*! + * \brief Write sorted data to file in tecplot ASCII file format + */ + void Write_Data() override; + +}; + diff --git a/SU2_CFD/include/output_structure.inl b/SU2_CFD/include/output/output_structure_legacy.inl similarity index 69% rename from SU2_CFD/include/output_structure.inl rename to SU2_CFD/include/output/output_structure_legacy.inl index a4673cccd091..f9495746c4e4 100644 --- a/SU2_CFD/include/output_structure.inl +++ b/SU2_CFD/include/output/output_structure_legacy.inl @@ -1,8 +1,8 @@ /*! * \file output_structure.inl - * \brief In-Line subroutines of the output_structure.hpp file. + * \brief In-Line subroutines of the output.hpp file. * \author J. Smith - * \version 6.2.0 "Falcon" + * \version 6.1.0 "Falcon" * * The current SU2 release has been coordinated by the * SU2 International Developers Society @@ -18,7 +18,7 @@ * - Prof. Edwin van der Weide's group at the University of Twente. * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, * Tim Albring, and the SU2 contributors. * * SU2 is free software; you can redistribute it and/or @@ -37,10 +37,10 @@ #pragma once -inline su2double COutput::GetEntropyGen(unsigned short iMarkerTP, unsigned short iSpan) { return EntropyGen[iMarkerTP][iSpan]; } +inline su2double COutputLegacy::GetEntropyGen(unsigned short iMarkerTP, unsigned short iSpan) { return EntropyGen[iMarkerTP][iSpan]; } -inline su2double COutput::GetFlowAngleOut(unsigned short iMarkerTP, unsigned short iSpan) { return FlowAngleOut[iMarkerTP][iSpan]*180.0/PI_NUMBER; } +inline su2double COutputLegacy::GetFlowAngleOut(unsigned short iMarkerTP, unsigned short iSpan) { return FlowAngleOut[iMarkerTP][iSpan]*180.0/PI_NUMBER; } -inline su2double COutput::GetMassFlowIn(unsigned short iMarkerTP, unsigned short iSpan) { return MassFlowIn[iMarkerTP][iSpan]; } +inline su2double COutputLegacy::GetMassFlowIn(unsigned short iMarkerTP, unsigned short iSpan) { return MassFlowIn[iMarkerTP][iSpan]; } -inline bool COutput::PrintOutput(unsigned long iIter, unsigned long iFreq) { return (iIter % iFreq == 0); } \ No newline at end of file +inline bool COutputLegacy::PrintOutput(unsigned long iIter, unsigned long iFreq) { return (iIter % iFreq == 0); } diff --git a/SU2_CFD/include/solver_structure.hpp b/SU2_CFD/include/solver_structure.hpp index e9ba63fa2743..89d5061bcc5c 100644 --- a/SU2_CFD/include/solver_structure.hpp +++ b/SU2_CFD/include/solver_structure.hpp @@ -145,7 +145,7 @@ class CSolver { unsigned long maxCol_InletFile; /*!< \brief Auxiliary structure for holding the maximum number of columns in all inlet marker profiles (for data structure size) */ unsigned long *nCol_InletFile; /*!< \brief Auxiliary structure for holding the number of columns for a particular marker in an inlet profile file. */ passivedouble *Inlet_Data; /*!< \brief Auxiliary structure for holding the data values from an inlet profile file. */ - + bool rotate_periodic; /*!< \brief Flag that controls whether the periodic solution needs to be rotated for the solver. */ bool implicit_periodic; /*!< \brief Flag that controls whether the implicit system should be treated by the periodic BC comms. */ @@ -153,7 +153,11 @@ class CSolver { su2double ***VertexTraction; /*- Temporary, this will be moved to a new postprocessing structure once in place -*/ su2double ***VertexTractionAdjoint; /*- Also temporary -*/ - + + string SolverName; /*!< \brief Store the name of the solver for output purposes. */ + + su2double valResidual; /*!< \brief Store the residual of the linear system solution. */ + public: CSysVector LinSysSol; /*!< \brief vector to store iterative solution of implicit linear system. */ @@ -176,7 +180,8 @@ class CSolver { CVariable* node_infty; /*!< \brief CVariable storing the free stream conditions. */ CVerificationSolution *VerificationSolution; /*!< \brief Verification solution class used within the solver. */ - + + vector fields; /*! * \brief Constructor of the class. */ @@ -3611,7 +3616,7 @@ class CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - Physical iteration number. */ - void Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometry, CConfig *config, unsigned long ExtIter); + void Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometry, CConfig *config, unsigned long TimeIter); /*! * \brief Sets up the generalized eigenvectors and eigenvalues needed to solve the aeroelastic equations. @@ -4352,7 +4357,19 @@ class CSolver { * \param[in] val_implicit_periodic - Flag controlling solution rotation for periodic BCs. */ void SetRotatePeriodic(bool val_rotate_periodic); + + /*! + * \brief Retrieve the solver name for output purposes. + * \param[out] val_solvername - Name of the solver. + */ + string GetSolverName(void); + /*! + * \brief Get the solution fields. + * \return A vector containing the solution fields. + */ + vector GetSolutionFields(); + /*! * \brief A virtual member. * \param[in] geometry - Geometrical definition. @@ -4442,6 +4459,24 @@ class CSolver { */ void SetVertexTractionsAdjoint(CGeometry *geometry, CConfig *config); + /*! + * \brief Get minimun volume in the mesh + * \return + */ + virtual su2double GetMinimum_Volume(){ return 0.0; } + + /*! + * \brief Get maximum volume in the mesh + * \return + */ + virtual su2double GetMaximum_Volume(){ return 0.0; } + + /*! + * \brief Get residual of the linear solver + * \return + */ + su2double GetLinSol_Residual(){ return valResidual; } + protected: /*! * \brief Allocate the memory for the verification solution, if necessary. @@ -4460,6 +4495,7 @@ class CSolver { * \author F. Palacios, T. Economon. */ class CBaselineSolver : public CSolver { + public: /*! @@ -4481,7 +4517,7 @@ class CBaselineSolver : public CSolver { * \param[in] nVar - Number of variables. * \param[in] field_names - Vector of variable names. */ - CBaselineSolver(CGeometry *geometry, CConfig *config, unsigned short nVar, vector field_names); + CBaselineSolver(CGeometry *geometry, CConfig *config, unsigned short val_nvar, vector field_names); /*! * \brief Destructor of the class. @@ -4512,7 +4548,7 @@ class CBaselineSolver : public CSolver { * \param[in] config - Definition of the particular problem. */ void SetOutputVariables(CGeometry *geometry, CConfig *config); - + }; /*! @@ -6523,18 +6559,6 @@ class CEulerSolver : public CSolver { void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - /*! - * \brief Set the value of the max residual and RMS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); - /*! * \brief Load a solution from a restart file. * \param[in] geometry - Geometrical definition of the problem. @@ -6584,7 +6608,7 @@ class CEulerSolver : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - External iteration. */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter); + void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); /*! * \brief Set the freestream pressure. @@ -8165,18 +8189,6 @@ class CIncEulerSolver : public CSolver { void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - /*! - * \brief Set the value of the max residual and BGS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); - /*! * \brief Load a solution from a restart file. * \param[in] geometry - Geometrical definition of the problem. @@ -8194,7 +8206,7 @@ class CIncEulerSolver : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - External iteration. */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter); + void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); /*! * \brief Set the freestream pressure. @@ -10773,7 +10785,7 @@ class CAdjEulerSolver : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - External iteration. */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter); + void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); /*! * \brief Load a solution from a restart file. @@ -11313,7 +11325,7 @@ class CWaveSolver : public CSolver { class CHeatSolverFVM : public CSolver { protected: unsigned short nVarFlow, nMarker, CurrentMesh; - su2double *Heat_Flux, *Surface_HF, Total_HeatFlux, AllBound_HeatFlux, + su2double **HeatFlux, *Surface_HF, Total_HeatFlux, AllBound_HeatFlux, *AvgTemperature, Total_AvgTemperature, AllBound_AvgTemperature, *Primitive, *Primitive_Flow_i, *Primitive_Flow_j, *Surface_Areas, Total_HeatFlux_Areas, Total_HeatFlux_Areas_Monitor; @@ -11548,7 +11560,7 @@ class CHeatSolverFVM : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - External iteration. */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter); + void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); /*! * \brief Set the total residual adding the term that comes from the Dual Time-Stepping Strategy. @@ -11561,12 +11573,15 @@ class CHeatSolverFVM : public CSolver { */ void SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem); - + /*! - * \brief Set the value of the max residual and BGS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. + * \brief Get the heat flux. + * \param[in] val_marker - Surface marker where the coefficient is computed. + * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. + * \return Value of the heat flux. */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); + su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex); + }; /*! \class CFEASolver @@ -11650,8 +11665,6 @@ class CFEASolver : public CSolver { su2double *Res_Stress_i; /*!< \brief Submatrix to store the nodal stress contribution of node i. */ - su2double valResidual; /*!< \brief Store the residual of the linear system solution. */ - public: CSysVector TimeRes_Aux; /*!< \brief Auxiliary vector for adding mass and damping contributions to the residual. */ @@ -11702,7 +11715,7 @@ class CFEASolver : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - External iteration. */ - void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter); + void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); /*! * \brief Reset the initial condition for the FEM structural problem. @@ -11711,7 +11724,7 @@ class CFEASolver : public CSolver { * \param[in] config - Definition of the particular problem. * \param[in] ExtIter - External iteration. */ - void ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter); + void ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter); /*! * \brief Compute the time step for solving the FEM equations. @@ -12243,18 +12256,6 @@ class CFEASolver : public CSolver { */ su2double Get_MassMatrix(unsigned long iPoint, unsigned long jPoint, unsigned short iVar, unsigned short jVar); - /*! - * \brief Set the value of the max residual and BGS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); - /*! * \brief Load a solution from a restart file. * \param[in] geometry - Geometrical definition of the problem. @@ -12784,17 +12785,8 @@ class CDiscAdjSolver : public CSolver { */ void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); - /*! - * \brief Set the value of the max residual and RMS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); }; /*! @@ -13081,18 +13073,6 @@ class CDiscAdjFEASolver : public CSolver { * \return Pointer to the values of the design variables */ su2double GetVal_DVFEA(unsigned short iVal); - - /*! - * \brief Set the value of the max residual and RMS residual. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); - - /*! - * \brief Store the BGS solution in the previous subiteration in the corresponding vector. - * \param[in] val_iterlinsolver - Number of linear iterations. - */ - void UpdateSolution_BGS(CGeometry *geometry, CConfig *config); /*! * \brief Prepare the solver for a new recording. @@ -13145,6 +13125,8 @@ class CDiscAdjFEASolver : public CSolver { */ void LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo); + void ComputeResidual_Multizone(CGeometry *geometry, CConfig *config); + }; /*! @@ -13512,7 +13494,7 @@ class CFEM_DG_EulerSolver : public CSolver { * \param[in] ExtIter - External iteration. */ void SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, - CConfig *config, unsigned long ExtIter); + CConfig *config, unsigned long TimeIter); /*! * \brief Set the working solution of the first time level to the current diff --git a/SU2_CFD/include/solver_structure.inl b/SU2_CFD/include/solver_structure.inl index 28e9c0921f43..39adf5cc107d 100644 --- a/SU2_CFD/include/solver_structure.inl +++ b/SU2_CFD/include/solver_structure.inl @@ -48,9 +48,9 @@ inline su2double CSolver::GetCSensitivity(unsigned short val_marker, unsigned lo inline void CSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, unsigned short iMesh, unsigned short RunTime_EqSystem) { } -inline void CSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { } +inline void CSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { } -inline void CSolver::ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { } +inline void CSolver::ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { } inline void CSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { } @@ -904,10 +904,6 @@ inline void CSolver::AddRes_Max(unsigned short val_var, su2double val_residual, inline su2double CSolver::GetRes_Max(unsigned short val_var) { return Residual_Max[val_var]; } -inline void CSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config) { } - -inline void CSolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config) { } - inline void CSolver::SetRes_BGS(unsigned short val_var, su2double val_residual) { Residual_BGS[val_var] = val_residual; } inline void CSolver::AddRes_BGS(unsigned short val_var, su2double val_residual) { Residual_BGS[val_var] += val_residual; } @@ -1162,6 +1158,8 @@ inline void CSolver::SetImplicitPeriodic(bool val_implicit_periodic) { implicit_ inline void CSolver::SetRotatePeriodic(bool val_rotate_periodic) { rotate_periodic = val_rotate_periodic; } +inline string CSolver::GetSolverName(void) {return SolverName;} + inline su2double CEulerSolver::GetDensity_Inf(void) { return Density_Inf; } inline su2double CEulerSolver::GetModVelocity_Inf(void) { @@ -2263,6 +2261,8 @@ inline void CIncNSSolver::SetConjugateHeatVariable(unsigned short val_marker, un inline su2double CHeatSolverFVM::GetTotal_HeatFlux() { return Total_HeatFlux; } +inline su2double CHeatSolverFVM::GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) { return HeatFlux[val_marker][val_vertex]; } + inline su2double CHeatSolverFVM::GetTotal_AvgTemperature() { return Total_AvgTemperature; } inline su2double CHeatSolverFVM::GetConjugateHeatVariable(unsigned short val_marker, unsigned long val_vertex, unsigned short pos_var) { return ConjugateVar[val_marker][val_vertex][pos_var]; } @@ -2508,3 +2508,5 @@ inline su2double CDiscAdjFEASolver::GetVal_EField(unsigned short iVal) { return inline su2double CDiscAdjFEASolver::GetVal_DVFEA(unsigned short iVal) { return DV_Val[iVal]; } inline void CSolver::SetDualTime_Mesh(void){ } + +inline vector CSolver::GetSolutionFields(){return fields;} diff --git a/SU2_CFD/include/solvers/CMeshSolver.hpp b/SU2_CFD/include/solvers/CMeshSolver.hpp index fbc32516efce..614fbe06a50f 100644 --- a/SU2_CFD/include/solvers/CMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CMeshSolver.hpp @@ -189,4 +189,16 @@ class CMeshSolver : public CFEASolver { node[iPoint]->Set_OldSolution(); } + /*! + * \brief Get minimun volume in the mesh + * \return + */ + su2double GetMinimum_Volume(){return MinVolume_Curr;} + + /*! + * \brief Get maximum volume in the mesh + * \return + */ + su2double GetMaximum_Volume(){return MaxVolume_Curr;} + }; diff --git a/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp b/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp index d1b5ae09b301..60e7a43b6b1d 100644 --- a/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjFEAVariable.hpp @@ -67,7 +67,6 @@ class CDiscAdjFEAVariable : public CVariable { su2double* Geometry_CrossTerm_Derivative; su2double* Solution_BGS; - su2double* Solution_BGS_k; public: /*! @@ -265,26 +264,12 @@ class CDiscAdjFEAVariable : public CVariable { */ inline void Set_BGSSolution(unsigned short iDim, su2double val_solution) {Solution_BGS[iDim] = val_solution;} - /*! - * \brief Set the value of the adjoint solution in the previous BGS subiteration. - */ - inline void Set_BGSSolution_k(void) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Solution_BGS_k[iDim] = Solution_BGS[iDim]; - } - /*! * \brief Get the value of the adjoint solution in the previous BGS subiteration. * \param[out] val_solution - adjoint solution in the previous BGS subiteration. */ inline su2double Get_BGSSolution(unsigned short iDim) {return Solution_BGS[iDim];} - /*! - * \brief Get the value of the adjoint solution in the previous BGS subiteration. - * \param[out] val_solution - adjoint solution in the previous BGS subiteration. - */ - inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} - /*! * \brief Get whether this node is on the boundary */ diff --git a/SU2_CFD/include/variables/CDiscAdjVariable.hpp b/SU2_CFD/include/variables/CDiscAdjVariable.hpp index a99d40f77696..8fe1a4a04821 100644 --- a/SU2_CFD/include/variables/CDiscAdjVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjVariable.hpp @@ -61,7 +61,6 @@ class CDiscAdjVariable : public CVariable { su2double* Geometry_Direct; su2double* Solution_BGS; - su2double* Solution_BGS_k; su2double* Solution_Geometry_BGS_k; public: @@ -204,25 +203,12 @@ class CDiscAdjVariable : public CVariable { */ inline void Set_BGSSolution(unsigned short iDim, su2double val_solution) {Solution_BGS[iDim] = val_solution;} - /*! - * \brief Set the value of the adjoint solution in the previous BGS subiteration. - */ - inline void Set_BGSSolution_k(void) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) Solution_BGS_k[iVar] = Solution_BGS[iVar]; - } - /*! * \brief Get the value of the adjoint solution in the previous BGS subiteration. * \param[out] val_solution - adjoint solution in the previous BGS subiteration. */ inline su2double Get_BGSSolution(unsigned short iDim) {return Solution_BGS[iDim];} - /*! - * \brief Get the value of the adjoint solution in the previous BGS subiteration. - * \param[out] val_solution - adjoint solution in the previous BGS subiteration. - */ - inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} - /*! * \brief Set the value of the adjoint geometry solution in the previous BGS subiteration. */ diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp index cf23d4b39007..b6d191877ea2 100644 --- a/SU2_CFD/include/variables/CEulerVariable.hpp +++ b/SU2_CFD/include/variables/CEulerVariable.hpp @@ -69,9 +69,6 @@ class CEulerVariable : public CVariable { su2double *Solution_New; - /*--- Old solution container for BGS iterations ---*/ - su2double* Solution_BGS_k; - public: /*! @@ -516,17 +513,4 @@ class CEulerVariable : public CVariable { WindGustDer[iDim] = val_WindGustDer[iDim]; } - /*! - * \brief Set the value of the solution in the previous BGS subiteration. - */ - inline void Set_BGSSolution_k(void) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) - Solution_BGS_k[iVar] = Solution[iVar]; - } - - /*! - * \brief Get the value of the solution in the previous BGS subiteration. - * \param[out] val_solution - solution in the previous BGS subiteration. - */ - inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} }; diff --git a/SU2_CFD/include/variables/CFEAVariable.hpp b/SU2_CFD/include/variables/CFEAVariable.hpp index c2d636153b25..7412420f93be 100644 --- a/SU2_CFD/include/variables/CFEAVariable.hpp +++ b/SU2_CFD/include/variables/CFEAVariable.hpp @@ -68,9 +68,6 @@ class CFEAVariable : public CVariable { su2double *Prestretch; /*!< \brief Prestretch geometry */ - su2double* Solution_BGS_k; /*!< \brief Old solution container for BGS iterations ---*/ - - public: /*! @@ -492,18 +489,4 @@ class CFEAVariable : public CVariable { adj_sol[iVar] = SU2_TYPE::GetDerivative(Solution_Accel_time_n[iVar]); } - /*! - * \brief Set the value of the solution in the previous BGS subiteration. - */ - inline void Set_BGSSolution_k(void) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) - Solution_BGS_k[iVar] = Solution[iVar]; - } - - /*! - * \brief Get the value of the solution in the previous BGS subiteration. - * \param[out] val_solution - solution in the previous BGS subiteration. - */ - inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} - }; diff --git a/SU2_CFD/include/variables/CHeatFVMVariable.hpp b/SU2_CFD/include/variables/CHeatFVMVariable.hpp index c9d50f05b6af..dd9db20e9460 100644 --- a/SU2_CFD/include/variables/CHeatFVMVariable.hpp +++ b/SU2_CFD/include/variables/CHeatFVMVariable.hpp @@ -48,7 +48,6 @@ class CHeatFVMVariable : public CVariable { protected: su2double* Solution_Direct; /*!< \brief Direct solution container for use in the adjoint Heat solver. */ - su2double* Solution_BGS_k; /*!< \brief Old solution container for BGS iterations ---*/ public: diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index 11f77fa8a026..b50554ddcd51 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -55,10 +55,6 @@ class CIncEulerVariable : public CVariable { su2double **Gradient_Primitive; /*!< \brief Gradient of the primitive variables (T, vx, vy, vz, P, rho). */ su2double *Limiter_Primitive; /*!< \brief Limiter of the primitive variables (T, vx, vy, vz, P, rho). */ - /*--- Old solution container for BGS iterations ---*/ - - su2double* Solution_BGS_k; - /*--- Old density for variable density turbulent flows (SST). ---*/ su2double Density_Old; @@ -315,18 +311,4 @@ class CIncEulerVariable : public CVariable { */ inline su2double GetSpecificHeatCv(void) {return Primitive[nDim+8]; } - /*! - * \brief Set the value of the solution in the previous BGS subiteration. - */ - inline void Set_BGSSolution_k(void) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) - Solution_BGS_k[iVar] = Solution[iVar]; - } - - /*! - * \brief Get the value of the solution in the previous BGS subiteration. - * \param[out] val_solution - solution in the previous BGS subiteration. - */ - inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} - }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 74a8a5fcc5f6..b131948923cb 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -93,6 +93,8 @@ class CVariable { have different number of nVar in the same problem. */ su2double *Solution_Adj_Old; /*!< \brief Solution of the problem in the previous AD-BGS iteration. */ + su2double *Solution_BGS_k; + public: /*! @@ -672,6 +674,14 @@ class CVariable { */ inline su2double GetRmatrix(unsigned short val_iDim, unsigned short val_jDim) {return Rmatrix[val_iDim][val_jDim]; } + /*! + * \brief Get the value of the Rmatrix entry for least squares gradient calculations. + * \param[in] val_iDim - Index of the dimension. + * \param[in] val_jDim - Index of the dimension. + * \return Value of the Rmatrix entry. + */ + inline su2double **GetRmatrix(void) {return Rmatrix; } + /*! * \brief Set the value of the limiter. * \param[in] val_var - Index of the variable. @@ -2010,27 +2020,37 @@ class CVariable { */ inline virtual su2double Get_OldSolution_Geometry(unsigned short iDim) {return 0.0;} - /*! + /*! * \brief A virtual member. Set the value of the old geometry solution (adjoint). */ inline virtual void Set_BGSSolution(unsigned short iDim, su2double val_solution) {} /*! - * \brief A virtual member. Set the value of the old geometry solution (adjoint). + * \brief Set the value of the solution in the previous BGS subiteration. */ - inline virtual void Set_BGSSolution_k(void) {} + inline void Set_BGSSolution_k(void) { + for (unsigned short iVar = 0; iVar < nVar; iVar++) + Solution_BGS_k[iVar] = Solution[iVar]; + } + + /*! + * \brief Set the value of the solution in the previous BGS subiteration. + */ + inline void Set_BGSSolution_k(unsigned short iVar, su2double val_var) { + Solution_BGS_k[iVar] = val_var; + } /*! - * \brief A virtual member. Get the value of the old geometry solution (adjoint). - * \param[out] val_solution - old adjoint solution for coordinate iDim + * \brief Get the value of the solution in the previous BGS subiteration. + * \param[out] val_solution - solution in the previous BGS subiteration. */ - inline virtual su2double Get_BGSSolution(unsigned short iDim) {return 0.0;} + inline su2double Get_BGSSolution_k(unsigned short iDim) {return Solution_BGS_k[iDim];} /*! * \brief A virtual member. Get the value of the old geometry solution (adjoint). * \param[out] val_solution - old adjoint solution for coordinate iDim */ - inline virtual su2double Get_BGSSolution_k(unsigned short iDim) {return 0.0;} + inline virtual su2double Get_BGSSolution(unsigned short iDim) {return 0.0;} /*! * \brief A virtual member. Set the value of the old geometry solution (adjoint). diff --git a/SU2_CFD/obj/Makefile.am b/SU2_CFD/obj/Makefile.am index 774bca265f81..1860eacd7947 100644 --- a/SU2_CFD/obj/Makefile.am +++ b/SU2_CFD/obj/Makefile.am @@ -85,13 +85,36 @@ libSU2Core_sources = ../src/definition_structure.cpp \ ../src/numerics/CFEAMeshElasticity.cpp \ ../src/numerics_structure.cpp \ ../src/numerics_template.cpp \ - ../src/output_cgns.cpp \ - ../src/output_structure.cpp \ - ../src/output_physics.cpp \ - ../src/output_tecplot.cpp \ - ../src/output_fieldview.cpp \ - ../src/output_su2.cpp \ - ../src/output_paraview.cpp \ + ../src/output/filewriter/CCSVFileWriter.cpp \ + ../src/output/filewriter/CFEMDataSorter.cpp \ + ../src/output/filewriter/CFVMDataSorter.cpp \ + ../src/output/filewriter/CParallelDataSorter.cpp \ + ../src/output/filewriter/CParallelFileWriter.cpp \ + ../src/output/filewriter/CParaviewBinaryFileWriter.cpp \ + ../src/output/filewriter/CParaviewFileWriter.cpp \ + ../src/output/filewriter/CSurfaceFEMDataSorter.cpp \ + ../src/output/filewriter/CSurfaceFVMDataSorter.cpp \ + ../src/output/filewriter/CSU2BinaryFileWriter.cpp \ + ../src/output/filewriter/CSU2FileWriter.cpp \ + ../src/output/filewriter/CSU2MeshFileWriter.cpp \ + ../src/output/filewriter/CTecplotFileWriter.cpp \ + ../src/output/filewriter/CTecplotBinaryFileWriter.cpp \ + ../src/output/COutput.cpp \ + ../src/output/output_physics.cpp \ + ../src/output/CMeshOutput.cpp \ + ../src/output/CElasticityOutput.cpp \ + ../src/output/CFlowOutput.cpp \ + ../src/output/CFlowCompOutput.cpp \ + ../src/output/CFlowCompFEMOutput.cpp \ + ../src/output/CFlowIncOutput.cpp \ + ../src/output/CHeatOutput.cpp \ + ../src/output/CBaselineOutput.cpp \ + ../src/output/CAdjElasticityOutput.cpp \ + ../src/output/CAdjHeatOutput.cpp \ + ../src/output/CAdjFlowCompOutput.cpp \ + ../src/output/CAdjFlowIncOutput.cpp \ + ../src/output/CMultizoneOutput.cpp \ + ../src/output/output_structure_legacy.cpp \ ../src/python_wrapper_structure.cpp \ ../src/solver_adjoint_mean.cpp \ ../src/solver_adjoint_turbulent.cpp \ diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index dc12cdfaeefe..7f94c3c0125f 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { "Only execute preprocessing steps using a dummy geometry."); app.add_option("configfile", filename, "A config file.")->check(CLI::ExistingFile); - CLI11_PARSE(app, argc, argv); + CLI11_PARSE(app, argc, argv) /*--- MPI initialization, and buffer setting ---*/ @@ -110,7 +110,7 @@ int main(int argc, char *argv[]) { if (!dry_run){ if (((config->GetSinglezone_Driver() || (nZone == 1 && config->GetDiscrete_Adjoint())) - && config->GetUnsteady_Simulation() != HARMONIC_BALANCE && (!turbo)) || (turbo && config->GetDiscrete_Adjoint())) { + && config->GetTime_Marching() != HARMONIC_BALANCE && (!turbo)) || (turbo && config->GetDiscrete_Adjoint())) { /*--- Single zone problem: instantiate the single zone driver class. ---*/ @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) { driver = new CMultizoneDriver(config_file_name, nZone, MPICommunicator); - } else if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + } else if (config->GetTime_Marching() == HARMONIC_BALANCE) { /*--- Harmonic balance problem: instantiate the Harmonic Balance driver class. ---*/ @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) { } else if ((nZone == 2) && fsi) { - bool stat_fsi = ((config->GetDynamic_Analysis() == STATIC) && (config->GetUnsteady_Simulation() == STEADY)); + bool stat_fsi = ((!config->GetTime_Domain())); bool disc_adj_fsi = (config->GetDiscrete_Adjoint()); /*--- If the problem is a discrete adjoint FSI problem ---*/ @@ -150,10 +150,6 @@ int main(int argc, char *argv[]) { SU2_MPI::Error("WARNING: There is no discrete adjoint implementation for dynamic FSI. ", CURRENT_FUNCTION); } } - /*--- If the problem is a direct FSI problem ---*/ - else{ - driver = new CFSIDriver(config_file_name, nZone, MPICommunicator); - } } else { diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 912aa50da10f..dd2e72eaa086 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -45,7 +45,8 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, /*--- Store the number of internal iterations that will be run by the adjoint solver ---*/ - nAdjoint_Iter = config_container[ZONE_0]->GetnIter(); + nAdjoint_Iter = config_container[ZONE_0]->GetnInner_Iter(); + /*--- Store the pointers ---*/ config = config_container[ZONE_0]; @@ -60,6 +61,8 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, /*--- Determine if the problem is a turbomachinery problem ---*/ bool turbo = config->GetBoolTurbomachinery(); + + bool compressible = config->GetKind_Regime() == COMPRESSIBLE; /*--- Determine if the problem has a mesh deformation solver ---*/ bool mesh_def = config->GetDeform_Mesh(); @@ -72,8 +75,13 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS: if (rank == MASTER_NODE) cout << "Direct iteration: Euler/Navier-Stokes/RANS equation." << endl; - if (turbo) direct_iteration = new CTurboIteration(config); + if (turbo) { + direct_iteration = new CTurboIteration(config); + output_legacy = new COutputLegacy(config_container[ZONE_0]); + } else direct_iteration = new CFluidIteration(config); + if (compressible) direct_output = new CFlowCompOutput(config, nDim); + else direct_output = new CFlowIncOutput(config, nDim); MainVariables = FLOW_CONS_VARS; if (mesh_def) SecondaryVariables = MESH_DEFORM; else SecondaryVariables = MESH_COORDS; @@ -83,6 +91,7 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, if (rank == MASTER_NODE) cout << "Direct iteration: Euler/Navier-Stokes/RANS equation." << endl; direct_iteration = new CFEMFluidIteration(config); + direct_output = new CFlowCompFEMOutput(config, nDim); MainVariables = FLOW_CONS_VARS; SecondaryVariables = MESH_COORDS; break; @@ -91,6 +100,7 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, if (rank == MASTER_NODE) cout << "Direct iteration: elasticity equation." << endl; direct_iteration = new CFEAIteration(config); + direct_output = new CElasticityOutput(config, nDim); MainVariables = FEA_DISP_VARS; SecondaryVariables = NONE; break; @@ -99,11 +109,14 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, if (rank == MASTER_NODE) cout << "Direct iteration: heat equation." << endl; direct_iteration = new CHeatIteration(config); + direct_output = new CHeatOutput(config, nDim); MainVariables = FLOW_CONS_VARS; SecondaryVariables = MESH_COORDS; break; } + + direct_output->PreprocessHistoryOutput(config, false); } @@ -112,17 +125,14 @@ CDiscAdjSinglezoneDriver::~CDiscAdjSinglezoneDriver(void) { } void CDiscAdjSinglezoneDriver::Preprocess(unsigned long TimeIter) { - - /*--- Set the value of the external iteration to TimeIter. -------------------------------------*/ - /*--- TODO: This should be generalised for an homogeneous criteria throughout the code. --------*/ - - config_container[ZONE_0]->SetExtIter(TimeIter); + + config_container[ZONE_0]->SetTimeIter(TimeIter); /*--- NOTE: Inv Design Routines moved to CDiscAdjFluidIteration::Preprocess ---*/ /*--- Preprocess the adjoint iteration ---*/ - iteration->Preprocess(output, integration_container, geometry_container, + iteration->Preprocess(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); @@ -148,9 +158,7 @@ void CDiscAdjSinglezoneDriver::Run() { *--- of the previous iteration. The values are passed to the AD tool. *--- Issues with iteration number should be dealt with once the output structure is in place. ---*/ - config->SetIntIter(Adjoint_Iter); - if(!config->GetTime_Domain() && (MainVariables == FLOW_CONS_VARS)) - config->SetExtIter(Adjoint_Iter); + config->SetInnerIter(Adjoint_Iter); iteration->InitializeAdjoint(solver_container, geometry_container, config_container, ZONE_0, INST_0); @@ -164,23 +172,19 @@ void CDiscAdjSinglezoneDriver::Run() { /*--- Extract the computed adjoint values of the input variables and store them for the next iteration. ---*/ - iteration->Iterate(output, integration_container, geometry_container, + iteration->Iterate(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Monitor the pseudo-time ---*/ - StopCalc = iteration->Monitor(output, integration_container, geometry_container, + StopCalc = iteration->Monitor(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Clear the stored adjoint information to be ready for a new evaluation. ---*/ AD::ClearAdjoints(); - - if (config->GetTime_Domain()) - output->SetConvHistory_Body(NULL, geometry_container, solver_container, config_container, integration_container, - true, 0.0, ZONE_0, INST_0); - + if (StopCalc) break; } @@ -201,7 +205,7 @@ void CDiscAdjSinglezoneDriver::Postprocess() { case DISC_ADJ_FEM : /*--- Apply the boundary condition to clamped nodes ---*/ - iteration->Postprocess(output,integration_container,geometry_container,solver_container,numerics_container, + iteration->Postprocess(output_container[ZONE_0],integration_container,geometry_container,solver_container,numerics_container, config_container,surface_movement,grid_movement,FFDBox,ZONE_0,INST_0); RecordingState = NONE; @@ -250,7 +254,7 @@ void CDiscAdjSinglezoneDriver::SetRecording(unsigned short kind_recording){ /*--- Register Output of the iteration ---*/ - iteration->RegisterOutput(solver_container, geometry_container, config_container, output, ZONE_0, INST_0); + iteration->RegisterOutput(solver_container, geometry_container, config_container, output_container[ZONE_0], ZONE_0, INST_0); /*--- Extract the objective function and store it --- */ @@ -262,13 +266,12 @@ void CDiscAdjSinglezoneDriver::SetRecording(unsigned short kind_recording){ void CDiscAdjSinglezoneDriver::SetAdj_ObjFunction(){ - bool time_stepping = config->GetUnsteady_Simulation() != STEADY; + bool time_stepping = config->GetTime_Marching() != STEADY; unsigned long IterAvg_Obj = config->GetIter_Avg_Objective(); - unsigned long ExtIter = config->GetExtIter(); su2double seeding = 1.0; if (time_stepping){ - if (ExtIter < IterAvg_Obj){ + if (TimeIter < IterAvg_Obj){ seeding = 1.0/((su2double)IterAvg_Obj); } else{ @@ -286,11 +289,15 @@ void CDiscAdjSinglezoneDriver::SetAdj_ObjFunction(){ void CDiscAdjSinglezoneDriver::SetObjFunction(){ - bool compressible = config->GetKind_Regime() == COMPRESSIBLE; bool heat = (config->GetWeakly_Coupled_Heat()); bool turbo = (config->GetBoolTurbomachinery()); ObjFunc = 0.0; + + direct_output->SetHistory_Output(geometry, solver, config, + config->GetTimeIter(), + config->GetOuterIter(), + config->GetInnerIter()); /*--- Specific scalar objective functions ---*/ @@ -301,17 +308,17 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ solver[FLOW_SOL]->SetTotal_ComboObj(0.0); - if (config->GetnMarker_Analyze() != 0) - output->SpecialOutput_AnalyzeSurface(solver[FLOW_SOL], geometry, config, false); +// if (config->GetnMarker_Analyze() != 0) +// output->SpecialOutput_AnalyzeSurface(solver[FLOW_SOL], geometry, config, false); - if ((config->GetnMarker_Analyze() != 0) && compressible) - output->SpecialOutput_Distortion(solver[FLOW_SOL], geometry, config, false); +// if ((config->GetnMarker_Analyze() != 0) && compressible) +// output->SpecialOutput_Distortion(solver[FLOW_SOL], geometry, config, false); - if (config->GetnMarker_NearFieldBound() != 0) - output->SpecialOutput_SonicBoom(solver[FLOW_SOL], geometry, config, false); +// if (config->GetnMarker_NearFieldBound() != 0) +// output->SpecialOutput_SonicBoom(solver[FLOW_SOL], geometry, config, false); - if (config->GetPlot_Section_Forces()) - output->SpecialOutput_SpanLoad(solver[FLOW_SOL], geometry, config, false); +// if (config->GetPlot_Section_Forces()) +// output->SpecialOutput_SpanLoad(solver[FLOW_SOL], geometry, config, false); /*--- Surface based obj. function ---*/ @@ -331,19 +338,17 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ if (turbo){ solver[FLOW_SOL]->SetTotal_ComboObj(0.0); + output_legacy->ComputeTurboPerformance(solver[FLOW_SOL], geometry, config); switch (config_container[ZONE_0]->GetKind_ObjFunc()){ case ENTROPY_GENERATION: - solver[FLOW_SOL]->AddTotal_ComboObj(output->GetEntropyGen(config->GetnMarker_TurboPerformance() - 1, - config->GetnSpanWiseSections())); + solver[FLOW_SOL]->AddTotal_ComboObj(output_legacy->GetEntropyGen(config->GetnMarker_TurboPerformance() - 1, config->GetnSpanWiseSections())); break; case FLOW_ANGLE_OUT: - solver[FLOW_SOL]->AddTotal_ComboObj(output->GetFlowAngleOut(config->GetnMarker_TurboPerformance() - 1, - config->GetnSpanWiseSections())); + solver[FLOW_SOL]->AddTotal_ComboObj(output_legacy->GetFlowAngleOut(config->GetnMarker_TurboPerformance() - 1, config->GetnSpanWiseSections())); break; case MASS_FLOW_IN: - solver[FLOW_SOL]->AddTotal_ComboObj(output->GetMassFlowIn(config->GetnMarker_TurboPerformance() - 1, - config->GetnSpanWiseSections())); + solver[FLOW_SOL]->AddTotal_ComboObj(output_legacy->GetMassFlowIn(config->GetnMarker_TurboPerformance() - 1, config->GetnSpanWiseSections())); break; default: break; @@ -386,24 +391,15 @@ void CDiscAdjSinglezoneDriver::DirectRun(unsigned short kind_recording){ /*--- Zone preprocessing ---*/ - direct_iteration->Preprocess(output, integration_container, geometry_container, solver_container, - numerics_container, config_container, surface_movement, grid_movement, - FFDBox, ZONE_0, INST_0); - - /*--- Run one single iteration ---*/ - - config->SetIntIter(1); + direct_iteration->Preprocess(direct_output, integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Iterate the direct solver ---*/ - direct_iteration->Iterate(output, integration_container, geometry_container, solver_container, numerics_container, - config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); + direct_iteration->Iterate(direct_output, integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Postprocess the direct solver ---*/ - direct_iteration->Postprocess(output, integration_container, geometry_container, solver_container, - numerics_container, config_container, surface_movement, grid_movement, - FFDBox, ZONE_0, INST_0); + direct_iteration->Postprocess(direct_output, integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Print the direct residual to screen ---*/ diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 33b1482108bb..24118983c5be 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -42,11 +42,12 @@ #ifdef VTUNEPROF #include #endif +#include CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator, bool dummy_geo):config_file_name(confFile), StartTime(0.0), StopTime(0.0), UsedTime(0.0), - ExtIter(0), nZone(val_nZone), StopCalc(false), fsi(false), fem_solver(false), dummy_geometry(dummy_geo) { + TimeIter(0), nZone(val_nZone), StopCalc(false), fsi(false), fem_solver(false), dummy_geometry(dummy_geo) { /*--- Initialize Medipack (must also be here so it is initialized from python) ---*/ #ifdef HAVE_MPI @@ -79,6 +80,16 @@ CDriver::CDriver(char* confFile, Input_Preprocessing(config_container, driver_config); + /*--- Retrieve dimension from mesh file ---*/ + + nDim = CConfig::GetnDim(config_container[ZONE_0]->GetMesh_FileName(), + config_container[ZONE_0]->GetMesh_FileFormat()); + + /*--- Output preprocessing ---*/ + + Output_Preprocessing(config_container, driver_config, output_container, driver_output); + + for (iZone = 0; iZone < nZone; iZone++) { /*--- Read the number of instances for each zone ---*/ @@ -198,19 +209,15 @@ CDriver::CDriver(char* confFile, PythonInterface_Preprocessing(config_container, geometry_container, solver_container); - /*--- Output preprocessing --- */ - - Output_Preprocessing(config_container, output); - /*--- Open the FSI convergence history file ---*/ - if (fsi){ - if (rank == MASTER_NODE) cout << endl <<"Opening FSI history file." << endl; - unsigned short ZONE_FLOW = 0, ZONE_STRUCT = 1; - output->SpecialOutput_FSI(&FSIHist_file, geometry_container, solver_container, - config_container, integration_container, 0, - ZONE_FLOW, ZONE_STRUCT, true); - } +// if (fsi){ +// if (rank == MASTER_NODE) cout << endl <<"Opening FSI history file." << endl; +// unsigned short ZONE_FLOW = 0, ZONE_STRUCT = 1; +// output_container->SpecialOutput_FSI(&FSIHist_file, geometry_container, solver_container, +// config_container, integration_container, 0, +// ZONE_FLOW, ZONE_STRUCT, true); +// } /*--- Preprocessing time is reported now, but not included in the next compute portion. ---*/ @@ -269,7 +276,7 @@ void CDriver::SetContainers_Null(){ ConvHist_file = NULL; iteration_container = NULL; - output = NULL; + output_container = NULL; integration_container = NULL; geometry_container = NULL; solver_container = NULL; @@ -298,8 +305,10 @@ void CDriver::SetContainers_Null(){ interpolator_container = new CInterpolator**[nZone]; interface_container = new CInterface**[nZone]; interface_types = new unsigned short*[nZone]; + output_container = new COutput*[nZone]; nInst = new unsigned short[nZone]; driver_config = NULL; + driver_output = NULL; for (iZone = 0; iZone < nZone; iZone++) { @@ -314,8 +323,11 @@ void CDriver::SetContainers_Null(){ interpolator_container[iZone] = NULL; interface_container[iZone] = NULL; interface_types[iZone] = new unsigned short[nZone]; + output_container[iZone] = NULL; nInst[iZone] = 1; } + + strcpy(runtime_file_name, "runtime.dat"); } @@ -335,17 +347,7 @@ void CDriver::Postprocessing() { cout << "Warning: there are " << config_container[ZONE_0]->GetNonphysical_Points() << " non-physical points in the solution." << endl; if (config_container[ZONE_0]->GetNonphysical_Reconstr() > 0) cout << "Warning: " << config_container[ZONE_0]->GetNonphysical_Reconstr() << " reconstructed states for upwinding are non-physical." << endl; - - /*--- Close the convergence history file. ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++) { - ConvHist_file[iZone][iInst].close(); - } - delete [] ConvHist_file[iZone]; - } - } - delete [] ConvHist_file; if (rank == MASTER_NODE) cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; @@ -396,8 +398,8 @@ void CDriver::Postprocessing() { for (iZone = 0; iZone < nZone; iZone++) { if (interpolator_container[iZone] != NULL) { for (unsigned short jZone = 0; jZone < nZone; jZone++) - if (interpolator_container[iZone][jZone] != NULL) - delete interpolator_container[iZone][jZone]; + if (interpolator_container[iZone][jZone] != NULL) + delete interpolator_container[iZone][jZone]; delete [] interpolator_container[iZone]; } } @@ -484,7 +486,20 @@ void CDriver::Postprocessing() { if (rank == MASTER_NODE) cout << "Deleted nInst container." << endl; /*--- Deallocate output container ---*/ - if (output!= NULL) delete output; + + if (output_container!= NULL) { + for (iZone = 0; iZone < nZone; iZone++) { + if (output_container[iZone] != NULL) { + delete output_container[iZone]; + } + } + delete [] output_container; + } + + if(driver_output != NULL){ + delete driver_output; + } + if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; if (rank == MASTER_NODE) cout << "-------------------------------------------------------------------------" << endl; @@ -889,7 +904,7 @@ void CDriver::Geometrical_Preprocessing_FVM(CConfig *config, CGeometry **&geomet /*--- For unsteady simulations, initialize the grid volumes and coordinates for previous solutions. Loop over all zones/grids ---*/ - if (config->GetUnsteady_Simulation() && config->GetGrid_Movement()) { + if (config->GetTime_Marching() && config->GetGrid_Movement()) { for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { for (iPoint = 0; iPoint < geometry[iMGlevel]->GetnPoint(); iPoint++) { @@ -1035,7 +1050,7 @@ void CDriver::Solver_Preprocessing(CConfig* config, CGeometry** geometry, CSolve unsigned short iSol; if (rank == MASTER_NODE) - cout << endl <<"------------------ Solver Preprocessing ( Zone " << config->GetiZone() <<" ) ------------------" << endl; + cout << endl <<"-------------------- Solver Preprocessing ( Zone " << config->GetiZone() <<" ) --------------------" << endl; solver = new CSolver**[config->GetnMGLevels()+1]; @@ -1314,21 +1329,21 @@ void CDriver::Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, /*--- Adjust iteration number for unsteady restarts. ---*/ - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; bool adjoint = (config->GetDiscrete_Adjoint() || config->GetContinuous_Adjoint()); if (dual_time) { if (adjoint) val_iter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - else val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; + else if (config->GetTime_Marching() == DT_STEPPING_1ST) + val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + else val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } if (time_stepping) { if (adjoint) val_iter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; + else val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; } /*--- Assign booleans ---*/ @@ -1445,22 +1460,22 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, /*--- Adjust iteration number for unsteady restarts. ---*/ - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; bool adjoint = (config->GetDiscrete_Adjoint() || config->GetContinuous_Adjoint()); - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulation (FSI). + bool time_domain = (config->GetTime_Domain()); // Dynamic simulation (FSI). if (dual_time) { if (adjoint) val_iter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - else val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; + else if (config->GetTime_Marching() == DT_STEPPING_1ST) + val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + else val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } if (time_stepping) { if (adjoint) val_iter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; + else val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; } /*--- Assign booleans ---*/ @@ -1507,7 +1522,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, solver[MESH_0][TURB_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); } if (fem) { - if (dynamic) val_iter = SU2_TYPE::Int(config->GetDyn_RestartIter())-1; + if (time_domain) val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; solver[MESH_0][FEA_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); } if (fem_euler || fem_ns) { @@ -1540,7 +1555,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, solver[MESH_0][ADJHEAT_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); } if (disc_adj_fem) { - if (dynamic) val_iter = SU2_TYPE::Int(config->GetDyn_RestartIter())-1; + if (time_domain) val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; solver[MESH_0][ADJFEA_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); } if (disc_adj_heat) { @@ -1550,7 +1565,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, if ((restart || restart_flow) && config->GetDeform_Mesh() && update_geo){ /*--- Always restart with the last state ---*/ - val_iter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; + val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; solver[MESH_0][MESH_SOL]->LoadRestart(geometry, solver, config, val_iter, update_geo); } @@ -1679,10 +1694,19 @@ void CDriver::Solver_Postprocessing(CSolver ****solver, CGeometry **geometry, if (disc_adj_fem) { delete solver[val_iInst][iMGlevel][ADJFEA_SOL]; } - + + if (iMGlevel == 0){ + if (config->GetDeform_Mesh()){ + delete solver[val_iInst][MESH_0][MESH_SOL]; + if (config->GetDiscrete_Adjoint()) + delete solver[val_iInst][MESH_0][ADJMESH_SOL]; + } + } + delete [] solver[val_iInst][iMGlevel]; + } - + delete [] solver[val_iInst]; } @@ -2661,7 +2685,7 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol filename = config->GetFEA_FileName(); if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); + filename = config->GetMultizone_FileName(filename, iZone, ".dat"); properties_file.open(filename.data(), ios::in); @@ -3083,6 +3107,10 @@ void CDriver::Numerics_Postprocessing(CNumerics *****numerics, } + /*--- We initialize the numerics for the mesh solver ---*/ + if (config->GetDeform_Mesh()) + delete numerics[val_iInst][MESH_0][MESH_SOL][FEA_TERM]; + /*--- Definition of the Class for the numerical method: numerics_container[INST_LEVEL][MESH_LEVEL][EQUATION][EQ_TERM] ---*/ for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { for (iSol = 0; iSol < MAX_SOLS; iSol++) { @@ -3185,7 +3213,7 @@ void CDriver::DynamicMesh_Preprocessing(CConfig *config, CGeometry **geometry, C surface_movement = new CSurfaceMovement(); surface_movement->CopyBoundary(geometry[MESH_0], config); - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE){ + if (config->GetTime_Marching() == HARMONIC_BALANCE){ if (rank == MASTER_NODE) cout << endl << "Instance "<< iInst + 1 <<":" << endl; iteration->SetGrid_Movement(geometry, surface_movement, grid_movement, solver, config, 0, iInst); } @@ -3568,7 +3596,6 @@ void CDriver::Interface_Preprocessing(CConfig **config, CSolver***** solver, CGe if (rank == MASTER_NODE) delete [] Buffer_Recv_mark; #endif - } void CDriver::StaticMesh_Preprocessing(CConfig *config, CGeometry** geometry, CSurfaceMovement* surface_movement){ @@ -3662,6 +3689,105 @@ void CDriver::StaticMesh_Preprocessing(CConfig *config, CGeometry** geometry, CS } +void CDriver::Output_Preprocessing(CConfig **config, CConfig *driver_config, COutput **&output, COutput *&driver_output){ + + /*--- Definition of the output class (one for each zone). The output class + manages the writing of all restart, volume solution, surface solution, + surface comma-separated value, and convergence history files (both in serial + and in parallel). ---*/ + + for (iZone = 0; iZone < nZone; iZone++){ + + if (rank == MASTER_NODE) + cout << endl <<"-------------------- Output Preprocessing ( Zone " << iZone <<" ) --------------------" << endl; + + /*--- Loop over all zones and instantiate the physics iteration. ---*/ + + switch (config[iZone]->GetKind_Solver()) { + + case EULER: case NAVIER_STOKES: case RANS: + if (rank == MASTER_NODE) + cout << ": Euler/Navier-Stokes/RANS output structure." << endl; + output[iZone] = new CFlowCompOutput(config[iZone], nDim); + break; + case INC_EULER: case INC_NAVIER_STOKES: case INC_RANS: + if (rank == MASTER_NODE) + cout << ": Euler/Navier-Stokes/RANS output structure." << endl; + output[iZone] = new CFlowIncOutput(config[iZone], nDim); + break; + case HEAT_EQUATION_FVM: + if (rank == MASTER_NODE) + cout << ": heat output structure." << endl; + output[iZone] = new CHeatOutput(config[iZone], nDim); + break; + case FEM_ELASTICITY: + if (rank == MASTER_NODE) + cout << ": FEM output structure." << endl; + output[iZone] = new CElasticityOutput(config[iZone], nDim); + break; + case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: case DISC_ADJ_RANS: + case ADJ_EULER: case ADJ_NAVIER_STOKES: case ADJ_RANS: + if (rank == MASTER_NODE) + cout << ": adjoint Euler/Navier-Stokes/RANS output structure." << endl; + output[iZone] = new CAdjFlowCompOutput(config[iZone], nDim); + break; + case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS: + if (rank == MASTER_NODE) + cout << ": adjoint Euler/Navier-Stokes/RANS output structure." << endl; + output[iZone] = new CAdjFlowIncOutput(config[iZone], nDim); + break; + case DISC_ADJ_FEM: + if (rank == MASTER_NODE) + cout << ": discrete adjoint FEA output structure." << endl; + output[iZone] = new CAdjElasticityOutput(config[iZone], nDim); + break; + + case DISC_ADJ_HEAT: + if (rank == MASTER_NODE) + cout << ": discrete adjoint heat output structure." << endl; + output[iZone] = new CAdjHeatOutput(config[iZone], nDim); + break; + + case FEM_EULER: case FEM_LES: case FEM_RANS: case FEM_NAVIER_STOKES: + if (rank == MASTER_NODE) + cout << ": FEM output structure." << endl; + output[iZone] = new CFlowCompFEMOutput(config[iZone], nDim); + break; + + default: + if (rank == MASTER_NODE) + cout << ": default output structure." << endl; + output[iZone] = new COutput(config[iZone], nDim, false); + break; + } + + output[iZone]->PreprocessHistoryOutput(config[iZone]); + + output[iZone]->PreprocessVolumeOutput(config[iZone]); + + } + + if (driver_config->GetMultizone_Problem()){ + if (rank == MASTER_NODE) + cout << endl <<"------------------- Output Preprocessing ( Multizone ) ------------------" << endl; + + driver_output = new CMultizoneOutput(driver_config, config, nDim); + driver_output->PreprocessMultizoneHistoryOutput(output, config, driver_config); + } + + + /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ + if (config_container[ZONE_0]->GetTime_Domain() && config_container[ZONE_0]->GetRestart()) + TimeIter = config_container[ZONE_0]->GetRestart_Iter(); + + /*--- Check for a dynamic restart (structural analysis). Update ExtIter if necessary. ---*/ + if (config_container[ZONE_0]->GetKind_Solver() == FEM_ELASTICITY + && config_container[ZONE_0]->GetWrt_Dynamic() && config_container[ZONE_0]->GetRestart()) + TimeIter = config_container[ZONE_0]->GetRestart_Iter(); + + +} + void CDriver::Turbomachinery_Preprocessing(CConfig** config, CGeometry**** geometry, CSolver***** solver, CInterface*** interface){ @@ -3794,40 +3920,17 @@ void CDriver::Turbomachinery_Preprocessing(CConfig** config, CGeometry**** geome } -void CDriver::Output_Preprocessing(CConfig **config, COutput *&output){ - - /*--- Definition of the output class (one for all zones). The output class - manages the writing of all restart, volume solution, surface solution, - surface comma-separated value, and convergence history files (both in serial - and in parallel). ---*/ - output = new COutput(config[ZONE_0]); - /*--- Open the convergence history file ---*/ - ConvHist_file = NULL; - ConvHist_file = new ofstream*[nZone]; - for (iZone = 0; iZone < nZone; iZone++) { - ConvHist_file[iZone] = NULL; - if (rank == MASTER_NODE){ - ConvHist_file[iZone] = new ofstream[nInst[iZone]]; - for (iInst = 0; iInst < nInst[iZone]; iInst++) { - output->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config[iZone], iZone, iInst); - config[iZone]->SetHistFile(&ConvHist_file[iZone][INST_0]); - } - } - } - /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ - if (config[ZONE_0]->GetWrt_Unsteady() && config[ZONE_0]->GetRestart()) - ExtIter = config[ZONE_0]->GetUnst_RestartIter(); +CDriver::~CDriver(void) {} - /*--- Check for a dynamic restart (structural analysis). Update ExtIter if necessary. ---*/ - if (config[ZONE_0]->GetKind_Solver() == FEM_ELASTICITY - && config[ZONE_0]->GetWrt_Dynamic() && config[ZONE_0]->GetRestart()) - ExtIter = config[ZONE_0]->GetDyn_RestartIter(); - - +CFluidDriver::CFluidDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator) : CDriver(confFile, val_nZone, MPICommunicator, false) { + Max_Iter = config_container[ZONE_0]->GetnInner_Iter(); } -void CDriver::StartSolver(){ + +CFluidDriver::~CFluidDriver(void) { } + +void CFluidDriver::StartSolver(){ #ifdef VTUNEPROF __itt_resume(); @@ -3838,18 +3941,19 @@ void CDriver::StartSolver(){ if (rank == MASTER_NODE) cout << endl <<"------------------------------ Begin Solver -----------------------------" << endl; - while ( ExtIter < config_container[ZONE_0]->GetnExtIter() ) { + unsigned long Iter = 0; + while ( Iter < Max_Iter ) { /*--- Perform some external iteration preprocessing. ---*/ - PreprocessExtIter(ExtIter); + Preprocess(Iter); /*--- Perform a dynamic mesh update if required. ---*/ /*--- For the Disc.Adj. of a case with (rigidly) moving grid, the appropriate mesh cordinates are read from the restart files. ---*/ if (!fem_solver && !(config_container[ZONE_0]->GetGrid_Movement() && config_container[ZONE_0]->GetDiscrete_Adjoint())) { - DynamicMeshUpdate(ExtIter); + DynamicMeshUpdate(Iter); } /*--- Run a single iteration of the problem (fluid, elasticity, heat, ...). ---*/ @@ -3865,17 +3969,17 @@ void CDriver::StartSolver(){ /*--- Monitor the computations after each iteration. ---*/ - Monitor(ExtIter); + Monitor(Iter); /*--- Output the solution in files. ---*/ - Output(ExtIter); + Output(Iter); /*--- If the convergence criteria has been met, terminate the simulation. ---*/ if (StopCalc) break; - ExtIter++; + Iter++; } #ifdef VTUNEPROF @@ -3883,32 +3987,32 @@ void CDriver::StartSolver(){ #endif } -void CDriver::PreprocessExtIter(unsigned long ExtIter) { + +void CFluidDriver::Preprocess(unsigned long Iter) { /*--- Set the value of the external iteration and physical time. ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone]->SetExtIter(ExtIter); - - if (config_container[iZone]->GetUnsteady_Simulation()) - config_container[iZone]->SetPhysicalTime(static_cast(ExtIter)*config_container[iZone]->GetDelta_UnstTimeND()); + for (iZone = 0; iZone < nZone; iZone++) { + config_container[iZone]->SetInnerIter(Iter); + if (config_container[iZone]->GetTime_Marching()) + config_container[iZone]->SetPhysicalTime(static_cast(Iter)*config_container[iZone]->GetDelta_UnstTimeND()); else config_container[iZone]->SetPhysicalTime(0.0); } - /*--- Read the target pressure ---*/ +// /*--- Read the target pressure ---*/ - if (config_container[ZONE_0]->GetInvDesign_Cp() == YES) - output->SetCp_InverseDesign(solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], - geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], ExtIter); +// if (config_container[ZONE_0]->GetInvDesign_Cp() == YES) +// output[ZONE_0]->SetCp_InverseDesign(solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], +// geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], ExtIter); - /*--- Read the target heat flux ---*/ +// /*--- Read the target heat flux ---*/ - if (config_container[ZONE_0]->GetInvDesign_HeatFlux() == YES) - output->SetHeatFlux_InverseDesign(solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], - geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], ExtIter); +// if (config_container[ZONE_0]->GetInvDesign_HeatFlux() == YES) +// output[ZONE_0]->SetHeatFlux_InverseDesign(solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], +// geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], ExtIter); /*--- Set the initial condition for EULER/N-S/RANS and for a non FSI simulation ---*/ @@ -3921,201 +4025,12 @@ void CDriver::PreprocessExtIter(unsigned long ExtIter) { (config_container[iZone]->GetKind_Solver() == INC_NAVIER_STOKES) || (config_container[iZone]->GetKind_Solver() == INC_RANS)) { for (iInst = 0; iInst < nInst[iZone]; iInst++) - solver_container[iZone][iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], ExtIter); + solver_container[iZone][iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], Iter); } } } } - -bool CDriver::Monitor(unsigned long ExtIter) { - - /*--- Synchronization point after a single solver iteration. Compute the - wall clock time required. ---*/ - -#ifndef HAVE_MPI - StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); -#else - StopTime = MPI_Wtime(); -#endif - IterCount++; - UsedTime = (StopTime - StartTime) + UsedTimeCompute; - - - /*--- Check if there is any change in the runtime parameters ---*/ - - CConfig *runtime = NULL; - strcpy(runtime_file_name, "runtime.dat"); - runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); - runtime->SetExtIter(ExtIter); - delete runtime; - - /*--- Update the convergence history file (serial and parallel computations). ---*/ - - if (!fsi) { - for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++) - output->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container, - config_container, integration_container, false, UsedTime, iZone, iInst); - } - } - - /*--- Evaluate the new CFL number (adaptive). ---*/ - if (config_container[ZONE_0]->GetCFL_Adapt() == YES) { - for (iZone = 0; iZone < nZone; iZone++){ - if (!(config_container[iZone]->GetMultizone_Problem())) // This needs to be changed everywhere in the code, in a future PR - output->SetCFL_Number(solver_container, config_container, iZone); - } - } - - /*--- Check whether the current simulation has reached the specified - convergence criteria, and set StopCalc to true, if so. ---*/ - - switch (config_container[ZONE_0]->GetKind_Solver()) { - case EULER: case NAVIER_STOKES: case RANS: - case INC_EULER: case INC_NAVIER_STOKES: case INC_RANS: - StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break; - case HEAT_EQUATION_FVM: - StopCalc = integration_container[ZONE_0][INST_0][HEAT_SOL]->GetConvergence(); break; - case FEM_ELASTICITY: - StopCalc = integration_container[ZONE_0][INST_0][FEA_SOL]->GetConvergence(); break; - case ADJ_EULER: case ADJ_NAVIER_STOKES: case ADJ_RANS: - case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: case DISC_ADJ_RANS: - case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS: - case DISC_ADJ_FEM_EULER: case DISC_ADJ_FEM_NS: case DISC_ADJ_FEM_RANS: - StopCalc = integration_container[ZONE_0][INST_0][ADJFLOW_SOL]->GetConvergence(); break; - } - - return StopCalc; - -} - -void CDriver::Output(unsigned long ExtIter) { - - unsigned long nExtIter = config_container[ZONE_0]->GetnExtIter(); - bool output_files = false; - - /*--- Determine whether a solution needs to be written - after the current iteration ---*/ - - if ( - - /*--- General if statements to print output statements ---*/ - - (ExtIter+1 >= nExtIter) || (StopCalc) || - - /*--- Fixed CL problem ---*/ - - ((config_container[ZONE_0]->GetFixed_CL_Mode()) && - (config_container[ZONE_0]->GetnExtIter()-config_container[ZONE_0]->GetIter_dCL_dAlpha() - 1 == ExtIter)) || - - /*--- Steady problems ---*/ - - ((ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (ExtIter != 0) && - ((config_container[ZONE_0]->GetUnsteady_Simulation() == STEADY) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == HARMONIC_BALANCE) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == ROTATIONAL_FRAME))) || - - /*--- Unsteady problems ---*/ - - (((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == TIME_STEPPING)) && - ((ExtIter == 0) || (ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0))) || - - ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && (!fsi) && - ((ExtIter == 0) || ((ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0) || - ((ExtIter-1) % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) || - - ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && (fsi) && - ((ExtIter == 0) || ((ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) || - - ((config_container[ZONE_0]->GetDynamic_Analysis() == DYNAMIC) && - ((ExtIter == 0) || (ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0))) || - - /*--- No inlet profile file found. Print template. ---*/ - - (config_container[ZONE_0]->GetWrt_InletFile()) - - ) { - - output_files = true; - - } - - /*--- Determine whether a solution doesn't need to be written - after the current iteration ---*/ - - if (config_container[ZONE_0]->GetFixed_CL_Mode()) { - if (config_container[ZONE_0]->GetnExtIter()-config_container[ZONE_0]->GetIter_dCL_dAlpha() - 1 < ExtIter) output_files = false; - if (config_container[ZONE_0]->GetnExtIter() - 1 == ExtIter) output_files = true; - } - - /*--- write the solution ---*/ - - if (output_files) { - - /*--- Time the output for performance benchmarking. ---*/ -#ifndef HAVE_MPI - StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); -#else - StopTime = MPI_Wtime(); -#endif - UsedTimeCompute += StopTime-StartTime; -#ifndef HAVE_MPI - StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); -#else - StartTime = MPI_Wtime(); -#endif - - /*--- Add a statement about the type of solver exit. ---*/ - - if (((ExtIter+1 >= nExtIter) || StopCalc) && (rank == MASTER_NODE)) { - cout << endl << "----------------------------- Solver Exit -------------------------------"; - if (StopCalc) cout << endl << "Convergence criteria satisfied." << endl; - else cout << endl << "Maximum number of external iterations reached (EXT_ITER)." << endl; - cout << "-------------------------------------------------------------------------" << endl; - } - - if (rank == MASTER_NODE) cout << endl << "-------------------------- File Output Summary --------------------------"; - - /*--- Execute the routine for writing restart, volume solution, - surface solution, and surface comma-separated value files. ---*/ - - output->SetResult_Files_Parallel(solver_container, geometry_container, config_container, ExtIter, nZone); - - - if (rank == MASTER_NODE) cout << "-------------------------------------------------------------------------" << endl << endl; - - /*--- Store output time and restart the timer for the compute phase. ---*/ -#ifndef HAVE_MPI - StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); -#else - StopTime = MPI_Wtime(); -#endif - UsedTimeOutput += StopTime-StartTime; - OutputCount++; - BandwidthSum = config_container[ZONE_0]->GetRestart_Bandwidth_Agg(); -#ifndef HAVE_MPI - StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); -#else - StartTime = MPI_Wtime(); -#endif - - } - - /*--- Export Surface Solution File for Unsteady Simulations ---*/ - /*--- When calculate mean/fluctuation option will be available, delete the following part ---*/ - if ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && (ExtIter % config_container[ZONE_0]->GetWrt_Surf_Freq_DualTime() == 0) && config_container[ZONE_0]->GetWrt_Csv_Sol()) { - output->SetSurfaceCSV_Flow(config_container[ZONE_0], geometry_container[ZONE_0][INST_0][MESH_0], solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], ExtIter, ZONE_0, INST_0);} - -} - -CDriver::~CDriver(void) {} - -CFluidDriver::CFluidDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator) : CDriver(confFile, val_nZone, MPICommunicator, false) { } - -CFluidDriver::~CFluidDriver(void) { } - void CFluidDriver::Run() { unsigned short iZone, jZone, checkConvergence; @@ -4126,12 +4041,12 @@ void CFluidDriver::Run() { zones and executing the iterations. Note that data transers between zones and other intermediate procedures may be required. ---*/ - unsteady = (config_container[MESH_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config_container[MESH_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND); + unsteady = (config_container[MESH_0]->GetTime_Marching() == DT_STEPPING_1ST) || (config_container[MESH_0]->GetTime_Marching() == DT_STEPPING_2ND); /*--- Zone preprocessing ---*/ for (iZone = 0; iZone < nZone; iZone++) - iteration_container[iZone][INST_0]->Preprocess(output, integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); + iteration_container[iZone][INST_0]->Preprocess(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); /*--- Updating zone interface communication patterns, needed only for unsteady simulation since for steady problems @@ -4164,8 +4079,8 @@ void CFluidDriver::Run() { /*--- For each zone runs one single iteration ---*/ for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone]->SetIntIter(IntIter); - iteration_container[iZone][INST_0]->Iterate(output, integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); + config_container[iZone]->SetInnerIter(IntIter); + iteration_container[iZone][INST_0]->Iterate(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } /*--- Check convergence in each zone --*/ @@ -4196,30 +4111,120 @@ void CFluidDriver::Transfer_Data(unsigned short donorZone, unsigned short target void CFluidDriver::Update() { for(iZone = 0; iZone < nZone; iZone++) - iteration_container[iZone][INST_0]->Update(output, integration_container, geometry_container, + iteration_container[iZone][INST_0]->Update(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } -void CFluidDriver::DynamicMeshUpdate(unsigned long ExtIter) { +void CFluidDriver::DynamicMeshUpdate(unsigned long TimeIter) { bool harmonic_balance; for (iZone = 0; iZone < nZone; iZone++) { - harmonic_balance = (config_container[iZone]->GetUnsteady_Simulation() == HARMONIC_BALANCE); + harmonic_balance = (config_container[iZone]->GetTime_Marching() == HARMONIC_BALANCE); /*--- Dynamic mesh update ---*/ if ((config_container[iZone]->GetGrid_Movement()) && (!harmonic_balance)) { - iteration_container[iZone][INST_0]->SetGrid_Movement(geometry_container[iZone][INST_0], surface_movement[iZone], grid_movement[iZone][INST_0], solver_container[iZone][INST_0], config_container[iZone], 0, ExtIter ); + iteration_container[iZone][INST_0]->SetGrid_Movement(geometry_container[iZone][INST_0], surface_movement[iZone], grid_movement[iZone][INST_0], solver_container[iZone][INST_0], config_container[iZone], 0, TimeIter ); } } } +bool CFluidDriver::Monitor(unsigned long ExtIter) { -CTurbomachineryDriver::CTurbomachineryDriver(char* confFile, unsigned short val_nZone, - SU2_Comm MPICommunicator): - CFluidDriver(confFile, val_nZone, MPICommunicator) { } + /*--- Synchronization point after a single solver iteration. Compute the + wall clock time required. ---*/ -CTurbomachineryDriver::~CTurbomachineryDriver(void) { } +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + IterCount++; + UsedTime = (StopTime - StartTime) + UsedTimeCompute; + + + /*--- Check if there is any change in the runtime parameters ---*/ + + CConfig *runtime = NULL; + strcpy(runtime_file_name, "runtime.dat"); + runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); + runtime->SetTimeIter(ExtIter); + delete runtime; + + /*--- Evaluate the new CFL number (adaptive). ---*/ + if (config_container[ZONE_0]->GetCFL_Adapt() == YES) { + for (iZone = 0; iZone < nZone; iZone++){ + if (!(config_container[iZone]->GetMultizone_Problem())) // This needs to be changed everywhere in the code, in a future PR + output_container[iZone]->SetCFL_Number(solver_container[iZone], config_container[iZone]); + } + } + + /*--- Check whether the current simulation has reached the specified + convergence criteria, and set StopCalc to true, if so. ---*/ + + switch (config_container[ZONE_0]->GetKind_Solver()) { + case EULER: case NAVIER_STOKES: case RANS: + StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break; + case HEAT_EQUATION_FVM: + StopCalc = integration_container[ZONE_0][INST_0][HEAT_SOL]->GetConvergence(); break; + case FEM_ELASTICITY: + StopCalc = integration_container[ZONE_0][INST_0][FEA_SOL]->GetConvergence(); break; + case ADJ_EULER: case ADJ_NAVIER_STOKES: case ADJ_RANS: + case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: case DISC_ADJ_RANS: + case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: case DISC_ADJ_INC_RANS: + case DISC_ADJ_FEM_EULER: case DISC_ADJ_FEM_NS: case DISC_ADJ_FEM_RANS: + StopCalc = integration_container[ZONE_0][INST_0][ADJFLOW_SOL]->GetConvergence(); break; + } + + return StopCalc; + +} + + +void CFluidDriver::Output(unsigned long InnerIter) { + +} + + +CTurbomachineryDriver::CTurbomachineryDriver(char* confFile, unsigned short val_nZone, + SU2_Comm MPICommunicator): + CFluidDriver(confFile, val_nZone, MPICommunicator) { + + output_legacy = new COutputLegacy(config_container[ZONE_0]); + + /*--- LEGACY OUTPUT (going to be removed soon) --- */ + + /*--- Open the convergence history file ---*/ + ConvHist_file = NULL; + ConvHist_file = new ofstream*[nZone]; + for (iZone = 0; iZone < nZone; iZone++) { + ConvHist_file[iZone] = NULL; + if (rank == MASTER_NODE){ + ConvHist_file[iZone] = new ofstream[nInst[iZone]]; + for (iInst = 0; iInst < nInst[iZone]; iInst++) { + output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst); + config_container[iZone]->SetHistFile(&ConvHist_file[iZone][INST_0]); + } + } + } + + if (nZone > 1){ + Max_Iter = config_container[ZONE_0]->GetnOuter_Iter(); + } +} + +CTurbomachineryDriver::~CTurbomachineryDriver(void) { + if (rank == MASTER_NODE){ + /*--- Close the convergence history file. ---*/ + for (iZone = 0; iZone < nZone; iZone++) { + for (iInst = 0; iInst < 1; iInst++) { + ConvHist_file[iZone][iInst].close(); + } + delete [] ConvHist_file[iZone]; + } + delete [] ConvHist_file; + } +} void CTurbomachineryDriver::Run() { @@ -4228,7 +4233,7 @@ void CTurbomachineryDriver::Run() { and other intermediate procedures may be required. ---*/ for (iZone = 0; iZone < nZone; iZone++) { - iteration_container[iZone][INST_0]->Preprocess(output, integration_container, geometry_container, + iteration_container[iZone][INST_0]->Preprocess(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } @@ -4239,13 +4244,13 @@ void CTurbomachineryDriver::Run() { } for (iZone = 0; iZone < nZone; iZone++) { - iteration_container[iZone][INST_0]->Iterate(output, integration_container, geometry_container, + iteration_container[iZone][INST_0]->Iterate(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } for (iZone = 0; iZone < nZone; iZone++) { - iteration_container[iZone][INST_0]->Postprocess(output, integration_container, geometry_container, + iteration_container[iZone][INST_0]->Postprocess(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } @@ -4254,7 +4259,7 @@ void CTurbomachineryDriver::Run() { SetTurboPerformance(ZONE_0); } - + } void CTurbomachineryDriver::SetMixingPlane(unsigned short donorZone){ @@ -4285,7 +4290,7 @@ void CTurbomachineryDriver::SetTurboPerformance(unsigned short targetZone){ /* --- compute turboperformance for each stage and the global machine ---*/ - output->ComputeTurboPerformance(solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone]); + output_legacy->ComputeTurboPerformance(solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone]); } @@ -4317,14 +4322,14 @@ bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) { CConfig *runtime = NULL; strcpy(runtime_file_name, "runtime.dat"); runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); - runtime->SetExtIter(ExtIter); + runtime->SetInnerIter(ExtIter); delete runtime; /*--- Update the convergence history file (serial and parallel computations). ---*/ for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++) - output->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container, + for (iInst = 0; iInst < nInst[iZone]; iInst++) + output_legacy->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container, config_container, integration_container, false, UsedTime, iZone, iInst); } @@ -4334,7 +4339,7 @@ bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) { if(mixingplane){ CFL = 0; for (iZone = 0; iZone < nZone; iZone++){ - output->SetCFL_Number(solver_container, config_container, iZone); + output_container[iZone]->SetCFL_Number(solver_container[iZone], config_container[iZone]); CFL += config_container[iZone]->GetCFL(MESH_0); } /*--- For fluid-multizone the new CFL number is the same for all the zones and it is equal to the zones' minimum value. ---*/ @@ -4343,7 +4348,7 @@ bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) { } } else{ - output->SetCFL_Number(solver_container, config_container, ZONE_0); + output_container[ZONE_0]->SetCFL_Number(solver_container[ZONE_0], config_container[ZONE_0]); } } @@ -4440,10 +4445,9 @@ bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) { CHBDriver::CHBDriver(char* confFile, unsigned short val_nZone, - SU2_Comm MPICommunicator) : CDriver(confFile, + SU2_Comm MPICommunicator) : CFluidDriver(confFile, val_nZone, - MPICommunicator, - false) { + MPICommunicator) { unsigned short kInst; nInstHB = nInst[ZONE_0]; @@ -4451,7 +4455,24 @@ CHBDriver::CHBDriver(char* confFile, D = NULL; /*--- allocate dynamic memory for the Harmonic Balance operator ---*/ D = new su2double*[nInstHB]; for (kInst = 0; kInst < nInstHB; kInst++) D[kInst] = new su2double[nInstHB]; - + + output_legacy = new COutputLegacy(config_container[ZONE_0]); + + /*--- Open the convergence history file ---*/ + ConvHist_file = NULL; + ConvHist_file = new ofstream*[nZone]; + for (iZone = 0; iZone < nZone; iZone++) { + ConvHist_file[iZone] = NULL; + if (rank == MASTER_NODE){ + ConvHist_file[iZone] = new ofstream[nInst[iZone]]; + for (iInst = 0; iInst < nInst[iZone]; iInst++) { + output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst); + config_container[iZone]->SetHistFile(&ConvHist_file[iZone][iInst]); + } + } + } + + } CHBDriver::~CHBDriver(void) { @@ -4461,8 +4482,19 @@ CHBDriver::~CHBDriver(void) { /*--- delete dynamic memory for the Harmonic Balance operator ---*/ for (kInst = 0; kInst < nInstHB; kInst++) if (D[kInst] != NULL) delete [] D[kInst]; if (D[kInst] != NULL) delete [] D; - + + if (rank == MASTER_NODE){ + /*--- Close the convergence history file. ---*/ + for (iZone = 0; iZone < nZone; iZone++) { + for (iInst = 0; iInst < nInstHB; iInst++) { + ConvHist_file[iZone][iInst].close(); + } + delete [] ConvHist_file[iZone]; + } + delete [] ConvHist_file; + } } + void CHBDriver::Run() { @@ -4470,15 +4502,23 @@ void CHBDriver::Run() { all zones before beginning the iteration. ---*/ for (iInst = 0; iInst < nInstHB; iInst++) - iteration_container[ZONE_0][iInst]->Preprocess(output, integration_container, geometry_container, + iteration_container[ZONE_0][iInst]->Preprocess(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, iInst); for (iInst = 0; iInst < nInstHB; iInst++) - iteration_container[ZONE_0][iInst]->Iterate(output, integration_container, geometry_container, + iteration_container[ZONE_0][iInst]->Iterate(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, iInst); + + /*--- Update the convergence history file (serial and parallel computations). ---*/ + for (iZone = 0; iZone < nZone; iZone++) { + for (iInst = 0; iInst < nInst[iZone]; iInst++) + output_legacy->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container, + config_container, integration_container, false, UsedTime, iZone, iInst); + } + } void CHBDriver::Update() { @@ -4498,7 +4538,7 @@ void CHBDriver::Update() { for (iInst = 0; iInst < nInstHB; iInst++) { /*--- Update the harmonic balance terms across all zones ---*/ - iteration_container[ZONE_0][iInst]->Update(output, integration_container, geometry_container, + iteration_container[ZONE_0][iInst]->Update(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, iInst); @@ -4542,7 +4582,7 @@ void CHBDriver::SetHarmonicBalance(unsigned short iInst) { implicit = (config_container[ZONE_0]->GetKind_TimeIntScheme_AdjFlow() == EULER_IMPLICIT); } - unsigned long ExtIter = config_container[ZONE_0]->GetExtIter(); + unsigned long InnerIter = config_container[ZONE_0]->GetInnerIter(); /*--- Retrieve values from the config file ---*/ su2double *U = new su2double[nVar]; @@ -4558,7 +4598,7 @@ void CHBDriver::SetHarmonicBalance(unsigned short iInst) { /*--- Non-dimensionalize the input period, if necessary. */ period /= config_container[ZONE_0]->GetTime_Ref(); - if (ExtIter == 0) + if (InnerIter == 0) ComputeHB_Operator(); /*--- Compute various source terms for explicit direct, implicit direct, and adjoint problems ---*/ @@ -4989,502 +5029,6 @@ void CHBDriver::ComputeHB_Operator() { } -CFSIDriver::CFSIDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator) : CDriver(confFile, - val_nZone, - MPICommunicator, - false) { - unsigned short iVar; - unsigned short nVar_Flow = 0, nVar_Struct = 0; - - unsigned short iZone; - for (iZone = 0; iZone < nZone; iZone++){ - switch (config_container[iZone]->GetKind_Solver()) { - case RANS: case EULER: case NAVIER_STOKES: - case INC_RANS: case INC_EULER: case INC_NAVIER_STOKES: - nVar_Flow = solver_container[iZone][INST_0][MESH_0][FLOW_SOL]->GetnVar(); - flow_criteria = config_container[iZone]->GetMinLogResidual_BGS_F(); - flow_criteria_rel = config_container[iZone]->GetOrderMagResidual_BGS_F(); - break; - case FEM_ELASTICITY: - nVar_Struct = solver_container[iZone][INST_0][MESH_0][FEA_SOL]->GetnVar(); - structure_criteria = config_container[iZone]->GetMinLogResidual_BGS_S(); - structure_criteria_rel = config_container[iZone]->GetOrderMagResidual_BGS_S(); - break; - } - } - - init_res_flow = new su2double[nVar_Flow]; - init_res_struct = new su2double[nVar_Struct]; - - residual_flow = new su2double[nVar_Flow]; - residual_struct = new su2double[nVar_Struct]; - - residual_flow_rel = new su2double[nVar_Flow]; - residual_struct_rel = new su2double[nVar_Struct]; - - for (iVar = 0; iVar < nVar_Flow; iVar++){ - init_res_flow[iVar] = 0.0; - residual_flow[iVar] = 0.0; - residual_flow_rel[iVar] = 0.0; - } - for (iVar = 0; iVar < nVar_Struct; iVar++){ - init_res_struct[iVar] = 0.0; - residual_struct[iVar] = 0.0; - residual_struct_rel[iVar] = 0.0; - } - -} - -CFSIDriver::~CFSIDriver(void) { - - delete [] init_res_flow; - delete [] init_res_struct; - delete [] residual_flow; - delete [] residual_struct; - delete [] residual_flow_rel; - delete [] residual_struct_rel; - -} - -void CFSIDriver::Run() { - - /*--- As of now, we are coding it for just 2 zones. ---*/ - /*--- This will become more general, but we need to modify the configuration for that ---*/ - unsigned short ZONE_FLOW = 0, ZONE_STRUCT = 1; - unsigned short iZone; - - /*--- Boolean to determine if we are running a static or dynamic case ---*/ - bool stat_fsi = ((config_container[ZONE_FLOW]->GetUnsteady_Simulation() == STEADY) && (config_container[ZONE_STRUCT]->GetDynamic_Analysis() == STATIC)); - bool dyn_fsi = (((config_container[ZONE_FLOW]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config_container[ZONE_FLOW]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) - && (config_container[ZONE_STRUCT]->GetDynamic_Analysis() == DYNAMIC)); - - unsigned long IntIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetIntIter(IntIter); - unsigned long OuterIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetOuterIter(OuterIter); - unsigned long nOuterIter = config_container[ZONE_FLOW]->GetnIterFSI(); - unsigned long nIntIter; - - bool Convergence = false; - - bool StopCalc_Flow = false; - - /*--- Be careful with whether or not we load the coords and grid velocity - from the restart files... this needs to be standardized for the different - solvers, in particular with FSI. ---*/ - - /*-----------------------------------------------------------------*/ - /*---------------- Predict structural displacements ---------------*/ - /*-----------------------------------------------------------------*/ - - Predict_Displacements(ZONE_STRUCT, ZONE_FLOW); - - while (OuterIter < nOuterIter) { - - /*-----------------------------------------------------------------*/ - /*------------------- Transfer Displacements ----------------------*/ - /*-----------------------------------------------------------------*/ - if(interface_container[ZONE_STRUCT][ZONE_FLOW] != NULL) - Transfer_Displacements(ZONE_STRUCT, ZONE_FLOW); - - /*-----------------------------------------------------------------*/ - /*--------------------- Mesh deformation --------------------------*/ - /*-----------------------------------------------------------------*/ - - iteration_container[ZONE_FLOW][INST_0]->SetGrid_Movement(geometry_container[ZONE_FLOW][INST_0], - surface_movement[ZONE_FLOW], grid_movement[ZONE_FLOW][INST_0], - solver_container[ZONE_FLOW][INST_0], config_container[ZONE_FLOW], 0, ExtIter ); - - /*-----------------------------------------------------------------*/ - /*-------------------- Fluid subiteration -------------------------*/ - /*-----------------------------------------------------------------*/ - - iteration_container[ZONE_FLOW][INST_0]->Preprocess(output, integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, ZONE_FLOW, INST_0); - - if ( stat_fsi ) { - - /*--- For steady-state flow simulations, we need to loop over ExtIter for the number of time steps ---*/ - /*--- However, ExtIter is the number of FSI iterations, so nIntIter is used in this case ---*/ - - nIntIter = config_container[ZONE_FLOW]->GetUnst_nIntIter(); - - for (IntIter = 0; IntIter < nIntIter; IntIter++){ - - /*--- Set ExtIter to iExtIter_FLOW; this is a trick to loop on the steady-state flow solver ---*/ - config_container[ZONE_FLOW]->SetExtIter(IntIter); - - iteration_container[ZONE_FLOW][INST_0]->Iterate(output, integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, ZONE_FLOW, INST_0); - - /*--- Write the convergence history for the fluid (only screen output) ---*/ - - output->SetConvHistory_Body(&ConvHist_file[ZONE_0][INST_0], geometry_container, solver_container, config_container, integration_container, false, 0.0, ZONE_FLOW, INST_0); - - /*--- If the convergence criteria is met for the flow, break the loop ---*/ - StopCalc_Flow = integration_container[ZONE_FLOW][INST_0][FLOW_SOL]->GetConvergence(); - if (StopCalc_Flow) break; - - } - - } - else if ( dyn_fsi ) { - - /*--- For unsteady flow simulations, we need to loop over nIntIter for the number of time steps ---*/ - - nIntIter = config_container[ZONE_FLOW]->GetUnst_nIntIter(); - - for (IntIter = 0; IntIter < nIntIter; IntIter++){ - - config_container[ZONE_FLOW]->SetIntIter(IntIter); - - iteration_container[ZONE_FLOW][INST_0]->Iterate(output, integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_FLOW, INST_0); - - /*--- If convergence was reached in every zone --*/ - - if (integration_container[ZONE_FLOW][INST_0][FLOW_SOL]->GetConvergence() == 1) break; - } - - /*--- Write the convergence history for the fluid (only screen output) ---*/ - - output->SetConvHistory_Body(NULL, geometry_container, solver_container, config_container, integration_container, true, 0.0, ZONE_FLOW, INST_0); - - } else { - - SU2_MPI::Error( "The definition of Fluid and Structural solvers is inconsistent for FSI applications ", CURRENT_FUNCTION); - - } - - /*--- Set the fluid convergence to false (to make sure FSI subiterations converge) ---*/ - - integration_container[ZONE_FLOW][INST_0][FLOW_SOL]->SetConvergence(false); - - /*-----------------------------------------------------------------*/ - /*------------------- Set FEA loads from fluid --------------------*/ - /*-----------------------------------------------------------------*/ - if(interface_container[ZONE_FLOW][ZONE_STRUCT] != NULL) - Transfer_Tractions(ZONE_FLOW, ZONE_STRUCT); - - /*-----------------------------------------------------------------*/ - /*------------------ Structural subiteration ----------------------*/ - /*-----------------------------------------------------------------*/ - - iteration_container[ZONE_STRUCT][INST_0]->Iterate(output, integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, ZONE_STRUCT, INST_0); - - /*--- Write the convergence history for the structure (only screen output) ---*/ - - output->SetConvHistory_Body(NULL, geometry_container, solver_container, config_container, integration_container, false, 0.0, ZONE_STRUCT, INST_0); - - /*--- Set the fluid convergence to false (to make sure FSI subiterations converge) ---*/ - - integration_container[ZONE_STRUCT][INST_0][FEA_SOL]->SetConvergence(false); - - /*-----------------------------------------------------------------*/ - /*----------------- Displacements relaxation ----------------------*/ - /*-----------------------------------------------------------------*/ - - Relaxation_Displacements(ZONE_STRUCT, ZONE_FLOW, OuterIter); - - /*-----------------------------------------------------------------*/ - /*-------------------- Check convergence --------------------------*/ - /*-----------------------------------------------------------------*/ - - Convergence = BGSConvergence(OuterIter, ZONE_FLOW, ZONE_STRUCT); - - /*-----------------------------------------------------------------*/ - /*-------------------- Output FSI history -------------------------*/ - /*-----------------------------------------------------------------*/ - - output->SpecialOutput_FSI(&FSIHist_file, geometry_container, solver_container, - config_container, integration_container, 0, - ZONE_FLOW, ZONE_STRUCT, false); - - if (Convergence) break; - - /*-----------------------------------------------------------------*/ - /*--------------------- Update OuterIter ---------------------------*/ - /*-----------------------------------------------------------------*/ - - OuterIter++; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetOuterIter(OuterIter); - - } - -} - -void CFSIDriver::Predict_Displacements(unsigned short donorZone, unsigned short targetZone) { - - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->PredictStruct_Displacement(geometry_container[donorZone][INST_0], config_container[donorZone], - solver_container[donorZone][INST_0]); - - /*--- For parallel simulations we need to communicate the predicted solution before updating the fluid mesh ---*/ - - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->InitiateComms(geometry_container[donorZone][INST_0][MESH_0], config_container[donorZone], SOLUTION_PRED); - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->CompleteComms(geometry_container[donorZone][INST_0][MESH_0], config_container[donorZone], SOLUTION_PRED); - -} - -void CFSIDriver::Predict_Tractions(unsigned short donorZone, unsigned short targetZone) { - -} - -void CFSIDriver::Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) { - - interface_container[donorZone][targetZone]->BroadcastData(solver_container[donorZone][INST_0][MESH_0][FEA_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - -} - -void CFSIDriver::Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) { - - - interface_container[donorZone][targetZone]->BroadcastData(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FEA_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone]); - -} - -void CFSIDriver::Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long OuterIter) { - - /*-------------------- Aitken's relaxation ------------------------*/ - - /*------------------- Compute the coefficient ---------------------*/ - - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->ComputeAitken_Coefficient(geometry_container[donorZone][INST_0], config_container[donorZone], - solver_container[donorZone][INST_0], OuterIter); - - /*----------------- Set the relaxation parameter ------------------*/ - - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->SetAitken_Relaxation(geometry_container[donorZone][INST_0], config_container[donorZone], - solver_container[donorZone][INST_0]); - - /*----------------- Communicate the predicted solution and the old one ------------------*/ - - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->InitiateComms(geometry_container[donorZone][INST_0][MESH_0], config_container[donorZone], SOLUTION_PRED_OLD); - solver_container[donorZone][INST_0][MESH_0][FEA_SOL]->CompleteComms(geometry_container[donorZone][INST_0][MESH_0], config_container[donorZone], SOLUTION_PRED_OLD); - - -} - -void CFSIDriver::Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long OuterIter) { - -} - -bool CFSIDriver::BGSConvergence(unsigned long IntIter, unsigned short ZONE_FLOW, unsigned short ZONE_STRUCT) { - - - int rank = MASTER_NODE; -#ifdef HAVE_MPI - int size; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); -#endif - - unsigned short iMarker; - unsigned short nVar_Flow = solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->GetnVar(), - nVar_Struct = solver_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL]->GetnVar(); - unsigned short iRes; - -// bool flow_converged_absolute = false, -// flow_converged_relative = false, -// struct_converged_absolute = false, -// struct_converged_relative = false; - - bool Convergence = false; - - /*--- Apply BC's to the structural adjoint - otherwise, clamped nodes have too values that make no sense... ---*/ - for (iMarker = 0; iMarker < config_container[ZONE_STRUCT]->GetnMarker_All(); iMarker++){ - switch (config_container[ZONE_STRUCT]->GetMarker_All_KindBC(iMarker)) { - case CLAMPED_BOUNDARY: - solver_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL]->BC_Clamped_Post(geometry_container[ZONE_STRUCT][INST_0][MESH_0], - numerics_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL][FEA_TERM],config_container[ZONE_STRUCT], iMarker); - break; - } - } - - /*--- Compute the residual for the flow and structural zones ---*/ - - /*--- Flow ---*/ - - solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->ComputeResidual_Multizone(geometry_container[ZONE_FLOW][INST_0][MESH_0], - config_container[ZONE_FLOW]); - - /*--- Structure ---*/ - - solver_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL]->ComputeResidual_Multizone(geometry_container[ZONE_STRUCT][INST_0][MESH_0], - config_container[ZONE_STRUCT]); - - - /*--- Retrieve residuals ---*/ - - /*--- Flow residuals ---*/ - - for (iRes = 0; iRes < nVar_Flow; iRes++){ - residual_flow[iRes] = log10(solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->GetRes_BGS(iRes)); - if (IntIter == 0) init_res_flow[iRes] = residual_flow[iRes]; - residual_flow_rel[iRes] = fabs(residual_flow[iRes] - init_res_flow[iRes]); - } - - /*--- Structure residuals ---*/ - - for (iRes = 0; iRes < nVar_Struct; iRes++){ - residual_struct[iRes] = log10(solver_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL]->GetRes_BGS(iRes)); - if (IntIter == 0) init_res_struct[iRes] = residual_struct[iRes]; - residual_struct_rel[iRes] = fabs(residual_struct[iRes] - init_res_struct[iRes]); - } - - /*--- Check convergence ---*/ -// flow_converged_absolute = ((residual_flow[0] < flow_criteria) && (residual_flow[nVar_Flow-1] < flow_criteria)); -// flow_converged_relative = ((residual_flow_rel[0] > flow_criteria_rel) && (residual_flow_rel[nVar_Flow-1] > flow_criteria_rel)); -// -// struct_converged_absolute = ((residual_struct[0] < structure_criteria) && (residual_struct[nVar_Flow-1] < structure_criteria)); -// struct_converged_relative = ((residual_struct_rel[0] > structure_criteria_rel) && (residual_struct_rel[nVar_Flow-1] > structure_criteria_rel)); - -// Convergence = ((flow_converged_absolute && struct_converged_absolute) || -// (flow_converged_absolute && struct_converged_relative) || -// (flow_converged_relative && struct_converged_relative) || -// (flow_converged_relative && struct_converged_absolute)); - - if (rank == MASTER_NODE){ - - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - cout << "Convergence summary for BGS iteration "; - cout << IntIter << endl; - cout << endl; - /*--- TODO: This is a workaround until the TestCases.py script incorporates new classes for nested loops. ---*/ - cout << "Iter[ID]" << " BGSRes[Rho]" << " BGSRes[RhoE]" << " BGSRes[Ux]" << " BGSRes[Uy]" << endl; - cout.precision(6); cout.setf(ios::fixed, ios::floatfield); - cout.width(8); cout << IntIter*1000; - cout.width(15); cout << residual_flow[0]; - cout.width(15); cout << residual_flow[nVar_Flow-1]; - cout.width(15); cout << residual_struct[0]; - cout.width(15); cout << residual_struct[1]; - cout << endl; - - } - - integration_container[ZONE_STRUCT][INST_0][FEA_SOL]->Convergence_Monitoring_FSI(geometry_container[ZONE_STRUCT][INST_0][MESH_0], config_container[ZONE_STRUCT], solver_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL], IntIter); - - Convergence = integration_container[ZONE_STRUCT][INST_0][FEA_SOL]->GetConvergence_FSI(); - - - /*--- Flow ---*/ - - solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->UpdateSolution_BGS(geometry_container[ZONE_FLOW][INST_0][MESH_0], - config_container[ZONE_FLOW]); - - /*--- Structure ---*/ - - solver_container[ZONE_STRUCT][INST_0][MESH_0][FEA_SOL]->UpdateSolution_BGS(geometry_container[ZONE_STRUCT][INST_0][MESH_0], - config_container[ZONE_STRUCT]); - - if (rank == MASTER_NODE) cout.setf(ios::scientific, ios::floatfield); - - return Convergence; - -} - -void CFSIDriver::Update() { - - /*--- As of now, we are coding it for just 2 zones. ---*/ - /*--- This will become more general, but we need to modify the configuration for that ---*/ - unsigned short ZONE_FLOW = 0, ZONE_STRUCT = 1; - - ExtIter = config_container[ZONE_FLOW]->GetExtIter(); - - /*-----------------------------------------------------------------*/ - /*--------------------- Enforce continuity ------------------------*/ - /*-----------------------------------------------------------------*/ - - /*--- Enforces that the geometry of the flow corresponds to the converged, relaxed solution ---*/ - - /*-------------------- Transfer the displacements --------------------*/ - - Transfer_Displacements(ZONE_STRUCT, ZONE_FLOW); - - /*-------------------- Set the grid movement -------------------------*/ - - - iteration_container[ZONE_FLOW][INST_0]->SetGrid_Movement(geometry_container[ZONE_FLOW][INST_0], - surface_movement[ZONE_FLOW], grid_movement[ZONE_FLOW][INST_0], - solver_container[ZONE_FLOW][INST_0], config_container[ZONE_FLOW], 0, ExtIter ); - - /*--- TODO: Temporary output of objective function for Flow OFs. Needs to be integrated into the refurbished output ---*/ - - - if (rank == MASTER_NODE){ - - /*--- Choose the filename of the objective function ---*/ - - ofstream myfile_res; - bool of_output = false; - su2double objective_function = 0.0; - - switch (config_container[ZONE_FLOW]->GetKind_ObjFunc()) { - case DRAG_COEFFICIENT: - myfile_res.open("of_drag.opt"); - objective_function = solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->GetTotal_CD(); - of_output = true; - break; - case LIFT_COEFFICIENT: - myfile_res.open("of_lift.opt"); - objective_function = solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->GetTotal_CL(); - of_output = true; - break; - case EFFICIENCY: - myfile_res.open("of_efficiency.opt"); - objective_function = solver_container[ZONE_FLOW][INST_0][MESH_0][FLOW_SOL]->GetTotal_CEff(); - of_output = true; - break; - default: - of_output = false; - break; - } - - if (of_output){ - - myfile_res.precision(15); - myfile_res << scientific << objective_function << endl; - myfile_res.close(); - - } - - } - - /*-----------------------------------------------------------------*/ - /*-------------------- Update fluid solver ------------------------*/ - /*-----------------------------------------------------------------*/ - - iteration_container[ZONE_FLOW][INST_0]->Update(output, integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, ZONE_FLOW, INST_0); - - /*-----------------------------------------------------------------*/ - /*----------------- Update structural solver ----------------------*/ - /*-----------------------------------------------------------------*/ - - iteration_container[ZONE_STRUCT][INST_0]->Update(output, integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, ZONE_STRUCT, INST_0); - - - /*-----------------------------------------------------------------*/ - /*--------------- Update convergence parameter --------------------*/ - /*-----------------------------------------------------------------*/ - integration_container[ZONE_STRUCT][INST_0][FEA_SOL]->SetConvergence_FSI(false); - - -} - -void CFSIDriver::DynamicMeshUpdate(unsigned long ExtIter){ - -} - CDiscAdjFSIDriver::CDiscAdjFSIDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator) : CDriver(confFile, @@ -5523,23 +5067,23 @@ CDiscAdjFSIDriver::CDiscAdjFSIDriver(char* confFile, direct_iteration = new CIteration*[nZone]; unsigned short iZone; - for (iZone = 0; iZone < nZone; iZone++){ - switch (config_container[iZone]->GetKind_Solver()) { - case DISC_ADJ_INC_RANS: case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: - case DISC_ADJ_RANS: case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: - direct_iteration[iZone] = new CFluidIteration(config_container[iZone]); - nVar_Flow = solver_container[iZone][INST_0][MESH_0][ADJFLOW_SOL]->GetnVar(); - flow_criteria = config_container[iZone]->GetMinLogResidual_BGS_F(); - flow_criteria_rel = config_container[iZone]->GetOrderMagResidual_BGS_F(); - break; - case DISC_ADJ_FEM: - direct_iteration[iZone] = new CFEAIteration(config_container[iZone]); - nVar_Struct = solver_container[iZone][INST_0][MESH_0][ADJFEA_SOL]->GetnVar(); - structure_criteria = config_container[iZone]->GetMinLogResidual_BGS_S(); - structure_criteria_rel = config_container[iZone]->GetOrderMagResidual_BGS_S(); - break; - } - } +// for (iZone = 0; iZone < nZone; iZone++){ +// switch (config_container[iZone]->GetKind_Solver()) { +// case DISC_ADJ_INC_RANS: case DISC_ADJ_INC_EULER: case DISC_ADJ_INC_NAVIER_STOKES: +// case DISC_ADJ_RANS: case DISC_ADJ_EULER: case DISC_ADJ_NAVIER_STOKES: +// direct_iteration[iZone] = new CFluidIteration(config_container[iZone]); +// nVar_Flow = solver_container[iZone][INST_0][MESH_0][ADJFLOW_SOL]->GetnVar(); +// flow_criteria = config_container[iZone]->GetMinLogResidual_BGS_F(); +// flow_criteria_rel = config_container[iZone]->GetOrderMagResidual_BGS_F(); +// break; +// case DISC_ADJ_FEM: +// direct_iteration[iZone] = new CFEAIteration(config_container[iZone]); +// nVar_Struct = solver_container[iZone][INST_0][MESH_0][ADJFEA_SOL]->GetnVar(); +// structure_criteria = config_container[iZone]->GetMinLogResidual_BGS_S(); +// structure_criteria_rel = config_container[iZone]->GetOrderMagResidual_BGS_S(); +// break; +// } +// } init_res_flow = new su2double[nVar_Flow]; init_res_struct = new su2double[nVar_Struct]; @@ -5639,10 +5183,21 @@ CDiscAdjFSIDriver::CDiscAdjFSIDriver(char* confFile, myfile_res.close(); } - /*--- TODO: This is a workaround until the TestCases.py script incorporates new classes for nested loops. ---*/ - config_container[ZONE_0]->SetnExtIter(1); - config_container[ZONE_1]->SetnExtIter(1); - +// /*--- TODO: This is a workaround until the TestCases.py script incorporates new classes for nested loops. ---*/ +// config_container[ZONE_0]->SetnExtIter(1); +// config_container[ZONE_1]->SetnExtIter(1); + ConvHist_file = NULL; + ConvHist_file = new ofstream*[nZone]; + for (iZone = 0; iZone < nZone; iZone++) { + ConvHist_file[iZone] = NULL; + if (rank == MASTER_NODE){ + ConvHist_file[iZone] = new ofstream[nInst[iZone]]; + for (iInst = 0; iInst < nInst[iZone]; iInst++) { + output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst); + config_container[iZone]->SetHistFile(&ConvHist_file[iZone][INST_0]); + } + } + } } CDiscAdjFSIDriver::~CDiscAdjFSIDriver(void) { @@ -5673,7 +5228,7 @@ void CDiscAdjFSIDriver::Run( ) { unsigned short iZone; bool BGS_Converged = false; - unsigned long IntIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetIntIter(IntIter); + unsigned long IntIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetInnerIter(IntIter); unsigned long iOuterIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetOuterIter(iOuterIter); unsigned long nOuterIter = config_container[ZONE_FLOW]->GetnIterFSI(); @@ -5729,11 +5284,11 @@ void CDiscAdjFSIDriver::Preprocess(unsigned short ZONE_FLOW, unsigned short kind_recording){ unsigned long IntIter = 0, iPoint; - config_container[ZONE_0]->SetIntIter(IntIter); - unsigned short ExtIter = config_container[ZONE_FLOW]->GetExtIter(); + config_container[ZONE_0]->SetInnerIter(IntIter); + unsigned short ExtIter = config_container[ZONE_FLOW]->GetTimeIter(); - bool dual_time_1st = (config_container[ZONE_FLOW]->GetUnsteady_Simulation() == DT_STEPPING_1ST); - bool dual_time_2nd = (config_container[ZONE_FLOW]->GetUnsteady_Simulation() == DT_STEPPING_2ND); + bool dual_time_1st = (config_container[ZONE_FLOW]->GetTime_Marching() == DT_STEPPING_1ST); + bool dual_time_2nd = (config_container[ZONE_FLOW]->GetTime_Marching() == DT_STEPPING_2ND); bool turbulent = (config_container[ZONE_FLOW]->GetKind_Solver() == DISC_ADJ_RANS) || (config_container[ZONE_FLOW]->GetKind_Solver() == DISC_ADJ_INC_RANS); bool dual_time = (dual_time_1st || dual_time_2nd); @@ -5747,7 +5302,7 @@ void CDiscAdjFSIDriver::Preprocess(unsigned short ZONE_FLOW, /*--- For the unsteady adjoint, load direct solutions from restart files. ---*/ - if (config_container[ZONE_FLOW]->GetUnsteady_Simulation()) { + if (config_container[ZONE_FLOW]->GetTime_Marching()) { Direct_Iter_Flow = SU2_TYPE::Int(config_container[ZONE_FLOW]->GetUnst_AdjointIter()) - SU2_TYPE::Int(ExtIter) - 2; @@ -5896,9 +5451,9 @@ void CDiscAdjFSIDriver::Preprocess(unsigned short ZONE_FLOW, /*----------------------------------------------------------------------------*/ IntIter = 0; - config_container[ZONE_STRUCT]->SetIntIter(IntIter); - ExtIter = config_container[ZONE_STRUCT]->GetExtIter(); - bool dynamic = (config_container[ZONE_STRUCT]->GetDynamic_Analysis() == DYNAMIC); + config_container[ZONE_STRUCT]->SetInnerIter(IntIter); + ExtIter = config_container[ZONE_STRUCT]->GetTimeIter(); + bool dynamic = (config_container[ZONE_STRUCT]->GetTime_Domain()); int Direct_Iter_FEA; @@ -5983,12 +5538,12 @@ void CDiscAdjFSIDriver::PrintDirect_Residuals(unsigned short ZONE_FLOW, unsigned short ZONE_STRUCT, unsigned short kind_recording){ - unsigned short ExtIter = config_container[ZONE_FLOW]->GetExtIter(); + unsigned short ExtIter = config_container[ZONE_FLOW]->GetTimeIter(); bool turbulent = (config_container[ZONE_FLOW]->GetKind_Solver() == DISC_ADJ_RANS) || (config_container[ZONE_FLOW]->GetKind_Solver() == DISC_ADJ_INC_RANS); bool nonlinear_analysis = (config_container[ZONE_STRUCT]->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. - bool unsteady = config_container[ZONE_FLOW]->GetUnsteady_Simulation() != NONE; - bool dynamic = (config_container[ZONE_STRUCT]->GetDynamic_Analysis() == DYNAMIC); + bool unsteady = config_container[ZONE_FLOW]->GetTime_Marching() != NONE; + bool dynamic = (config_container[ZONE_STRUCT]->GetTime_Domain()); su2double val_OFunction = 0.0; string kind_OFunction; @@ -6165,9 +5720,9 @@ void CDiscAdjFSIDriver::Fluid_Iteration_Direct(unsigned short ZONE_FLOW, unsigne /*---- Sets all the cross dependencies for the flow variables -----*/ /*-----------------------------------------------------------------*/ - config_container[ZONE_FLOW]->SetIntIter(0); + config_container[ZONE_FLOW]->SetInnerIter(0); - direct_iteration[ZONE_FLOW]->Iterate(output, integration_container, geometry_container, + direct_iteration[ZONE_FLOW]->Iterate(output_container[ZONE_FLOW], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_FLOW, INST_0); @@ -6218,7 +5773,7 @@ void CDiscAdjFSIDriver::Structural_Iteration_Direct(unsigned short ZONE_FLOW, un /*--------------- Iterate the structural solver -------------------*/ /*-----------------------------------------------------------------*/ - direct_iteration[ZONE_STRUCT]->Iterate(output, integration_container, geometry_container, + direct_iteration[ZONE_STRUCT]->Iterate(output_container[ZONE_STRUCT], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_STRUCT, INST_0); @@ -6233,7 +5788,7 @@ void CDiscAdjFSIDriver::Structural_Iteration_Direct(unsigned short ZONE_FLOW, un void CDiscAdjFSIDriver::Mesh_Deformation_Direct(unsigned short ZONE_FLOW, unsigned short ZONE_STRUCT) { - unsigned long ExtIter = config_container[ZONE_STRUCT]->GetExtIter(); + unsigned long ExtIter = config_container[ZONE_STRUCT]->GetTimeIter(); /*-----------------------------------------------------------------*/ /*--------------------- Set MPI Solution --------------------------*/ @@ -6276,9 +5831,9 @@ void CDiscAdjFSIDriver::SetRecording(unsigned short ZONE_FLOW, unsigned short ZONE_STRUCT, unsigned short kind_recording){ - unsigned long IntIter = config_container[ZONE_0]->GetIntIter(); - bool unsteady = (config_container[ZONE_FLOW]->GetUnsteady_Simulation() != NONE); - bool dynamic = (config_container[ZONE_STRUCT]->GetDynamic_Analysis() == DYNAMIC); + unsigned long IntIter = config_container[ZONE_0]->GetInnerIter(); + bool unsteady = (config_container[ZONE_FLOW]->GetTime_Marching() != NONE); + bool dynamic = (config_container[ZONE_STRUCT]->GetTime_Domain()); string kind_DirectIteration = " "; string kind_AdjointIteration = " "; @@ -6377,7 +5932,7 @@ void CDiscAdjFSIDriver::SetRecording(unsigned short ZONE_FLOW, /* --- Reset the number of the internal iterations---*/ - config_container[ZONE_0]->SetIntIter(IntIter); + config_container[ZONE_0]->SetInnerIter(IntIter); } @@ -6495,10 +6050,10 @@ void CDiscAdjFSIDriver::Iterate_Block(unsigned short ZONE_FLOW, unsigned short kind_recording){ unsigned long IntIter=0, nIntIter = 1; - bool dual_time_1st = (config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST); - bool dual_time_2nd = (config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND); + bool dual_time_1st = (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST); + bool dual_time_2nd = (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND); bool dual_time = (dual_time_1st || dual_time_2nd); - bool dynamic = (config_container[ZONE_STRUCT]->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config_container[ZONE_STRUCT]->GetTime_Domain()); bool adjoint_convergence = false; @@ -6528,14 +6083,14 @@ void CDiscAdjFSIDriver::Iterate_Block(unsigned short ZONE_FLOW, } for (unsigned short iZone = 0; iZone < config_container[ZONE_FLOW]->GetnZone(); iZone++) - config_container[iZone]->SetIntIter(IntIter); + config_container[iZone]->SetInnerIter(IntIter); for(IntIter = 0; IntIter < nIntIter; IntIter++){ /*--- Set the internal iteration ---*/ for (unsigned short iZone = 0; iZone < config_container[ZONE_FLOW]->GetnZone(); iZone++) - config_container[iZone]->SetIntIter(IntIter); + config_container[iZone]->SetInnerIter(IntIter); /*--- Set the adjoint values of the flow and objective function ---*/ @@ -6698,32 +6253,32 @@ bool CDiscAdjFSIDriver::CheckConvergence(unsigned long IntIter, bool adjoint_convergence = false; - su2double residual_1, residual_2; +// su2double residual_1, residual_2; - if (kind_recording == FLOW_CONS_VARS) { +// if (kind_recording == FLOW_CONS_VARS) { - /*--- Set the convergence criteria (only residual possible as of now) ---*/ +// /*--- Set the convergence criteria (only residual possible as of now) ---*/ - residual_1 = log10(solver_container[ZONE_FLOW][INST_0][MESH_0][ADJFLOW_SOL]->GetRes_RMS(0)); - residual_2 = log10(solver_container[ZONE_FLOW][INST_0][MESH_0][ADJFLOW_SOL]->GetRes_RMS(1)); +// residual_1 = log10(solver_container[ZONE_FLOW][INST_0][MESH_0][ADJFLOW_SOL]->GetRes_RMS(0)); +// residual_2 = log10(solver_container[ZONE_FLOW][INST_0][MESH_0][ADJFLOW_SOL]->GetRes_RMS(1)); - flow_convergence = ((residual_1 < config_container[ZONE_FLOW]->GetMinLogResidual()) && - (residual_2 < config_container[ZONE_FLOW]->GetMinLogResidual())); +// flow_convergence = ((residual_1 < config_container[ZONE_FLOW]->GetMinLogResidual()) && +// (residual_2 < config_container[ZONE_FLOW]->GetMinLogResidual())); - } +// } - if (kind_recording == FEA_DISP_VARS) { +// if (kind_recording == FEA_DISP_VARS) { - /*--- Set the convergence criteria (only residual possible as of now) ---*/ +// /*--- Set the convergence criteria (only residual possible as of now) ---*/ - residual_1 = log10(solver_container[ZONE_STRUCT][INST_0][MESH_0][ADJFEA_SOL]->GetRes_RMS(0)); - residual_2 = log10(solver_container[ZONE_STRUCT][INST_0][MESH_0][ADJFEA_SOL]->GetRes_RMS(1)); +// residual_1 = log10(solver_container[ZONE_STRUCT][INST_0][MESH_0][ADJFEA_SOL]->GetRes_RMS(0)); +// residual_2 = log10(solver_container[ZONE_STRUCT][INST_0][MESH_0][ADJFEA_SOL]->GetRes_RMS(1)); - // Temporary, until function is added - struct_convergence = ((residual_1 < config_container[ZONE_STRUCT]->GetResidual_FEM_UTOL()) && - (residual_2 < config_container[ZONE_STRUCT]->GetResidual_FEM_UTOL())); +// // Temporary, until function is added +// struct_convergence = ((residual_1 < config_container[ZONE_STRUCT]->GetResidual_FEM_UTOL()) && +// (residual_2 < config_container[ZONE_STRUCT]->GetResidual_FEM_UTOL())); - } +// } switch (kind_recording){ case FLOW_CONS_VARS: adjoint_convergence = flow_convergence; break; @@ -6779,10 +6334,9 @@ void CDiscAdjFSIDriver::ConvergenceHistory(unsigned long IntIter, unsigned long BGS_Iter = config_container[ZONE_FLOW]->GetOuterIter(); - ofstream ConvHist_file; - if (rank == MASTER_NODE) - output->SetConvHistory_Header(&ConvHist_file, config_container[ZONE_0], ZONE_0, INST_0); - +// if (rank == MASTER_NODE) +// if ((!config_container[ZONE_0]->GetMultizone_Problem() && !config_container[ZONE_0]->GetSinglezone_Driver())) +// output_container[ZONE_0]->GetLegacyOutput()->SetConvHistory_Header(&ConvHist_file[ZONE_0][INST_0], config_container[ZONE_0], ZONE_0, INST_0); if (kind_recording == FLOW_CONS_VARS) { @@ -6806,12 +6360,12 @@ void CDiscAdjFSIDriver::ConvergenceHistory(unsigned long IntIter, } } - if (kind_recording == FEA_DISP_VARS) { - - /*--- Set the convergence criteria (only residual possible) ---*/ - output->SetConvHistory_Body(NULL, geometry_container, solver_container, config_container, integration_container, true, 0.0, ZONE_STRUCT, INST_0); +// if (kind_recording == FEA_DISP_VARS) { +// if ((!config_container[ZONE_0]->GetMultizone_Problem() && !config_container[ZONE_0]->GetSinglezone_Driver())) +// /*--- Set the convergence criteria (only residual possible) ---*/ +// output_container[ZONE_0]->GetLegacyOutput()->SetConvHistory_Body(NULL, geometry_container, solver_container, config_container, integration_container, true, 0.0, ZONE_STRUCT, INST_0); - } +// } } diff --git a/SU2_CFD/src/drivers/CDummyDriver.cpp b/SU2_CFD/src/drivers/CDummyDriver.cpp index a29d3d9dfc9b..1c4523d51e25 100644 --- a/SU2_CFD/src/drivers/CDummyDriver.cpp +++ b/SU2_CFD/src/drivers/CDummyDriver.cpp @@ -16,4 +16,9 @@ void CDummyDriver::StartSolver(){ cout << "No solver started. DRY_RUN option enabled. " << endl; cout << "--------------------------------------------" << endl; } + + for (iZone = 0; iZone < nZone; iZone++){ + output_container[iZone]->PrintVolumeFields(); + output_container[iZone]->PrintHistoryFields(); + } } diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index d2973ce87814..4485732a3fa9 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -137,18 +137,26 @@ CMultizoneDriver::~CMultizoneDriver(void) { delete [] residual[iZone]; delete [] residual_rel[iZone]; } - + + delete [] nVarZone; delete [] init_res; delete [] residual; delete [] residual_rel; - delete [] nVarZone; delete [] prefixed_motion; } void CMultizoneDriver::StartSolver() { - + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + + driver_config->Set_StartTime(StartTime); + /*--- Main external loop of the solver. Runs for the number of time steps required. ---*/ if (rank == MASTER_NODE) @@ -185,7 +193,7 @@ void CMultizoneDriver::StartSolver() { /*--- Monitor the computations after each iteration. ---*/ - Monitor(TimeIter); + StopCalc = Monitor(TimeIter); /*--- Output the solution in files. ---*/ @@ -204,12 +212,18 @@ void CMultizoneDriver::StartSolver() { void CMultizoneDriver::Preprocess(unsigned long TimeIter) { bool unsteady = driver_config->GetTime_Domain(); + + + /*--- Set the current time iteration in the config ---*/ + + driver_config->SetTimeIter(TimeIter); for (iZone = 0; iZone < nZone; iZone++){ /*--- Set the value of the external iteration to TimeIter. -------------------------------------*/ /*--- TODO: This should be generalised for an homogeneous criteria throughout the code. --------*/ - config_container[iZone]->SetExtIter(TimeIter); + config_container[iZone]->SetTimeIter(TimeIter); + /*--- Store the current physical time in the config container, as this can be used for verification / MMS. This should also be more @@ -222,15 +236,15 @@ void CMultizoneDriver::Preprocess(unsigned long TimeIter) { /*--- Read the target pressure for inverse design. ---------------------------------------------*/ /*--- TODO: This routine should be taken out of output, and made general for multiple zones. ---*/ - if (config_container[iZone]->GetInvDesign_Cp() == YES) - output->SetCp_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[iZone][INST_0][MESH_0], config_container[iZone], TimeIter); +// if (config_container[iZone]->GetInvDesign_Cp() == YES) +// output[iZone]->SetCp_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], +// geometry_container[iZone][INST_0][MESH_0], config_container[iZone], TimeIter); /*--- Read the target heat flux ----------------------------------------------------------------*/ /*--- TODO: This routine should be taken out of output, and made general for multiple zones. ---*/ - if (config_container[iZone]->GetInvDesign_HeatFlux() == YES) - output->SetHeatFlux_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[iZone][INST_0][MESH_0], config_container[iZone], TimeIter); +// if (config_container[iZone]->GetInvDesign_HeatFlux() == YES) +// output->SetHeatFlux_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], +// geometry_container[iZone][INST_0][MESH_0], config_container[iZone], TimeIter); /*--- Set the initial condition for EULER/N-S/RANS ---------------------------------------------*/ /*--- For FSI, this is set after the mesh has been moved. --------------------------------------*/ @@ -252,7 +266,7 @@ void CMultizoneDriver::Preprocess(unsigned long TimeIter) { /*--- Run a predictor step ---*/ for (iZone = 0; iZone < nZone; iZone++){ if (config_container[iZone]->GetPredictor()) - iteration_container[iZone][INST_0]->Predictor(output, integration_container, geometry_container, solver_container, + iteration_container[iZone][INST_0]->Predictor(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } @@ -277,7 +291,6 @@ void CMultizoneDriver::Run_GaussSeidel() { unsigned long iOuter_Iter; unsigned short jZone, UpdateMesh; bool DeformMesh = false; - unsigned long ExtIter = 0; bool Convergence = false; unsigned long OuterIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetOuterIter(OuterIter); @@ -293,6 +306,7 @@ void CMultizoneDriver::Run_GaussSeidel() { /*--- Set the OuterIter ---*/ config_container[iZone]->SetOuterIter(iOuter_Iter); + driver_config->SetOuterIter(iOuter_Iter); /*--- Transfer from all the remaining zones ---*/ for (jZone = 0; jZone < nZone; jZone++){ @@ -303,10 +317,10 @@ void CMultizoneDriver::Run_GaussSeidel() { } } /*--- If a mesh update is required due to the transfer of data ---*/ - if (UpdateMesh > 0) DynamicMeshUpdate(iZone, ExtIter); + if (UpdateMesh > 0) DynamicMeshUpdate(iZone, TimeIter); /*--- Iterate the zone as a block, either to convergence or to a max number of iterations ---*/ - iteration_container[iZone][INST_0]->Solve(output, integration_container, geometry_container, solver_container, + iteration_container[iZone][INST_0]->Solve(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); /*--- A corrector step can help preventing numerical instabilities ---*/ @@ -314,9 +328,6 @@ void CMultizoneDriver::Run_GaussSeidel() { } - /*--- This is temporary. Each zone has to be monitored independently. Right now, fixes CHT output. ---*/ - Monitor(iOuter_Iter); - Convergence = OuterConvergence(iOuter_Iter); if (Convergence) break; @@ -330,7 +341,6 @@ void CMultizoneDriver::Run_Jacobi() { unsigned long iOuter_Iter; unsigned short jZone, UpdateMesh; bool DeformMesh = false; - unsigned long ExtIter = 0; bool Convergence = false; unsigned long OuterIter = 0; for (iZone = 0; iZone < nZone; iZone++) config_container[iZone]->SetOuterIter(OuterIter); @@ -346,6 +356,7 @@ void CMultizoneDriver::Run_Jacobi() { /*--- Set the OuterIter ---*/ config_container[iZone]->SetOuterIter(iOuter_Iter); + driver_config->SetOuterIter(iOuter_Iter); /*--- Transfer from all the remaining zones ---*/ for (jZone = 0; jZone < nZone; jZone++){ @@ -356,7 +367,7 @@ void CMultizoneDriver::Run_Jacobi() { } } /*--- If a mesh update is required due to the transfer of data ---*/ - if (UpdateMesh > 0) DynamicMeshUpdate(iZone, ExtIter); + if (UpdateMesh > 0) DynamicMeshUpdate(iZone, TimeIter); } @@ -365,9 +376,10 @@ void CMultizoneDriver::Run_Jacobi() { /*--- Set the OuterIter ---*/ config_container[iZone]->SetOuterIter(iOuter_Iter); + driver_config->SetOuterIter(iOuter_Iter); /*--- Iterate the zone as a block, either to convergence or to a max number of iterations ---*/ - iteration_container[iZone][INST_0]->Solve(output, integration_container, geometry_container, solver_container, + iteration_container[iZone][INST_0]->Solve(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); /*--- A corrector step can help preventing numerical instabilities ---*/ @@ -386,82 +398,31 @@ void CMultizoneDriver::Run_Jacobi() { void CMultizoneDriver::Corrector(unsigned short val_iZone) { if (config_container[val_iZone]->GetRelaxation()) - iteration_container[val_iZone][INST_0]->Relaxation(output, integration_container, geometry_container, solver_container, + iteration_container[val_iZone][INST_0]->Relaxation(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); } bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { - - bool Convergence = false; - int rank = MASTER_NODE; -#ifdef HAVE_MPI - int size; - MPI_Comm_rank(MPI_COMM_WORLD, &rank); - MPI_Comm_size(MPI_COMM_WORLD, &size); -#endif - - unsigned short iRes, iVar; - unsigned short nVarSol; - - /*--- Compute the residual for the all the zones ---*/ + + /*--- Update the residual for the all the zones ---*/ + for (iZone = 0; iZone < nZone; iZone++){ - iVar = 0; // Initialize the variable index for each zone - + /*--- Account for all the solvers ---*/ + for (unsigned short iSol = 0; iSol < MAX_SOLS; iSol++){ - /*-- If the solver position iSol is enabled --*/ - if (solver_container[iZone][INST_0][MESH_0][iSol] != NULL){ - nVarSol = solver_container[iZone][INST_0][MESH_0][iSol]->GetnVar(); - - /*--- Compute the block residual on each solver ---*/ - solver_container[iZone][INST_0][MESH_0][iSol]->ComputeResidual_Multizone(geometry_container[iZone][INST_0][MESH_0], - config_container[iZone]); - - /*--- Loop over all the variables in the solver ---*/ - for (iRes = 0; iRes < nVarSol; iRes++){ - /*--- Store the log10 of the residual value ---*/ - residual[iZone][iVar] = log10(solver_container[iZone][INST_0][MESH_0][iSol]->GetRes_BGS(iRes)); - /*--- If it is the first iteration, the init_res is the current residual ---*/ - if (OuterIter == 0) init_res[iZone][iVar] = residual[iZone][iVar]; - /*--- residual_rel checks the difference in order of magnitude between the current and the initial residual ---*/ - residual_rel[iZone][iVar] = fabs(residual[iZone][iRes] - init_res[iZone][iRes]); - /*--- Move the position of the container ---*/ - iVar++; - } - } - } - } - - /*--- This still has to be generalised ---*/ - if (fsi){ - - /*--- This should be possible to change dinamically in the config ---*/ - if (rank == MASTER_NODE){ - - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - cout << "Convergence summary for BGS iteration "; - cout << OuterIter << endl; - cout << endl; - /*--- TODO: This is a workaround until the TestCases.py script incorporates new classes for nested loops. ---*/ - cout << "Iter[ID]" << " BGSRes[Rho]" << " BGSRes[RhoE]" << " BGSRes[Ux]" << " BGSRes[Uy]" << endl; - cout.precision(6); cout.setf(ios::fixed, ios::floatfield); - cout.width(8); cout << OuterIter*1000; - cout.width(15); cout << residual[ZONE_0][0]; - cout.width(15); cout << residual[ZONE_0][3]; - cout.width(15); cout << residual[ZONE_1][0]; - cout.width(15); cout << residual[ZONE_1][1]; - cout << endl; - } - for (iZone = 0; iZone < nZone; iZone++){ - if (config_container[iZone]->GetKind_Solver() == FEM_ELASTICITY){ - integration_container[iZone][INST_0][FEA_SOL]->Convergence_Monitoring_FSI(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], solver_container[iZone][INST_0][MESH_0][FEA_SOL], OuterIter); - Convergence = integration_container[iZone][INST_0][FEA_SOL]->GetConvergence_FSI(); + if (solver_container[iZone][INST_0][MESH_0][iSol] != NULL){ + solver_container[iZone][INST_0][MESH_0][iSol]->ComputeResidual_Multizone(geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); } } + + /*--- make sure that everything is loaded into the output container ---*/ + + output_container[iZone]->SetHistory_Output(geometry_container[iZone][INST_0][MESH_0],solver_container[iZone][INST_0][MESH_0], config_container[iZone]); + } - + /*--- Update the residual for the all the zones ---*/ for (iZone = 0; iZone < nZone; iZone++){ /*--- Accounting for all the solvers ---*/ @@ -473,25 +434,10 @@ bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { } } - if (rank == MASTER_NODE) cout.setf(ios::scientific, ios::floatfield); - - /*-----------------------------------------------------------------*/ - /*-------------------- Output FSI history -------------------------*/ - /*-----------------------------------------------------------------*/ - if (fsi){ - bool ZONE_FLOW=0, ZONE_FEA=1; - /*--- This is a hack to test it works. ---*/ - for (iZone = 0; iZone < nZone; iZone++){ - if (config_container[iZone]->GetKind_Solver() == FEM_ELASTICITY) ZONE_FEA = iZone; - if (config_container[iZone]->GetKind_Solver() == NAVIER_STOKES) ZONE_FLOW = iZone; - if (config_container[iZone]->GetKind_Solver() == INC_NAVIER_STOKES) ZONE_FLOW = iZone; - } - output->SpecialOutput_FSI(&FSIHist_file, geometry_container, solver_container, - config_container, integration_container, 0, - ZONE_FLOW, ZONE_FEA, false); - } + /*--- Print out the convergence data to screen and history file ---*/ + driver_output->SetMultizoneHistory_Output(output_container, config_container, driver_config, driver_config->GetTimeIter(), driver_config->GetOuterIter()); - return Convergence; + return driver_output->GetConvergence(); } @@ -515,9 +461,9 @@ void CMultizoneDriver::Update() { } } /*--- If a mesh update is required due to the transfer of data ---*/ - if (UpdateMesh > 0) DynamicMeshUpdate(iZone, ExtIter); + if (UpdateMesh > 0) DynamicMeshUpdate(iZone, TimeIter); - iteration_container[iZone][INST_0]->Update(output, integration_container, geometry_container, + iteration_container[iZone][INST_0]->Update(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); @@ -532,84 +478,30 @@ void CMultizoneDriver::Update() { } void CMultizoneDriver::Output(unsigned long TimeIter) { - - bool output_files = false; - - /*--- Determine whether a solution needs to be written - after the current iteration ---*/ - - if ( - - /*--- General if statements to print output statements ---*/ - - (TimeIter+1 >= config_container[ZONE_0]->GetnTime_Iter()) || (StopCalc) || - - /*--- Unsteady problems ---*/ - - (((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == TIME_STEPPING)) && - ((TimeIter == 0) || (ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0))) || - - ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && - ((TimeIter == 0) || ((TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0) || - ((TimeIter-1) % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) || - - ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && - ((TimeIter == 0) || ((TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) || - - ((config_container[ZONE_0]->GetDynamic_Analysis() == DYNAMIC) && - ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0))) || - - /*--- No inlet profile file found. Print template. ---*/ - - (config_container[ZONE_0]->GetWrt_InletFile()) - - ) { - - output_files = true; - - } - - /*--- Determine whether a solution doesn't need to be written - after the current iteration ---*/ - - if (config_container[ZONE_0]->GetFixed_CL_Mode()) { - if (config_container[ZONE_0]->GetnExtIter()-config_container[ZONE_0]->GetIter_dCL_dAlpha() - 1 < ExtIter) output_files = false; - if (config_container[ZONE_0]->GetnExtIter() - 1 == ExtIter) output_files = true; - } - - /*--- write the solution ---*/ - - if (output_files) { - - /*--- Time the output for performance benchmarking. ---*/ + + /*--- Time the output for performance benchmarking. ---*/ #ifndef HAVE_MPI - StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else - StopTime = MPI_Wtime(); + StopTime = MPI_Wtime(); #endif - UsedTimeCompute += StopTime-StartTime; + UsedTimeCompute += StopTime-StartTime; #ifndef HAVE_MPI - StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else - StartTime = MPI_Wtime(); + StartTime = MPI_Wtime(); #endif - - if (rank == MASTER_NODE) cout << endl << "-------------------------- File Output Summary --------------------------"; - - /*--- Execute the routine for writing restart, volume solution, - surface solution, and surface comma-separated value files. ---*/ - - output->SetResult_Files_Parallel(solver_container, geometry_container, config_container, TimeIter, nZone); - - - /*--- Execute the routine for writing special output. ---*/ - output->SetSpecial_Output(solver_container, geometry_container, config_container, TimeIter, nZone); - - - if (rank == MASTER_NODE) cout << "-------------------------------------------------------------------------" << endl << endl; - - /*--- Store output time and restart the timer for the compute phase. ---*/ + + bool wrote_files = false; + + for (iZone = 0; iZone < nZone; iZone++){ + wrote_files = output_container[iZone]->SetResult_Files(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], + solver_container[iZone][INST_0][MESH_0], TimeIter, StopCalc); + } + + if (wrote_files){ + #ifndef HAVE_MPI StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else @@ -623,33 +515,33 @@ void CMultizoneDriver::Output(unsigned long TimeIter) { #else StartTime = MPI_Wtime(); #endif - + driver_config->Set_StartTime(StartTime); } } -void CMultizoneDriver::DynamicMeshUpdate(unsigned long ExtIter) { +void CMultizoneDriver::DynamicMeshUpdate(unsigned long TimeIter) { bool harmonic_balance; for (iZone = 0; iZone < nZone; iZone++) { - harmonic_balance = (config_container[iZone]->GetUnsteady_Simulation() == HARMONIC_BALANCE); + harmonic_balance = (config_container[iZone]->GetTime_Marching() == HARMONIC_BALANCE); /*--- Dynamic mesh update ---*/ if ((config_container[iZone]->GetGrid_Movement()) && (!harmonic_balance) && (!fsi)) { iteration_container[iZone][INST_0]->SetGrid_Movement(geometry_container[iZone][INST_0],surface_movement[iZone], grid_movement[iZone][INST_0], solver_container[iZone][INST_0], - config_container[iZone], 0, ExtIter); + config_container[iZone], 0, TimeIter); } } } -void CMultizoneDriver::DynamicMeshUpdate(unsigned short val_iZone, unsigned long ExtIter) { +void CMultizoneDriver::DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) { /*--- Legacy dynamic mesh update - Only if GRID_MOVEMENT = YES ---*/ if (config_container[ZONE_0]->GetGrid_Movement()) { iteration_container[val_iZone][INST_0]->SetGrid_Movement(geometry_container[val_iZone][INST_0],surface_movement[val_iZone], grid_movement[val_iZone][INST_0], solver_container[val_iZone][INST_0], - config_container[val_iZone], 0, ExtIter); + config_container[val_iZone], 0, TimeIter); } /*--- New solver - all the other routines in SetGrid_Movement should be adapted to this one ---*/ @@ -753,3 +645,58 @@ bool CMultizoneDriver::Transfer_Data(unsigned short donorZone, unsigned short ta return UpdateMesh; } + +bool CMultizoneDriver::Monitor(unsigned long TimeIter){ + + unsigned long nOuterIter, OuterIter, nTimeIter; + su2double MaxTime, CurTime; + bool TimeDomain, InnerConvergence, FinalTimeReached, MaxIterationsReached; + + OuterIter = driver_config->GetOuterIter(); + nOuterIter = driver_config->GetnOuter_Iter(); + nTimeIter = driver_config->GetnTime_Iter(); + MaxTime = driver_config->GetMax_Time(); + CurTime = driver_output->GetHistoryFieldValue("CUR_TIME"); + + TimeDomain = driver_config->GetTime_Domain(); + + + /*--- Check whether the inner solver has converged --- */ + + if (TimeDomain == NO){ + + InnerConvergence = driver_output->GetConvergence(); + MaxIterationsReached = OuterIter+1 >= nOuterIter; + + if ((MaxIterationsReached || InnerConvergence) && (rank == MASTER_NODE)) { + cout << endl << "----------------------------- Solver Exit -------------------------------" << endl; + if (InnerConvergence) cout << "All convergence criteria satisfied." << endl; + else cout << endl << "Maximum number of iterations reached (OUTER_ITER = " << OuterIter+1 << ") before convergence." << endl; + driver_output->PrintConvergenceSummary(); + cout << "-------------------------------------------------------------------------" << endl; + } + + StopCalc = MaxIterationsReached || InnerConvergence; + } + + + if (TimeDomain == YES) { + + /*--- Check whether the outer time integration has reached the final time ---*/ + + FinalTimeReached = CurTime >= MaxTime; + MaxIterationsReached = TimeIter+1 >= nTimeIter; + + if ((FinalTimeReached || MaxIterationsReached) && (rank == MASTER_NODE)){ + cout << endl << "----------------------------- Solver Exit -------------------------------"; + if (FinalTimeReached) cout << endl << "Maximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; + else cout << endl << "Maximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; + cout << "-------------------------------------------------------------------------" << endl; + } + + StopCalc = FinalTimeReached || MaxIterationsReached; + } + + return StopCalc; + +} diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index 1ae8e86bcc02..4e9e8a066faf 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -55,6 +55,14 @@ CSinglezoneDriver::~CSinglezoneDriver(void) { } void CSinglezoneDriver::StartSolver() { + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + + config_container[ZONE_0]->Set_StartTime(StartTime); /*--- Main external loop of the solver. Runs for the number of time steps required. ---*/ @@ -64,13 +72,14 @@ void CSinglezoneDriver::StartSolver() { if (rank == MASTER_NODE){ cout << endl <<"Simulation Run using the Single-zone Driver" << endl; if (driver_config->GetTime_Domain()) - cout << "The simulation will run for " << driver_config->GetnTime_Iter() << " time steps." << endl; + cout << "The simulation will run for " + << driver_config->GetnTime_Iter() - config_container[ZONE_0]->GetRestart_Iter() << " time steps." << endl; } /*--- Set the initial time iteration to the restart iteration. ---*/ if (config_container[ZONE_0]->GetRestart() && driver_config->GetTime_Domain()) TimeIter = config_container[ZONE_0]->GetRestart_Iter(); - + /*--- Run the problem until the number of time iterations required is reached. ---*/ while ( TimeIter < config_container[ZONE_0]->GetnTime_Iter() ) { @@ -109,32 +118,24 @@ void CSinglezoneDriver::StartSolver() { } void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { - - /*--- Set the value of the external iteration to TimeIter. -------------------------------------*/ - /*--- TODO: This should be generalised for an homogeneous criteria throughout the code. --------*/ - config_container[ZONE_0]->SetExtIter(TimeIter); + + /*--- Set runtime option ---*/ + + Runtime_Options(); + + /*--- Set the current time iteration in the config ---*/ + + config_container[ZONE_0]->SetTimeIter(TimeIter); /*--- Store the current physical time in the config container, as this can be used for verification / MMS. This should also be more general once the drivers are more stable. ---*/ - if (config_container[ZONE_0]->GetUnsteady_Simulation()) + if (config_container[ZONE_0]->GetTime_Marching()) config_container[ZONE_0]->SetPhysicalTime(static_cast(TimeIter)*config_container[ZONE_0]->GetDelta_UnstTimeND()); else config_container[ZONE_0]->SetPhysicalTime(0.0); - /*--- Read the target pressure for inverse design. ---------------------------------------------*/ - /*--- TODO: This routine should be taken out of output, and made general for multiple zones. ---*/ - if (config_container[ZONE_0]->GetInvDesign_Cp() == YES) - output->SetCp_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[ZONE_0][INST_0][MESH_0], config_container[iZone], TimeIter); - - /*--- Read the target heat flux ----------------------------------------------------------------*/ - /*--- TODO: This routine should be taken out of output, and made general for multiple zones. ---*/ - if (config_container[ZONE_0]->GetInvDesign_HeatFlux() == YES) - output->SetHeatFlux_InverseDesign(solver_container[iZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[ZONE_0][INST_0][MESH_0], config_container[iZone], TimeIter); - /*--- Set the initial condition for EULER/N-S/RANS ---------------------------------------------*/ if ((config_container[ZONE_0]->GetKind_Solver() == EULER) || (config_container[ZONE_0]->GetKind_Solver() == NAVIER_STOKES) || @@ -151,7 +152,7 @@ void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { /*--- Run a predictor step ---*/ if (config_container[ZONE_0]->GetPredictor()) - iteration_container[ZONE_0][INST_0]->Predictor(output, integration_container, geometry_container, solver_container, + iteration_container[ZONE_0][INST_0]->Predictor(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- Perform a dynamic mesh update if required. ---*/ @@ -168,27 +169,27 @@ void CSinglezoneDriver::Run() { config_container[ZONE_0]->SetOuterIter(OuterIter); /*--- Iterate the zone as a block, either to convergence or to a max number of iterations ---*/ - iteration_container[ZONE_0][INST_0]->Solve(output, integration_container, geometry_container, solver_container, + iteration_container[ZONE_0][INST_0]->Solve(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); } void CSinglezoneDriver::Postprocess() { - iteration_container[ZONE_0][INST_0]->Postprocess(output, integration_container, geometry_container, solver_container, + iteration_container[ZONE_0][INST_0]->Postprocess(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); /*--- A corrector step can help preventing numerical instabilities ---*/ if (config_container[ZONE_0]->GetRelaxation()) - iteration_container[ZONE_0][INST_0]->Relaxation(output, integration_container, geometry_container, solver_container, + iteration_container[ZONE_0][INST_0]->Relaxation(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); } void CSinglezoneDriver::Update() { - iteration_container[ZONE_0][INST_0]->Update(output, integration_container, geometry_container, + iteration_container[ZONE_0][INST_0]->Update(output_container[ZONE_0], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, INST_0); @@ -196,83 +197,25 @@ void CSinglezoneDriver::Update() { void CSinglezoneDriver::Output(unsigned long TimeIter) { - bool output_files = false; - - /*--- Determine whether a solution needs to be written - after the current iteration ---*/ - - if ( - - /*--- General if statements to print output statements ---*/ - - (TimeIter+1 >= config_container[ZONE_0]->GetnTime_Iter()) || (StopCalc) || - - /*--- Unsteady problems ---*/ - - (((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == TIME_STEPPING)) && - ((TimeIter == 0) || (ExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0))) || - - ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && - ((TimeIter == 0) || ((TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0) || - ((TimeIter-1) % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) || - - ((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND) && - ((TimeIter == 0) || ((TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) || - - ((config_container[ZONE_0]->GetDynamic_Analysis() == DYNAMIC) && - ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0))) || - - /*--- No inlet profile file found. Print template. ---*/ - - (config_container[ZONE_0]->GetWrt_InletFile()) - - ) { - - output_files = true; - - } - - /*--- Determine whether a solution doesn't need to be written - after the current iteration ---*/ - - if (config_container[ZONE_0]->GetFixed_CL_Mode()) { - if (config_container[ZONE_0]->GetnExtIter()-config_container[ZONE_0]->GetIter_dCL_dAlpha() - 1 < ExtIter) output_files = false; - if (config_container[ZONE_0]->GetnExtIter() - 1 == ExtIter) output_files = true; - } - - /*--- write the solution ---*/ - - if (output_files) { - - /*--- Time the output for performance benchmarking. ---*/ + /*--- Time the output for performance benchmarking. ---*/ #ifndef HAVE_MPI - StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else - StopTime = MPI_Wtime(); + StopTime = MPI_Wtime(); #endif - UsedTimeCompute += StopTime-StartTime; + UsedTimeCompute += StopTime-StartTime; #ifndef HAVE_MPI - StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else - StartTime = MPI_Wtime(); + StartTime = MPI_Wtime(); #endif - - if (rank == MASTER_NODE) cout << endl << "-------------------------- File Output Summary --------------------------"; - - /*--- Execute the routine for writing restart, volume solution, - surface solution, and surface comma-separated value files. ---*/ - - output->SetResult_Files_Parallel(solver_container, geometry_container, config_container, TimeIter, nZone); - - - /*--- Execute the routine for writing special output. ---*/ - output->SetSpecial_Output(solver_container, geometry_container, config_container, TimeIter, nZone); - - - if (rank == MASTER_NODE) cout << "-------------------------------------------------------------------------" << endl << endl; - - /*--- Store output time and restart the timer for the compute phase. ---*/ + + bool wrote_files = output_container[ZONE_0]->SetResult_Files(geometry_container[ZONE_0][INST_0][MESH_0], + config_container[ZONE_0], + solver_container[ZONE_0][INST_0][MESH_0], TimeIter, StopCalc); + + if (wrote_files){ + #ifndef HAVE_MPI StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else @@ -286,18 +229,17 @@ void CSinglezoneDriver::Output(unsigned long TimeIter) { #else StartTime = MPI_Wtime(); #endif - + config_container[ZONE_0]->Set_StartTime(StartTime); } +} -} - -void CSinglezoneDriver::DynamicMeshUpdate(unsigned long ExtIter) { +void CSinglezoneDriver::DynamicMeshUpdate(unsigned long TimeIter) { /*--- Legacy dynamic mesh update - Only if GRID_MOVEMENT = YES ---*/ if (config_container[ZONE_0]->GetGrid_Movement()) { iteration_container[ZONE_0][INST_0]->SetGrid_Movement(geometry_container[ZONE_0][INST_0],surface_movement[ZONE_0], grid_movement[ZONE_0][INST_0], solver_container[ZONE_0][INST_0], - config_container[ZONE_0], 0, ExtIter); + config_container[ZONE_0], 0, TimeIter); } /*--- New solver - all the other routines in SetGrid_Movement should be adapted to this one ---*/ @@ -313,3 +255,81 @@ void CSinglezoneDriver::DynamicMeshUpdate(unsigned long ExtIter) { } +bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ + + unsigned long nInnerIter, InnerIter, nTimeIter; + su2double MaxTime, CurTime; + bool TimeDomain, InnerConvergence, FinalTimeReached, MaxIterationsReached; + + nInnerIter = config_container[ZONE_0]->GetnInner_Iter(); + InnerIter = config_container[ZONE_0]->GetInnerIter(); + nTimeIter = config_container[ZONE_0]->GetnTime_Iter(); + MaxTime = config_container[ZONE_0]->GetMax_Time(); + CurTime = output_container[ZONE_0]->GetHistoryFieldValue("CUR_TIME"); + + TimeDomain = config_container[ZONE_0]->GetTime_Domain(); + + + /*--- Check whether the inner solver has converged --- */ + + if (TimeDomain == NO){ + + InnerConvergence = output_container[ZONE_0]->GetConvergence(); + MaxIterationsReached = InnerIter+1 >= nInnerIter; + + if ((MaxIterationsReached || InnerConvergence) && (rank == MASTER_NODE)) { + cout << endl << "----------------------------- Solver Exit -------------------------------" << endl; + if (InnerConvergence) cout << "All convergence criteria satisfied." << endl; + else cout << endl << "Maximum number of iterations reached (ITER = " << nInnerIter << " ) before convergence." << endl; + output_container[ZONE_0]->PrintConvergenceSummary(); + cout << "-------------------------------------------------------------------------" << endl; + } + + StopCalc = MaxIterationsReached || InnerConvergence; + } + + + if (TimeDomain == YES) { + + /*--- Check whether the outer time integration has reached the final time ---*/ + + FinalTimeReached = CurTime >= MaxTime; + MaxIterationsReached = TimeIter+1 >= nTimeIter; + + if ((FinalTimeReached || MaxIterationsReached) && (rank == MASTER_NODE)){ + cout << endl << "----------------------------- Solver Exit -------------------------------"; + if (FinalTimeReached) cout << endl << "Maximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; + else cout << endl << "Maximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; + cout << "-------------------------------------------------------------------------" << endl; + } + + StopCalc = FinalTimeReached || MaxIterationsReached; + } + + /*--- Reset the inner convergence --- */ + + output_container[ZONE_0]->SetConvergence(false); + + /*--- Increase the total iteration count --- */ + + IterCount += config_container[ZONE_0]->GetInnerIter()+1; + + return StopCalc; +} + +void CSinglezoneDriver::Runtime_Options(){ + + ifstream runtime_configfile; + + /*--- Try to open the runtime config file ---*/ + + runtime_configfile.open(runtime_file_name, ios::in); + + /*--- If succeeded create a temporary config object ---*/ + + if (runtime_configfile.good()){ + CConfig *runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); + delete runtime; + } + +} diff --git a/SU2_CFD/src/integration_structure.cpp b/SU2_CFD/src/integration_structure.cpp index e87782224931..2fa8814dc77c 100644 --- a/SU2_CFD/src/integration_structure.cpp +++ b/SU2_CFD/src/integration_structure.cpp @@ -65,8 +65,8 @@ void CIntegration::Space_Integration(CGeometry *geometry, unsigned short iMarker, KindBC; unsigned short MainSolver = config->GetContainerPosition(RunTime_EqSystem); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Compute inviscid residuals ---*/ @@ -209,20 +209,18 @@ void CIntegration::Space_Integration_FEM(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config, - unsigned short RunTime_EqSystem, - unsigned long Iteration) { + unsigned short RunTime_EqSystem) { unsigned short iMarker; - bool initial_calc = (config->GetExtIter() == 0); // Checks if it is the first calculation. + bool initial_calc = (config->GetTimeIter() == 0); // Checks if it is the first calculation. bool linear_analysis = (config->GetGeometricConditions() == SMALL_DEFORMATIONS); // Linear analysis. - bool first_iter = (config->GetIntIter() == 0); // Checks if it is the first iteration - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool first_iter = (config->GetInnerIter() == 0); // Checks if it is the first iteration unsigned short IterativeScheme = config->GetKind_SpaceIteScheme_FEA(); // Iterative schemes: NEWTON_RAPHSON, MODIFIED_NEWTON_RAPHSON unsigned short MainSolver = config->GetContainerPosition(RunTime_EqSystem); bool restart = config->GetRestart(); // Restart solution - bool initial_calc_restart = (SU2_TYPE::Int(config->GetExtIter()) == config->GetDyn_RestartIter()); // Restart iteration + bool initial_calc_restart = (SU2_TYPE::Int(config->GetTimeIter()) == SU2_TYPE::Int(config->GetRestart_Iter())); // Restart iteration /*--- Compute Mass Matrix ---*/ /*--- The mass matrix is computed only once, at the beginning of the calculation, no matter whether the ---*/ @@ -230,7 +228,7 @@ void CIntegration::Space_Integration_FEM(CGeometry *geometry, /*--- If the analysis is linear, only a the constitutive term of the stiffness matrix has to be computed ---*/ /*--- This is done only once, at the beginning of the calculation. From then on, K is constant ---*/ - if ((linear_analysis && (initial_calc || dynamic)) || + if ((linear_analysis && (initial_calc && first_iter)) || (linear_analysis && restart && initial_calc_restart)) { solver_container[MainSolver]->Compute_StiffMatrix(geometry, numerics, config); } @@ -323,7 +321,7 @@ void CIntegration::Adjoint_Setup(CGeometry ****geometry, CSolver *****solver_con } void CIntegration::Time_Integration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iRKStep, - unsigned short RunTime_EqSystem, unsigned long Iteration) { + unsigned short RunTime_EqSystem) { unsigned short MainSolver = config->GetContainerPosition(RunTime_EqSystem); unsigned short KindSolver = config->GetKind_Solver(); @@ -369,7 +367,7 @@ void CIntegration::Time_Integration(CGeometry *geometry, CSolver **solver_contai } void CIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics, CConfig *config, - unsigned short RunTime_EqSystem, unsigned long Iteration) { + unsigned short RunTime_EqSystem) { unsigned short iMarker; @@ -441,132 +439,6 @@ void CIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver **solver_co } -void CIntegration::Convergence_Monitoring(CGeometry *geometry, CConfig *config, unsigned long Iteration, - su2double monitor, unsigned short iMesh) { - - unsigned short iCounter; - - /*--- Initialize some variables for controlling the output frequency. ---*/ - - bool DualTime_Iteration = false; - unsigned long iIntIter = config->GetIntIter(); - unsigned long iExtIter = config->GetExtIter(); - bool Unsteady = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool In_NoDualTime = (!DualTime_Iteration && (iExtIter % config->GetWrt_Con_Freq() == 0)); - bool In_DualTime_0 = (DualTime_Iteration && (iIntIter % config->GetWrt_Con_Freq_DualTime() == 0)); - bool In_DualTime_1 = (!DualTime_Iteration && Unsteady); - bool In_DualTime_2 = (Unsteady && DualTime_Iteration && (iExtIter % config->GetWrt_Con_Freq() == 0)); - bool In_DualTime_3 = (Unsteady && !DualTime_Iteration && (iExtIter % config->GetWrt_Con_Freq() == 0)); - - if ((In_NoDualTime || In_DualTime_0 || In_DualTime_1) && (In_NoDualTime || In_DualTime_2 || In_DualTime_3)) { - - bool Already_Converged = Convergence; - - /*--- Cauchy based convergence criteria ---*/ - - if (config->GetConvCriteria() == CAUCHY) { - - /*--- Initialize at the fist iteration ---*/ - - if (Iteration == 0) { - Cauchy_Value = 0.0; - Cauchy_Counter = 0; - for (iCounter = 0; iCounter < config->GetCauchy_Elems(); iCounter++) - Cauchy_Serie[iCounter] = 0.0; - } - - Old_Func = New_Func; - New_Func = monitor; - Cauchy_Func = fabs(New_Func - Old_Func); - - Cauchy_Serie[Cauchy_Counter] = Cauchy_Func; - Cauchy_Counter++; - - if (Cauchy_Counter == config->GetCauchy_Elems()) Cauchy_Counter = 0; - - Cauchy_Value = 1; - if (Iteration >= config->GetCauchy_Elems()) { - Cauchy_Value = 0; - for (iCounter = 0; iCounter < config->GetCauchy_Elems(); iCounter++) - Cauchy_Value += Cauchy_Serie[iCounter]; - } - - if (Cauchy_Value >= config->GetCauchy_Eps()) { Convergence = false; Convergence_FullMG = false; } - else { Convergence = true; Convergence_FullMG = true; } - - } - - /*--- Residual based convergence criteria ---*/ - - if (config->GetConvCriteria() == RESIDUAL) { - - /*--- Compute the initial value ---*/ - - if (Iteration == config->GetStartConv_Iter() ) InitResidual = monitor; - if (monitor > InitResidual) InitResidual = monitor; - - /*--- Check the convergence ---*/ - - if (((fabs(InitResidual - monitor) >= config->GetOrderMagResidual()) && (monitor < InitResidual)) || - (monitor <= config->GetMinLogResidual())) { Convergence = true; Convergence_FullMG = true; } - else { Convergence = false; Convergence_FullMG = false; } - - } - - /*--- Do not apply any convergence criteria of the number - of iterations is less than a particular value ---*/ - - if (Iteration < config->GetStartConv_Iter()) { - Convergence = false; - Convergence_FullMG = false; - } - - if (Already_Converged) { Convergence = true; Convergence_FullMG = true; } - - - /*--- Apply the same convergence criteria to all the processors ---*/ - -#ifdef HAVE_MPI - - unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL; - sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0; - rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0; - - /*--- Convergence criteria ---*/ - - sbuf_conv[0] = Convergence; - SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - - /*-- Compute global convergence criteria in the master node --*/ - - sbuf_conv[0] = 0; - if (rank == MASTER_NODE) { - if (rbuf_conv[0] == size) sbuf_conv[0] = 1; - else sbuf_conv[0] = 0; - } - - SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, MPI_COMM_WORLD); - - if (sbuf_conv[0] == 1) { Convergence = true; Convergence_FullMG = true; } - else { Convergence = false; Convergence_FullMG = false; } - - delete [] sbuf_conv; - delete [] rbuf_conv; - -#endif - - /*--- Stop the simulation in case a nan appears, do not save the solution ---*/ - - if (monitor != monitor) { - SU2_MPI::Error("SU2 has diverged (NaN detected).", CURRENT_FUNCTION); - } - - if (config->GetFinestMesh() != MESH_0 ) Convergence = false; - - } - -} void CIntegration::SetDualTime_Solver(CGeometry *geometry, CSolver *solver, CConfig *config, unsigned short iMesh) { unsigned long iPoint; @@ -725,280 +597,3 @@ void CIntegration::SetFEM_StructuralSolver(CGeometry *geometry, CSolver **solver } } - -void CIntegration::Convergence_Monitoring_FEM(CGeometry *geometry, CConfig *config, CSolver *solver, unsigned long iOuterIter) { - - su2double Reference_UTOL, Reference_RTOL, Reference_ETOL; - su2double Residual_UTOL, Residual_RTOL, Residual_ETOL; - - bool Already_Converged = Convergence; - - Reference_UTOL = config->GetResidual_FEM_UTOL(); - Reference_RTOL = config->GetResidual_FEM_RTOL(); - Reference_ETOL = config->GetResidual_FEM_ETOL(); - - Residual_UTOL = log10(solver->GetRes_FEM(0)); - Residual_RTOL = log10(solver->GetRes_FEM(1)); - Residual_ETOL = log10(solver->GetRes_FEM(2)); - - // cout << "Reference - UTOL: " << Reference_UTOL << " ETOL: " << Reference_ETOL << " RTOL: " << Reference_RTOL << endl; - // cout << "Residual - UTOL: " << Residual_UTOL << " ETOL: " << Residual_ETOL << " RTOL: " << Residual_RTOL << endl; - - if ((Residual_UTOL <= Reference_UTOL) && - (Residual_ETOL <= Reference_ETOL) && - (Residual_RTOL <= Reference_RTOL)) { - Convergence = true; - } - - if (Already_Converged) Convergence = true; - - - /*--- Apply the same convergence criteria to all the processors ---*/ - -#ifdef HAVE_MPI - - unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL; - sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0; - rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0; - - /*--- Convergence criteria ---*/ - - sbuf_conv[0] = Convergence; - SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - - /*-- Compute global convergence criteria in the master node --*/ - - sbuf_conv[0] = 0; - if (rank == MASTER_NODE) { - if (rbuf_conv[0] == size) sbuf_conv[0] = 1; - else sbuf_conv[0] = 0; - } - - SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, MPI_COMM_WORLD); - - if (sbuf_conv[0] == 1) { Convergence = true; } - else { Convergence = false; } - - delete [] sbuf_conv; - delete [] rbuf_conv; - -#endif - -} - -void CIntegration::Convergence_Monitoring_FEM_Adj(CGeometry *geometry, CConfig *config, CSolver *solver, unsigned long iOuterIter) { - - su2double val_I, Max_Val_I; - - bool Already_Converged = Convergence; - - Max_Val_I = config->GetCriteria_FEM_ADJ(); - val_I = log10(solver->Get_val_I()); - - // cout << "Reference - UTOL: " << Reference_UTOL << " ETOL: " << Reference_ETOL << " RTOL: " << Reference_RTOL << endl; - // cout << "Residual - UTOL: " << Residual_UTOL << " ETOL: " << Residual_ETOL << " RTOL: " << Residual_RTOL << endl; - - if (val_I <= Max_Val_I){ - Convergence = true; - } - - if (Already_Converged) Convergence = true; - - - /*--- Apply the same convergence criteria to all the processors ---*/ - -#ifdef HAVE_MPI - - unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL; - sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0; - rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0; - - /*--- Convergence criteria ---*/ - - sbuf_conv[0] = Convergence; - SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - - /*-- Compute global convergence criteria in the master node --*/ - - sbuf_conv[0] = 0; - if (rank == MASTER_NODE) { - if (rbuf_conv[0] == size) sbuf_conv[0] = 1; - else sbuf_conv[0] = 0; - } - - SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, MPI_COMM_WORLD); - - if (sbuf_conv[0] == 1) { Convergence = true; } - else { Convergence = false; } - - delete [] sbuf_conv; - delete [] rbuf_conv; - -#endif - -} - - -void CIntegration::Convergence_Monitoring_FSI(CGeometry *fea_geometry, CConfig *fea_config, CSolver *fea_solver, unsigned long iOuterIter) { - - su2double FEA_check[2] = {0.0, 0.0}; - su2double magResidualFSI = 0.0, logResidualFSI_initial = 0.0, logResidualFSI = 0.0; - su2double magResidualFSI_criteria, logResidualFSI_criteria; - - unsigned long iExtIter = fea_config->GetExtIter(); - - unsigned long iPoint, iDim; - unsigned long nPointDomain, nDim; - su2double *dispPred, *dispPred_Old; - su2double deltaU, deltaURad, deltaURes, deltaURes_recv = 0.0; - - magResidualFSI_criteria = -1*fea_config->GetOrderMagResidualFSI(); - logResidualFSI_criteria = fea_config->GetMinLogResidualFSI(); - - deltaURes = 0.0; - - /*--- Only when there is movement it makes sense to check convergence (otherwise, it is always converged...) ---*/ - /*--- The same with the first iteration, if we are doing strongly coupled we need at least two. ---*/ - - if (iOuterIter == 0) { - /*--- Set the convergence values to 0.0 --*/ - fea_solver->SetFSI_ConvValue(0,0.0); - fea_solver->SetFSI_ConvValue(1,0.0); - - } - else if (iOuterIter > 0) { - - // We loop only over the points that belong to the processor - nPointDomain = fea_geometry->GetnPointDomain(); - nDim = fea_geometry->GetnDim(); - - for (iPoint=0; iPoint < nPointDomain; iPoint++) { - - deltaURad = 0.0; - - dispPred = fea_solver->node[iPoint]->GetSolution_Pred(); - dispPred_Old = fea_solver->node[iPoint]->GetSolution_Pred_Old(); - - for (iDim = 0; iDim < nDim; iDim++) { - - /*--- Compute the deltaU, and add deltaU2 to deltaURad ---*/ - deltaU = dispPred[iDim] - dispPred_Old[iDim]; - deltaURad += deltaU * deltaU; - - } - - /*--- The residual is the maximum of the values of sqrt(deltaURad) computed ---*/ - deltaURad = sqrt(deltaURad); - deltaURes = max(deltaURes, deltaURad); - - } - - // We need to communicate the maximum residual throughout the different processors - -#ifdef HAVE_MPI - /*--- We sum the squares of the norms across the different processors ---*/ - SU2_MPI::Allreduce(&deltaURes, &deltaURes_recv, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); -#else - deltaURes_recv = deltaURes; -#endif - - /*--- Store the FSI residual ---*/ - fea_solver->SetFSI_Residual(deltaURes_recv); - - if (iOuterIter == 1) { - fea_solver->SetFSI_ConvValue(0,deltaURes_recv); - logResidualFSI_initial = log10(deltaURes_recv); - - if (logResidualFSI_initial < logResidualFSI_criteria) Convergence_FSI = true; - - } - else { - fea_solver->SetFSI_ConvValue(1,deltaURes_recv); - FEA_check[0] = fea_solver->GetFSI_ConvValue(0); - logResidualFSI_initial = log10(FEA_check[0]); - logResidualFSI = log10(deltaURes_recv); - - magResidualFSI=logResidualFSI-logResidualFSI_initial; - - if ((logResidualFSI < logResidualFSI_criteria) || (magResidualFSI < magResidualFSI_criteria)) Convergence_FSI = true; - } - - } - - /*--- Apply the same convergence criteria to all the processors ---*/ - -#ifdef HAVE_MPI - - unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL; - sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0; - rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0; - - /*--- Convergence criteria ---*/ - - sbuf_conv[0] = Convergence_FSI; - SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - - /*-- Compute global convergence criteria in the master node --*/ - - sbuf_conv[0] = 0; - if (rank == MASTER_NODE) { - if (rbuf_conv[0] == size) sbuf_conv[0] = 1; - else sbuf_conv[0] = 0; - } - - SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, MPI_COMM_WORLD); - - if (sbuf_conv[0] == 1) { Convergence_FSI = true; } - else { Convergence_FSI = false; } - - delete [] sbuf_conv; - delete [] rbuf_conv; - -#endif - - if (rank == MASTER_NODE) { - - su2double WAitken; - unsigned short RelaxMethod_FSI = fea_config->GetRelaxation_Method_FSI(); - - if (RelaxMethod_FSI == NO_RELAXATION) { - WAitken = 1.0; - } - else if (RelaxMethod_FSI == FIXED_PARAMETER) { - WAitken = fea_config->GetAitkenStatRelax(); - } - else if (RelaxMethod_FSI == AITKEN_DYNAMIC) { - WAitken = fea_solver->GetWAitken_Dyn(); - } - else { - WAitken = 1.0; - cout << "No relaxation parameter used. " << endl; - } - - /*--- Store the Relaxation coefficient residual ---*/ - fea_solver->SetRelaxCoeff(WAitken); - - cout.precision(6); - if (iOuterIter == 0) cout << endl <<"BGS_Iter" << " ExtIter" << " Relaxation" << endl; - else if (iOuterIter == 1) cout << endl <<"BGS_Iter" << " ExtIter" << " Relaxation" << " Res[ATOL]" << endl; - else cout << endl <<"BGS_Iter" << " ExtIter" << " Relaxation" << " Res[ATOL]" << " Res[OMAG]"<< endl; - - cout.width(8); cout << iOuterIter; - cout.width(15); cout << iExtIter; - cout.width(15); cout << WAitken; - cout.width(15); - if (iOuterIter == 0) cout << " "; - else if (iOuterIter == 1) cout << logResidualFSI_initial; - else cout << logResidualFSI; - cout.width(15); - if (iOuterIter < 2) cout << " "; - else cout << magResidualFSI; - cout.setf(ios::fixed, ios::floatfield); - cout << endl; - cout << endl << "Simulation time: " << fea_config->GetCurrent_DynTime() << ". Time step: " << fea_config->GetDelta_DynTime() << "."; - cout << endl; - cout << endl << "------------------------------------------------------------------------- "; - cout << endl; - } - -} diff --git a/SU2_CFD/src/integration_time.cpp b/SU2_CFD/src/integration_time.cpp index 60315f1237fd..78b93d3fecc6 100644 --- a/SU2_CFD/src/integration_time.cpp +++ b/SU2_CFD/src/integration_time.cpp @@ -46,17 +46,12 @@ void CMultiGridIntegration::MultiGrid_Iteration(CGeometry ****geometry, CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, - unsigned long Iteration, unsigned short iZone, unsigned short iInst) { - unsigned short FinestMesh, iMGLevel = 0; + unsigned short FinestMesh; su2double monitor = 1.0; bool FullMG = false; - const bool restart = (config[iZone]->GetRestart() || config[iZone]->GetRestart_Flow()); - const bool startup_multigrid = ((config[iZone]->GetRestart_Flow()) && - (RunTime_EqSystem == RUNTIME_FLOW_SYS) && - (Iteration == 0)); const bool direct = ((config[iZone]->GetKind_Solver() == EULER) || (config[iZone]->GetKind_Solver() == NAVIER_STOKES) || (config[iZone]->GetKind_Solver() == RANS) || @@ -76,24 +71,6 @@ void CMultiGridIntegration::MultiGrid_Iteration(CGeometry ****geometry, RecursiveParam = V_CYCLE; FullMG = true; } - - /*--- If restart, update multigrid levels at the first multigrid iteration ---*/ - /*-- Since the restart takes care of this I dont think is required, but we should check after the new restart routines are added ---*/ - - if ((restart && (Iteration == config[iZone]->GetnStartUpIter())) || startup_multigrid) - { - for (iMGLevel = 0; iMGLevel < config[iZone]->GetnMGLevels(); iMGLevel++) { - - SetRestricted_Solution(RunTime_EqSystem, solver_container[iZone][iInst][iMGLevel][SolContainer_Position], - solver_container[iZone][iInst][iMGLevel+1][SolContainer_Position], - geometry[iZone][iInst][iMGLevel], geometry[iZone][iInst][iMGLevel+1], config[iZone]); - - SetRestricted_Solution(RUNTIME_TURB_SYS, solver_container[iZone][iInst][iMGLevel][SolContainer_Position], solver_container[iZone][iInst][iMGLevel+1][SolContainer_Position], geometry[iZone][iInst][iMGLevel], geometry[iZone][iInst][iMGLevel+1], config[iZone]); - - SetRestricted_EddyVisc(RUNTIME_TURB_SYS, solver_container[iZone][iInst][iMGLevel][SolContainer_Position], solver_container[iZone][iInst][iMGLevel+1][SolContainer_Position], geometry[iZone][iInst][iMGLevel], geometry[iZone][iInst][iMGLevel+1], config[iZone]); - - } - } /*--- Full multigrid strategy and start up with fine grid only works with the direct problem ---*/ @@ -113,7 +90,7 @@ void CMultiGridIntegration::MultiGrid_Iteration(CGeometry ****geometry, MultiGrid_Cycle(geometry, solver_container, numerics_container, config, FinestMesh, RecursiveParam, RunTime_EqSystem, - Iteration, iZone, iInst); + iZone, iInst); /*--- Computes primitive variables and gradients in the finest mesh (useful for the next solver (turbulence) and output ---*/ @@ -125,12 +102,8 @@ void CMultiGridIntegration::MultiGrid_Iteration(CGeometry ****geometry, NonDimensional_Parameters(geometry[iZone][iInst], solver_container[iZone][iInst], numerics_container[iZone][iInst], config[iZone], - FinestMesh, RunTime_EqSystem, Iteration, &monitor); + FinestMesh, RunTime_EqSystem, &monitor); - /*--- Convergence strategy ---*/ - - Convergence_Monitoring(geometry[iZone][iInst][FinestMesh], config[iZone], Iteration, monitor, FinestMesh); - } void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, @@ -140,14 +113,11 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, unsigned short iMesh, unsigned short RecursiveParam, unsigned short RunTime_EqSystem, - unsigned long Iteration, unsigned short iZone, unsigned short iInst) { unsigned short iPreSmooth, iPostSmooth, iRKStep, iRKLimit = 1; - - bool startup_multigrid = (config[iZone]->GetRestart_Flow() && (RunTime_EqSystem == RUNTIME_FLOW_SYS) && (Iteration == 0)); - unsigned short SolContainer_Position = config[iZone]->GetContainerPosition(RunTime_EqSystem); + unsigned short SolContainer_Position = config[iZone]->GetContainerPosition(RunTime_EqSystem); /*--- Do a presmoothing on the grid iMesh to be restricted to the grid iMesh+1 ---*/ @@ -177,11 +147,11 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, /*--- Compute time step, max eigenvalue, and integration scheme (steady and unsteady problems) ---*/ - solver_container[iZone][iInst][iMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh, Iteration); + solver_container[iZone][iInst][iMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh, config[iZone]->GetTimeIter()); /*--- Restrict the solution and gradient for the adjoint problem ---*/ - Adjoint_Setup(geometry, solver_container, config, RunTime_EqSystem, Iteration, iZone); + Adjoint_Setup(geometry, solver_container, config, RunTime_EqSystem, config[iZone]->GetTimeIter(), iZone); } @@ -191,7 +161,7 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, /*--- Time integration, update solution using the old solution plus the solution increment ---*/ - Time_Integration(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iRKStep, RunTime_EqSystem, Iteration); + Time_Integration(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iRKStep, RunTime_EqSystem); /*--- Send-Receive boundary conditions, and postprocessing ---*/ @@ -202,8 +172,7 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, } /*--- Compute Forcing Term $P_(k+1) = I^(k+1)_k(P_k+F_k(u_k))-F_(k+1)(I^(k+1)_k u_k)$ and update solution for multigrid ---*/ - - if ( (iMesh < config[iZone]->GetnMGLevels() && ((Iteration >= config[iZone]->GetnStartUpIter()) || startup_multigrid)) ) { + if ( iMesh < config[iZone]->GetnMGLevels() ) { /*--- Compute $r_k = P_k + F_k(u_k)$ ---*/ solver_container[iZone][iInst][iMesh][SolContainer_Position]->Preprocessing(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh, NO_RK_ITER, RunTime_EqSystem, false); @@ -223,8 +192,8 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, /*--- Recursive call to MultiGrid_Cycle ---*/ for (unsigned short imu = 0; imu <= RecursiveParam; imu++) { - if (iMesh == config[iZone]->GetnMGLevels()-2) MultiGrid_Cycle(geometry, solver_container, numerics_container, config, iMesh+1, 0, RunTime_EqSystem, Iteration, iZone, iInst); - else MultiGrid_Cycle(geometry, solver_container, numerics_container, config, iMesh+1, RecursiveParam, RunTime_EqSystem, Iteration, iZone, iInst); + if (iMesh == config[iZone]->GetnMGLevels()-2) MultiGrid_Cycle(geometry, solver_container, numerics_container, config, iMesh+1, 0, RunTime_EqSystem, iZone, iInst); + else MultiGrid_Cycle(geometry, solver_container, numerics_container, config, iMesh+1, RecursiveParam, RunTime_EqSystem, iZone, iInst); } /*--- Compute prolongated solution, and smooth the correction $u^(new)_k = u_k + Smooth(I^k_(k+1)(u_(k+1)-I^(k+1)_k u_k))$ ---*/ @@ -252,11 +221,11 @@ void CMultiGridIntegration::MultiGrid_Cycle(CGeometry ****geometry, solver_container[iZone][iInst][iMesh][SolContainer_Position]->Set_OldSolution(geometry[iZone][iInst][iMesh]); if (config[iZone]->GetKind_TimeIntScheme() == CLASSICAL_RK4_EXPLICIT) solver_container[iZone][iInst][iMesh][SolContainer_Position]->Set_NewSolution(geometry[iZone][iInst][iMesh]); - solver_container[iZone][iInst][iMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh, Iteration); + solver_container[iZone][iInst][iMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh, config[iZone]->GetTimeIter()); } Space_Integration(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], numerics_container[iZone][iInst][iMesh][SolContainer_Position], config[iZone], iMesh, iRKStep, RunTime_EqSystem); - Time_Integration(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iRKStep, RunTime_EqSystem, Iteration); + Time_Integration(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iRKStep, RunTime_EqSystem); solver_container[iZone][iInst][iMesh][SolContainer_Position]->Postprocessing(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], config[iZone], iMesh); @@ -721,11 +690,9 @@ void CMultiGridIntegration::SetRestricted_Gradient(unsigned short RunTime_EqSyst } void CMultiGridIntegration::NonDimensional_Parameters(CGeometry **geometry, CSolver ***solver_container, CNumerics ****numerics_container, - CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, unsigned long Iteration, + CConfig *config, unsigned short FinestMesh, unsigned short RunTime_EqSystem, su2double *monitor) { - - const unsigned short nDim = geometry[FinestMesh]->GetnDim(); - + switch (RunTime_EqSystem) { case RUNTIME_FLOW_SYS: @@ -742,22 +709,6 @@ void CMultiGridIntegration::NonDimensional_Parameters(CGeometry **geometry, CSol solver_container[FinestMesh][FLOW_SOL]->Buffet_Monitoring(geometry[FinestMesh], config); } - /*--- Evaluate convergence monitor ---*/ - - if (config->GetConvCriteria() == CAUCHY) { - if (config->GetCauchy_Func_Flow() == DRAG_COEFFICIENT) (*monitor) = solver_container[FinestMesh][FLOW_SOL]->GetTotal_CD(); - if (config->GetCauchy_Func_Flow() == LIFT_COEFFICIENT) (*monitor) = solver_container[FinestMesh][FLOW_SOL]->GetTotal_CL(); - if (config->GetCauchy_Func_Flow() == NEARFIELD_PRESSURE) (*monitor) = solver_container[FinestMesh][FLOW_SOL]->GetTotal_CNearFieldOF(); - } - - if (config->GetConvCriteria() == RESIDUAL) { - if (config->GetResidual_Func_Flow() == RHO_RESIDUAL) (*monitor) = log10(solver_container[FinestMesh][FLOW_SOL]->GetRes_RMS(0)); - else if (config->GetResidual_Func_Flow() == RHO_ENERGY_RESIDUAL) { - if (nDim == 2) (*monitor) = log10(solver_container[FinestMesh][FLOW_SOL]->GetRes_RMS(3)); - else (*monitor) = log10(solver_container[FinestMesh][FLOW_SOL]->GetRes_RMS(4)); - } - } - break; case RUNTIME_ADJFLOW_SYS: @@ -771,21 +722,6 @@ void CMultiGridIntegration::NonDimensional_Parameters(CGeometry **geometry, CSol if (config->GetKind_SensSmooth() != NONE) solver_container[FinestMesh][ADJFLOW_SOL]->Smooth_Sensitivity(geometry[FinestMesh], solver_container[FinestMesh], numerics_container[FinestMesh][ADJFLOW_SOL][CONV_BOUND_TERM], config); - /*--- Evaluate convergence monitor ---*/ - - if (config->GetConvCriteria() == CAUCHY) { - if (config->GetCauchy_Func_AdjFlow() == SENS_GEOMETRY) (*monitor) = solver_container[FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_Geo(); - if (config->GetCauchy_Func_AdjFlow() == SENS_MACH) (*monitor) = solver_container[FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_Mach(); - } - - if (config->GetConvCriteria() == RESIDUAL) { - if (config->GetResidual_Func_Flow() == RHO_RESIDUAL) (*monitor) = log10(solver_container[FinestMesh][ADJFLOW_SOL]->GetRes_RMS(0)); - else if (config->GetResidual_Func_Flow() == RHO_ENERGY_RESIDUAL) { - if (nDim == 2) (*monitor) = log10(solver_container[FinestMesh][ADJFLOW_SOL]->GetRes_RMS(3)); - else (*monitor) = log10(solver_container[FinestMesh][ADJFLOW_SOL]->GetRes_RMS(4)); - } - } - break; } @@ -797,9 +733,8 @@ CSingleGridIntegration::CSingleGridIntegration(CConfig *config) : CIntegration(c CSingleGridIntegration::~CSingleGridIntegration(void) { } void CSingleGridIntegration::SingleGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, - CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst) { + CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { unsigned short iMesh; - su2double monitor = 0.0; unsigned short SolContainer_Position = config[iZone]->GetContainerPosition(RunTime_EqSystem); @@ -815,7 +750,7 @@ void CSingleGridIntegration::SingleGrid_Iteration(CGeometry ****geometry, CSolve /*--- Time step evaluation ---*/ - solver_container[iZone][iInst][FinestMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][FinestMesh], solver_container[iZone][iInst][FinestMesh], config[iZone], FinestMesh, 0); + solver_container[iZone][iInst][FinestMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][FinestMesh], solver_container[iZone][iInst][FinestMesh], config[iZone], FinestMesh, config[iZone]->GetTimeIter()); /*--- Space integration ---*/ @@ -825,27 +760,16 @@ void CSingleGridIntegration::SingleGrid_Iteration(CGeometry ****geometry, CSolve /*--- Time integration ---*/ Time_Integration(geometry[iZone][iInst][FinestMesh], solver_container[iZone][iInst][FinestMesh], config[iZone], NO_RK_ITER, - RunTime_EqSystem, Iteration); + RunTime_EqSystem); /*--- Postprocessing ---*/ solver_container[iZone][iInst][FinestMesh][SolContainer_Position]->Postprocessing(geometry[iZone][iInst][FinestMesh], solver_container[iZone][iInst][FinestMesh], config[iZone], FinestMesh); - /*--- Compute adimensional parameters and the convergence monitor ---*/ - - switch (RunTime_EqSystem) { - case RUNTIME_FEA_SYS: monitor = log10(solver_container[iZone][iInst][FinestMesh][FEA_SOL]->GetRes_RMS(0)); break; - case RUNTIME_HEAT_SYS: monitor = log10(solver_container[iZone][iInst][FinestMesh][HEAT_SOL]->GetRes_RMS(0)); break; - } - if (RunTime_EqSystem == RUNTIME_HEAT_SYS) { solver_container[iZone][iInst][FinestMesh][HEAT_SOL]->Heat_Fluxes(geometry[iZone][iInst][FinestMesh], solver_container[iZone][iInst][FinestMesh], config[iZone]); } - /*--- Convergence strategy ---*/ - - Convergence_Monitoring(geometry[iZone][iInst][FinestMesh], config[iZone], Iteration, monitor, FinestMesh); - /*--- If turbulence model, copy the turbulence variables to the coarse levels ---*/ if (RunTime_EqSystem == RUNTIME_TURB_SYS) { @@ -946,38 +870,31 @@ CStructuralIntegration::CStructuralIntegration(CConfig *config) : CIntegration(c CStructuralIntegration::~CStructuralIntegration(void) { } void CStructuralIntegration::Structural_Iteration(CGeometry ****geometry, CSolver *****solver_container, - CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned long Iteration, unsigned short iZone, unsigned short iInst) { + CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) { unsigned short SolContainer_Position = config[iZone]->GetContainerPosition(RunTime_EqSystem); /*--- Preprocessing ---*/ solver_container[iZone][iInst][MESH_0][SolContainer_Position]->Preprocessing(geometry[iZone][iInst][MESH_0], solver_container[iZone][iInst][MESH_0], - config[iZone], numerics_container[iZone][iInst][MESH_0][SolContainer_Position], MESH_0, Iteration, RunTime_EqSystem, false); + config[iZone], numerics_container[iZone][iInst][MESH_0][SolContainer_Position], MESH_0, NO_RK_ITER, RunTime_EqSystem, false); /*--- Space integration ---*/ Space_Integration_FEM(geometry[iZone][iInst][MESH_0], solver_container[iZone][iInst][MESH_0], numerics_container[iZone][iInst][MESH_0][SolContainer_Position], - config[iZone], RunTime_EqSystem, Iteration); + config[iZone], RunTime_EqSystem); /*--- Time integration ---*/ Time_Integration_FEM(geometry[iZone][iInst][MESH_0], solver_container[iZone][iInst][MESH_0], numerics_container[iZone][iInst][MESH_0][SolContainer_Position], - config[iZone], RunTime_EqSystem, Iteration); + config[iZone], RunTime_EqSystem); /*--- Postprocessing ---*/ solver_container[iZone][iInst][MESH_0][SolContainer_Position]->Postprocessing(geometry[iZone][iInst][MESH_0], solver_container[iZone][iInst][MESH_0], config[iZone], numerics_container[iZone][iInst][MESH_0][SolContainer_Position], MESH_0); - /*--- Convergence strategy ---*/ - - switch (RunTime_EqSystem) { - case RUNTIME_FEA_SYS: Convergence_Monitoring_FEM(geometry[iZone][iInst][MESH_0], config[iZone], solver_container[iZone][iInst][MESH_0][SolContainer_Position], Iteration); break; - case RUNTIME_ADJFEA_SYS: Convergence_Monitoring_FEM_Adj(geometry[iZone][iInst][MESH_0], config[iZone], solver_container[iZone][iInst][MESH_0][SolContainer_Position], Iteration); break; - } - } CFEM_DG_Integration::CFEM_DG_Integration(CConfig *config) : CIntegration(config) { } @@ -989,7 +906,6 @@ void CFEM_DG_Integration::SingleGrid_Iteration(CGeometry ****geometry, CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, - unsigned long Iteration, unsigned short iZone, unsigned short iInst) { @@ -1027,8 +943,8 @@ void CFEM_DG_Integration::SingleGrid_Iteration(CGeometry ****geometry, TimeSynSpecified to true, which leads to an outer loop in the algorithm below. ---*/ bool TimeSyncSpecified = false; - const su2double TimeSync = config[iZone]->GetDelta_UnstTimeND(); - if(config[iZone]->GetUnsteady_Simulation() == TIME_STEPPING && + const su2double TimeSync = config[iZone]->GetTime_Step()/config[iZone]->GetTime_Ref(); + if(config[iZone]->GetTime_Marching() == TIME_STEPPING && config[iZone]->GetUnst_CFL() != 0.0 && TimeSync != 0.0) TimeSyncSpecified = true; @@ -1041,7 +957,7 @@ void CFEM_DG_Integration::SingleGrid_Iteration(CGeometry ****geometry, /* Compute the time step for stability. */ solver_container[iZone][iInst][iMesh][SolContainer_Position]->SetTime_Step(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], - config[iZone], iMesh, Iteration); + config[iZone], iMesh, config[iZone]->GetTimeIter()); /* Possibly overrule the specified time step when a synchronization time was specified and determine whether or not the time loop must be continued. When TimeSyncSpecified is false, the loop is always terminated. */ @@ -1077,7 +993,7 @@ void CFEM_DG_Integration::SingleGrid_Iteration(CGeometry ****geometry, /*--- Time integration, update solution using the old solution plus the solution increment ---*/ Time_Integration(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], - config[iZone], iStep, RunTime_EqSystem, Iteration); + config[iZone], iStep, RunTime_EqSystem); /*--- Postprocessing ---*/ solver_container[iZone][iInst][iMesh][SolContainer_Position]->Postprocessing(geometry[iZone][iInst][iMesh], solver_container[iZone][iInst][iMesh], @@ -1121,7 +1037,7 @@ void CFEM_DG_Integration::Space_Integration(CGeometry *geometry, } void CFEM_DG_Integration::Time_Integration(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iStep, - unsigned short RunTime_EqSystem, unsigned long Iteration) { + unsigned short RunTime_EqSystem) { unsigned short MainSolver = config->GetContainerPosition(RunTime_EqSystem); diff --git a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp index 5dc1e6ef92eb..d240d4f95771 100644 --- a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp @@ -102,7 +102,7 @@ void CFlowTractionInterface::GetPhysical_Constants(CSolver *flow_solution, CSolv Physical_Constants[1] = ModAmpl; /*--- For static FSI, we cannot apply the ramp like this ---*/ - if ((flow_config->GetUnsteady_Simulation() == STEADY) && (struct_config->GetDynamic_Analysis() == STATIC)){ + if ((!flow_config->GetTime_Domain())){ Physical_Constants[1] = 1.0; if (Ramp_Load){ CurrentTime = static_cast(struct_config->GetOuterIter()); diff --git a/SU2_CFD/src/iteration_structure.cpp b/SU2_CFD/src/iteration_structure.cpp index bde0f7cee0ee..691f21dfc6f7 100644 --- a/SU2_CFD/src/iteration_structure.cpp +++ b/SU2_CFD/src/iteration_structure.cpp @@ -57,7 +57,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, CSolver ***solver, CConfig *config, unsigned long IntIter, - unsigned long ExtIter) { + unsigned long TimeIter) { unsigned short Kind_Grid_Movement = config->GetKind_GridMovement(); unsigned long nIterMesh; @@ -84,13 +84,13 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, velocities for the fine mesh. ---*/ grid_movement->Rigid_Translation(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); grid_movement->Rigid_Plunging(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); grid_movement->Rigid_Pitching(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); grid_movement->Rigid_Rotation(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); /*--- Update the multigrid structure after moving the finest grid, including computing the grid velocities on the coarser levels. ---*/ @@ -115,7 +115,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, /*--- Compute the new node locations for moving markers ---*/ surface_movement->Surface_Translating(geometry[MESH_0], - config, ExtIter, val_iZone); + config, TimeIter, val_iZone); /*--- Deform the volume grid around the new boundary locations ---*/ if (rank == MASTER_NODE) @@ -128,7 +128,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, /*--- Compute the new node locations for moving markers ---*/ surface_movement->Surface_Plunging(geometry[MESH_0], - config, ExtIter, val_iZone); + config, TimeIter, val_iZone); /*--- Deform the volume grid around the new boundary locations ---*/ if (rank == MASTER_NODE) @@ -141,7 +141,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, /*--- Compute the new node locations for moving markers ---*/ surface_movement->Surface_Pitching(geometry[MESH_0], - config, ExtIter, val_iZone); + config, TimeIter, val_iZone); /*--- Deform the volume grid around the new boundary locations ---*/ if (rank == MASTER_NODE) @@ -154,7 +154,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, /*--- Compute the new node locations for moving markers ---*/ surface_movement->Surface_Rotating(geometry[MESH_0], - config, ExtIter, val_iZone); + config, TimeIter, val_iZone); /*--- Deform the volume grid around the new boundary locations ---*/ if (rank == MASTER_NODE) @@ -168,7 +168,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, if (!adjoint) { if (rank == MASTER_NODE) cout << " Computing grid velocities by finite differencing." << endl; - geometry[MESH_0]->SetGridVelocity(config, ExtIter); + geometry[MESH_0]->SetGridVelocity(config, TimeIter); } /*--- Update the multigrid structure after moving the finest grid, @@ -194,13 +194,13 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, velocities for the fine mesh. ---*/ grid_movement->Rigid_Translation(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); grid_movement->Rigid_Plunging(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); grid_movement->Rigid_Pitching(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); grid_movement->Rigid_Rotation(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); /*--- Update the multigrid structure after moving the finest grid, including computing the grid velocities on the coarser levels. ---*/ @@ -218,7 +218,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, /*--- Solve the aeroelastic equations for the new node locations of the moving markers(surfaces) ---*/ - solver[MESH_0][FLOW_SOL]->Aeroelastic(surface_movement, geometry[MESH_0], config, ExtIter); + solver[MESH_0][FLOW_SOL]->Aeroelastic(surface_movement, geometry[MESH_0], config, TimeIter); /*--- Deform the volume grid around the new boundary locations ---*/ @@ -232,7 +232,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, if (rank == MASTER_NODE) cout << " Computing grid velocities by finite differencing." << endl; - geometry[MESH_0]->SetGridVelocity(config, ExtIter); + geometry[MESH_0]->SetGridVelocity(config, TimeIter); /*--- Update the multigrid structure after moving the finest grid, including computing the grid velocities on the coarser levels. ---*/ @@ -257,7 +257,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, if (!adjoint && !stat_mesh) { if (rank == MASTER_NODE && Screen_Output) cout << "Computing grid velocities by finite differencing." << endl; - geometry[MESH_0]->SetGridVelocity(config, ExtIter); + geometry[MESH_0]->SetGridVelocity(config, TimeIter); } else if (stat_mesh) { if (rank == MASTER_NODE && Screen_Output) @@ -299,7 +299,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, if (rank == MASTER_NODE) cout << " Updating node locations by rigid rotation." << endl; grid_movement->Rigid_Rotation(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); } /*--- Load new surface node locations from external files ---*/ @@ -307,7 +307,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, if (rank == MASTER_NODE) cout << " Updating surface locations from file." << endl; surface_movement->SetExternal_Deformation(geometry[MESH_0], - config, val_iZone, ExtIter); + config, val_iZone, TimeIter); /*--- Deform the volume grid around the new boundary locations ---*/ @@ -322,7 +322,7 @@ void CIteration::SetGrid_Movement(CGeometry **geometry, if (!adjoint) { if (rank == MASTER_NODE) cout << " Computing grid velocities by finite differencing." << endl; - geometry[MESH_0]->SetGridVelocity(config, ExtIter); + geometry[MESH_0]->SetGridVelocity(config, TimeIter); } /*--- Update the multigrid structure after moving the finest grid, @@ -341,9 +341,6 @@ void CIteration::SetMesh_Deformation(CGeometry **geometry, bool ActiveTape = NO; - if ((rank == MASTER_NODE) && (!config->GetDiscrete_Adjoint())) - cout << endl << "Deforming the grid for imposed boundary displacements." << endl; - /*--- Perform the elasticity mesh movement ---*/ if (config->GetDeform_Mesh()) { @@ -453,70 +450,16 @@ void CIteration::Output(COutput *output, CGeometry ****geometry, CSolver *****solver, CConfig **config, - unsigned long Iter, + unsigned long InnerIter, bool StopCalc, unsigned short val_iZone, unsigned short val_iInst) { - bool output_files = false; - - /*--- Determine whether a solution needs to be written - after the current iteration ---*/ - - if ( - - /*--- General if statements to print output statements ---*/ - -// (ExtIter+1 >= nExtIter) || (StopCalc) || - - /*--- Fixed CL problem ---*/ - - ((config[ZONE_0]->GetFixed_CL_Mode()) && - (config[ZONE_0]->GetnExtIter()-config[ZONE_0]->GetIter_dCL_dAlpha() - 1 == Iter)) || - - /*--- Steady problems ---*/ - - ((Iter % config[ZONE_0]->GetWrt_Sol_Freq() == 0) && (Iter != 0) && - ((config[ZONE_0]->GetUnsteady_Simulation() == STEADY) || - (config[ZONE_0]->GetUnsteady_Simulation() == HARMONIC_BALANCE) || - (config[ZONE_0]->GetUnsteady_Simulation() == ROTATIONAL_FRAME))) || - - /*--- No inlet profile file found. Print template. ---*/ - - (config[ZONE_0]->GetWrt_InletFile()) - - ) { - - output_files = true; - - } - - /*--- Determine whether a solution doesn't need to be written - after the current iteration ---*/ - - if (config[ZONE_0]->GetFixed_CL_Mode()) { - if (config[ZONE_0]->GetnExtIter()-config[ZONE_0]->GetIter_dCL_dAlpha() - 1 < Iter) output_files = false; - if (config[ZONE_0]->GetnExtIter() - 1 == Iter) output_files = true; - } - - /*--- write the solution ---*/ - - if (output_files) { - - if (rank == MASTER_NODE) cout << endl << "-------------------------- File Output Summary --------------------------"; - - /*--- Execute the routine for writing restart, volume solution, - surface solution, and surface comma-separated value files. ---*/ - - output->SetResult_Files_Parallel(solver, geometry, config, Iter, nZone); - - /*--- Execute the routine for writing special output. ---*/ - output->SetSpecial_Output(solver, geometry, config, Iter, nZone); - - - if (rank == MASTER_NODE) cout << "-------------------------------------------------------------------------" << endl << endl; - - } + + output->SetResult_Files(geometry[val_iZone][INST_0][MESH_0], + config[val_iZone], + solver[val_iZone][INST_0][MESH_0], InnerIter); + } void CIteration::Postprocess(COutput *output, @@ -548,8 +491,7 @@ void CFluidIteration::Preprocess(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter = 0; config[val_iZone]->SetIntIter(IntIter); - unsigned long ExtIter = config[val_iZone]->GetExtIter(); + unsigned long TimeIter = config[val_iZone]->GetTimeIter(); bool fsi = config[val_iZone]->GetFSI_Simulation(); unsigned long OuterIter = config[val_iZone]->GetOuterIter(); @@ -559,7 +501,7 @@ void CFluidIteration::Preprocess(COutput *output, /*--- This is done only in the first block subiteration.---*/ /*--- From then on, the solver reuses the partially converged solution obtained in the previous subiteration ---*/ if( fsi && ( OuterIter == 0 ) ){ - solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], ExtIter); + solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], TimeIter); } /*--- Apply a Wind Gust ---*/ @@ -570,7 +512,7 @@ void CFluidIteration::Preprocess(COutput *output, /*--- Evaluate the new CFL number (adaptive). ---*/ if ((config[val_iZone]->GetCFL_Adapt() == YES) && ( OuterIter != 0 ) ) { - output->SetCFL_Number(solver, config, val_iZone); + output->SetCFL_Number(solver[val_iZone], config[val_iZone]); } } @@ -586,31 +528,30 @@ void CFluidIteration::Iterate(COutput *output, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter, ExtIter; + unsigned long InnerIter, TimeIter; - bool unsteady = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND); + bool unsteady = (config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND); bool frozen_visc = (config[val_iZone]->GetContinuous_Adjoint() && config[val_iZone]->GetFrozen_Visc_Cont()) || (config[val_iZone]->GetDiscrete_Adjoint() && config[val_iZone]->GetFrozen_Visc_Disc()); - ExtIter = config[val_iZone]->GetExtIter(); + TimeIter = config[val_iZone]->GetTimeIter(); /* --- Setting up iteration values depending on if this is a steady or an unsteady simulaiton */ - if ( !unsteady ) IntIter = ExtIter; - else IntIter = config[val_iZone]->GetIntIter(); + InnerIter = config[val_iZone]->GetInnerIter(); /*--- Update global parameters ---*/ switch( config[val_iZone]->GetKind_Solver() ) { case EULER: case DISC_ADJ_EULER: case INC_EULER: case DISC_ADJ_INC_EULER: - config[val_iZone]->SetGlobalParam(EULER, RUNTIME_FLOW_SYS, ExtIter); break; + config[val_iZone]->SetGlobalParam(EULER, RUNTIME_FLOW_SYS); break; case NAVIER_STOKES: case DISC_ADJ_NAVIER_STOKES: case INC_NAVIER_STOKES: case DISC_ADJ_INC_NAVIER_STOKES: - config[val_iZone]->SetGlobalParam(NAVIER_STOKES, RUNTIME_FLOW_SYS, ExtIter); break; + config[val_iZone]->SetGlobalParam(NAVIER_STOKES, RUNTIME_FLOW_SYS); break; case RANS: case DISC_ADJ_RANS: case INC_RANS: case DISC_ADJ_INC_RANS: - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_FLOW_SYS, ExtIter); break; + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_FLOW_SYS); break; } @@ -618,7 +559,7 @@ void CFluidIteration::Iterate(COutput *output, /*--- Solve the Euler, Navier-Stokes or Reynolds-averaged Navier-Stokes (RANS) equations (one iteration) ---*/ integration[val_iZone][val_iInst][FLOW_SOL]->MultiGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_FLOW_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FLOW_SYS, val_iZone, val_iInst); if ((config[val_iZone]->GetKind_Solver() == RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_RANS || @@ -627,24 +568,24 @@ void CFluidIteration::Iterate(COutput *output, /*--- Solve the turbulence model ---*/ - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TURB_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TURB_SYS); integration[val_iZone][val_iInst][TURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_TURB_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_TURB_SYS, val_iZone, val_iInst); /*--- Solve transition model ---*/ if (config[val_iZone]->GetKind_Trans_Model() == LM) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS); integration[val_iZone][val_iInst][TRANS_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_TRANS_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_TRANS_SYS, val_iZone, val_iInst); } } if (config[val_iZone]->GetWeakly_Coupled_Heat()){ - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_HEAT_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_HEAT_SYS); integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_HEAT_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_HEAT_SYS, val_iZone, val_iInst); } /*--- Call Dynamic mesh update if AEROELASTIC motion was specified ---*/ @@ -652,26 +593,17 @@ void CFluidIteration::Iterate(COutput *output, if ((config[val_iZone]->GetGrid_Movement()) && (config[val_iZone]->GetAeroelastic_Simulation()) && unsteady) { SetGrid_Movement(geometry[val_iZone][val_iInst], surface_movement[val_iZone], grid_movement[val_iZone][val_iInst], - solver[val_iZone][val_iInst], config[val_iZone], IntIter, ExtIter); + solver[val_iZone][val_iInst], config[val_iZone], InnerIter, TimeIter); /*--- Apply a Wind Gust ---*/ if (config[val_iZone]->GetWind_Gust()) { - if (IntIter % config[val_iZone]->GetAeroelasticIter() == 0 && IntIter != 0) + if (InnerIter % config[val_iZone]->GetAeroelasticIter() == 0 && InnerIter != 0) SetWind_GustField(config[val_iZone], geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst]); } } - - /*--- Write the convergence history ---*/ - - if ( unsteady && !config[val_iZone]->GetDiscrete_Adjoint() ) { - - output->SetConvHistory_Body(NULL, geometry, solver, config, integration, true, 0.0, val_iZone, val_iInst); - - } - } void CFluidIteration::Update(COutput *output, @@ -687,13 +619,11 @@ void CFluidIteration::Update(COutput *output, unsigned short val_iInst) { unsigned short iMesh; - su2double Physical_dt, Physical_t; - unsigned long ExtIter = config[val_iZone]->GetExtIter(); /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { /*--- Update dual time solver on all mesh levels ---*/ @@ -723,16 +653,7 @@ void CFluidIteration::Update(COutput *output, integration[val_iZone][val_iInst][TRANS_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][TRANS_SOL], config[val_iZone], MESH_0); integration[val_iZone][val_iInst][TRANS_SOL]->SetConvergence(false); } - - /*--- Verify convergence criteria (based on total time) ---*/ - - Physical_dt = config[val_iZone]->GetDelta_UnstTime(); - Physical_t = (ExtIter+1)*Physical_dt; - if (Physical_t >= config[val_iZone]->GetTotal_UnstTime()) - integration[val_iZone][val_iInst][FLOW_SOL]->SetConvergence(true); - } - } bool CFluidIteration::Monitor(COutput *output, @@ -748,9 +669,7 @@ bool CFluidIteration::Monitor(COutput *output, unsigned short val_iInst) { bool StopCalc = false; - bool steady = (config[val_iZone]->GetUnsteady_Simulation() == STEADY); - bool output_history = false; - + #ifndef HAVE_MPI StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else @@ -758,16 +677,23 @@ bool CFluidIteration::Monitor(COutput *output, #endif UsedTime = StopTime - StartTime; - /*--- If convergence was reached --*/ - StopCalc = integration[val_iZone][INST_0][FLOW_SOL]->GetConvergence(); - /*--- Write the convergence history for the fluid (only screen output) ---*/ - - /*--- The logic is right now case dependent ----*/ - /*--- This needs to be generalized when the new output structure comes ---*/ - output_history = (steady && !(multizone && (config[val_iZone]->GetnInner_Iter()==1))); + if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()){ + output->SetHistory_Output(geometry[val_iZone][INST_0][MESH_0], + solver[val_iZone][INST_0][MESH_0], + config[val_iZone], + config[val_iZone]->GetTimeIter(), + config[val_iZone]->GetOuterIter(), + config[val_iZone]->GetInnerIter()); + } + + if (config[val_iZone]->GetCFL_Adapt() == YES) { + if (!(config[val_iZone]->GetMultizone_Problem())) // This needs to be changed everywhere in the code, in a future PR + output->SetCFL_Number(solver[val_iZone], config[val_iZone]); + } - if (output_history) output->SetConvHistory_Body(NULL, geometry, solver, config, integration, false, UsedTime, val_iZone, INST_0); + /*--- If convergence was reached --*/ + StopCalc = output->GetConvergence(); return StopCalc; @@ -799,13 +725,13 @@ void CFluidIteration::Postprocess(COutput *output, /*--- Read the target pressure ---*/ - if (config[val_iZone]->GetInvDesign_Cp() == YES) - output->SetCp_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL],geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], config[val_iZone]->GetExtIter()); +// if (config[val_iZone]->GetInvDesign_Cp() == YES) +// output->SetCp_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL],geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], config[val_iZone]->GetExtIter()); - /*--- Read the target heat flux ---*/ +// /*--- Read the target heat flux ---*/ - if (config[val_iZone]->GetInvDesign_HeatFlux() == YES) - output->SetHeatFlux_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL],geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], config[val_iZone]->GetExtIter()); +// if (config[val_iZone]->GetInvDesign_HeatFlux() == YES) +// output->SetHeatFlux_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL],geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], config[val_iZone]->GetExtIter()); } @@ -827,10 +753,9 @@ void CFluidIteration::Solve(COutput *output, unsigned short val_iInst) { /*--- Boolean to determine if we are running a static or dynamic case ---*/ - bool steady = (config[val_iZone]->GetUnsteady_Simulation() == STEADY); - bool unsteady = ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool steady = !config[val_iZone]->GetTime_Domain(); - unsigned short Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter(); + unsigned long Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter(); bool StopCalc = false; /*--- Synchronization point before a single solver iteration. Compute the @@ -842,13 +767,6 @@ void CFluidIteration::Solve(COutput *output, StartTime = MPI_Wtime(); #endif - /*--- If the problem is multizone, the block iterates on the number of internal iterations ---*/ - /*--- If the problem is single zone, the block iterates on the number of iterations (pseudo-time)---*/ - if (multizone) - nInner_Iter = config[val_iZone]->GetnInner_Iter(); - else - nInner_Iter = config[val_iZone]->GetnIter(); - /*--- Preprocess the solver ---*/ Preprocess(output, integration, geometry, solver, numerics, config, @@ -859,15 +777,7 @@ void CFluidIteration::Solve(COutput *output, for (Inner_Iter = 0; Inner_Iter < nInner_Iter; Inner_Iter++){ - /*--- For steady-state flow simulations, we need to loop over ExtIter for the number of time steps ---*/ - if (steady) config[val_iZone]->SetExtIter(Inner_Iter); - /*--- For unsteady flow simulations, we need to loop over IntIter for the number of time steps ---*/ - if (unsteady) config[val_iZone]->SetIntIter(Inner_Iter); - /*--- If only one internal iteration is required, the ExtIter/IntIter is the OuterIter of the block structure ---*/ - if (nInner_Iter == 1) { - if (steady) config[val_iZone]->SetExtIter(config[val_iZone]->GetOuterIter()); - if (unsteady) config[val_iZone]->SetIntIter(config[val_iZone]->GetOuterIter()); - } + config[val_iZone]->SetInnerIter(Inner_Iter); /*--- Run a single iteration of the solver ---*/ Iterate(output, integration, geometry, @@ -879,19 +789,26 @@ void CFluidIteration::Solve(COutput *output, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); - /*--- Output files at intermediate time positions if the problem is single zone ---*/ + /*--- Output files at intermediate iterations if the problem is single zone ---*/ - if (singlezone) Output(output, geometry, solver, config, - Inner_Iter, StopCalc, val_iZone, val_iInst); + if (singlezone && steady) Output(output, geometry, solver, config, + config[val_iZone]->GetInnerIter(), StopCalc, val_iZone, val_iInst); + /*--- If the iteration has converged, break the loop ---*/ if (StopCalc) break; } - /*--- Set the fluid convergence to false (to make sure outer subiterations converge) ---*/ - if (multizone) integration[val_iZone][INST_0][FLOW_SOL]->SetConvergence(false); - + if (multizone && steady){ + + Output(output, geometry, solver, config, + config[val_iZone]->GetOuterIter(), StopCalc, val_iZone, val_iInst); + + /*--- Set the fluid convergence to false (to make sure outer subiterations converge) ---*/ + + integration[val_iZone][INST_0][FLOW_SOL]->SetConvergence(false); + } } void CFluidIteration::SetWind_GustField(CConfig *config, CGeometry **geometry, CSolver ***solver) { @@ -932,8 +849,8 @@ void CFluidIteration::SetWind_GustField(CConfig *config, CGeometry **geometry, C su2double *Gust, *GridVel, *NewGridVel, *GustDer; su2double Physical_dt = config->GetDelta_UnstTime(); - unsigned long ExtIter = config->GetExtIter(); - su2double Physical_t = ExtIter*Physical_dt; + unsigned long TimeIter = config->GetTimeIter(); + su2double Physical_t = TimeIter*Physical_dt; su2double Uinf = solver[MESH_0][FLOW_SOL]->GetVelocity_Inf(0); // Assumption gust moves at infinity velocity @@ -1158,14 +1075,9 @@ void CTurboIteration::Postprocess( COutput *output, /*--- Gather Inflow and Outflow quantities on the Master Node to compute performance ---*/ solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->GatherInOutAverageValues(config[val_iZone], geometry[val_iZone][val_iInst][MESH_0]); - - /*--- Compute turboperformance for single-zone adjoint cases. ---*/ - if (config[val_iZone]->GetSinglezone_Driver() && config[val_iZone]->GetDiscrete_Adjoint()) - output->ComputeTurboPerformance(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL], geometry[val_iZone][val_iInst][MESH_0], config[val_iZone]); - } -CFEMFluidIteration::CFEMFluidIteration(CConfig *config) : CIteration(config) { } +CFEMFluidIteration::CFEMFluidIteration(CConfig *config) : CFluidIteration(config) { } CFEMFluidIteration::~CFEMFluidIteration(void) { } void CFEMFluidIteration::Preprocess(COutput *output, @@ -1180,17 +1092,16 @@ void CFEMFluidIteration::Preprocess(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter = 0; config[ZONE_0]->SetIntIter(IntIter); - unsigned long ExtIter = config[ZONE_0]->GetExtIter(); + unsigned long TimeIter = config[ZONE_0]->GetTimeIter(); const bool restart = (config[ZONE_0]->GetRestart() || config[ZONE_0]->GetRestart_Flow()); /*--- Set the initial condition if this is not a restart. ---*/ - if (ExtIter == 0 && !restart) + if (TimeIter == 0 && !restart) solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], - ExtIter); + TimeIter); } @@ -1205,23 +1116,20 @@ void CFEMFluidIteration::Iterate(COutput *output, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - - unsigned long IntIter = 0; config[ZONE_0]->SetIntIter(IntIter); - unsigned long ExtIter = config[ZONE_0]->GetExtIter(); - + /*--- Update global parameters ---*/ if (config[val_iZone]->GetKind_Solver() == FEM_EULER || config[val_iZone]->GetKind_Solver() == DISC_ADJ_FEM_EULER) - config[val_iZone]->SetGlobalParam(FEM_EULER, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_EULER, RUNTIME_FLOW_SYS); if (config[val_iZone]->GetKind_Solver() == FEM_NAVIER_STOKES || config[val_iZone]->GetKind_Solver() == DISC_ADJ_FEM_NS) - config[val_iZone]->SetGlobalParam(FEM_NAVIER_STOKES, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_NAVIER_STOKES, RUNTIME_FLOW_SYS); if (config[val_iZone]->GetKind_Solver() == FEM_RANS || config[val_iZone]->GetKind_Solver() == DISC_ADJ_FEM_RANS) - config[val_iZone]->SetGlobalParam(FEM_RANS, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_RANS, RUNTIME_FLOW_SYS); if (config[val_iZone]->GetKind_Solver() == FEM_LES) - config[val_iZone]->SetGlobalParam(FEM_LES, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_LES, RUNTIME_FLOW_SYS); /*--- Solve the Euler, Navier-Stokes, RANS or LES equations (one iteration) ---*/ @@ -1230,7 +1138,7 @@ void CFEMFluidIteration::Iterate(COutput *output, numerics, config, RUNTIME_FLOW_SYS, - IntIter, val_iZone, + val_iZone, val_iInst); } @@ -1245,28 +1153,18 @@ void CFEMFluidIteration::Update(COutput *output, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { } -bool CFEMFluidIteration::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) { return false; } + void CFEMFluidIteration::Postprocess(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) { } + 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){} CHeatIteration::CHeatIteration(CConfig *config) : CIteration(config) { } @@ -1288,7 +1186,7 @@ void CHeatIteration::Preprocess(COutput *output, /*--- Evaluate the new CFL number (adaptive). ---*/ if ((config[val_iZone]->GetCFL_Adapt() == YES) && ( OuterIter != 0 ) ) { - output->SetCFL_Number(solver, config, val_iZone); + output->SetCFL_Number(solver[val_iZone], config[val_iZone]); } } @@ -1305,30 +1203,12 @@ void CHeatIteration::Iterate(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter, ExtIter; - bool unsteady = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND); - - ExtIter = config[val_iZone]->GetExtIter(); - - /* --- Setting up iteration values depending on if this is a - steady or an unsteady simulaiton */ - - if ( !unsteady ) IntIter = ExtIter; - else IntIter = config[val_iZone]->GetIntIter(); - /*--- Update global parameters ---*/ - config[val_iZone]->SetGlobalParam(HEAT_EQUATION_FVM, RUNTIME_HEAT_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(HEAT_EQUATION_FVM, RUNTIME_HEAT_SYS); - integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_HEAT_SYS, IntIter, val_iZone, val_iInst); + integration[val_iZone][val_iInst][HEAT_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, RUNTIME_HEAT_SYS, val_iZone, val_iInst); - /*--- Write the convergence history ---*/ - - if ( unsteady && !config[val_iZone]->GetDiscrete_Adjoint() ) { - - output->SetConvHistory_Body(NULL, geometry, solver, config, integration, true, 0.0, val_iZone, val_iInst); - } } void CHeatIteration::Update(COutput *output, @@ -1345,11 +1225,11 @@ void CHeatIteration::Update(COutput *output, unsigned short iMesh; su2double Physical_dt, Physical_t; - unsigned long ExtIter = config[ZONE_0]->GetExtIter(); + unsigned long TimeIter = config[ZONE_0]->GetTimeIter(); /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { /*--- Update dual time solver ---*/ for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { @@ -1358,7 +1238,7 @@ void CHeatIteration::Update(COutput *output, } Physical_dt = config[val_iZone]->GetDelta_UnstTime(); - Physical_t = (ExtIter+1)*Physical_dt; + Physical_t = (TimeIter+1)*Physical_dt; if (Physical_t >= config[val_iZone]->GetTotal_UnstTime()) integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(true); } @@ -1398,10 +1278,6 @@ void CHeatIteration::Solve(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - /*--- Boolean to determine if we are running a steady or unsteady case ---*/ - bool steady = (config[val_iZone]->GetUnsteady_Simulation() == STEADY); - bool unsteady = ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - unsigned short Inner_Iter, nInner_Iter = config[val_iZone]->GetnInner_Iter(); bool StopCalc = false; @@ -1414,33 +1290,38 @@ void CHeatIteration::Solve(COutput *output, /*--- However, ExtIter is the number of FSI iterations, so nIntIter is used in this case ---*/ for (Inner_Iter = 0; Inner_Iter < nInner_Iter; Inner_Iter++){ - - /*--- For steady-state flow simulations, we need to loop over ExtIter for the number of time steps ---*/ - if (steady) config[val_iZone]->SetExtIter(Inner_Iter); - /*--- For unsteady flow simulations, we need to loop over IntIter for the number of time steps ---*/ - if (unsteady) config[val_iZone]->SetIntIter(Inner_Iter); - /*--- If only one internal iteration is required, the ExtIter/IntIter is the OuterIter of the block structure ---*/ - if (nInner_Iter == 1) { - if (steady) config[val_iZone]->SetExtIter(config[val_iZone]->GetOuterIter()); - if (unsteady) config[val_iZone]->SetIntIter(config[val_iZone]->GetOuterIter()); - } + + config[val_iZone]->SetInnerIter(Inner_Iter); Iterate(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); - /*--- Write the convergence history for the fluid (only screen output) ---*/ - if (steady) output->SetConvHistory_Body(NULL, geometry, solver, config, integration, false, 0.0, val_iZone, INST_0); + if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()){ + output->SetHistory_Output(geometry[val_iZone][INST_0][MESH_0], solver[val_iZone][INST_0][MESH_0], config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), Inner_Iter); + } + + /*--- Output files at intermediate time positions if the problem is single zone ---*/ + if (singlezone) Output(output, geometry, solver, config, + config[val_iZone]->GetInnerIter(), StopCalc, val_iZone, val_iInst); + /*--- If convergence was reached in every zone --*/ StopCalc = integration[val_iZone][INST_0][HEAT_SOL]->GetConvergence(); if (StopCalc) break; } - /*--- Set the heat convergence to false (to make sure outer subiterations converge) ---*/ - integration[val_iZone][INST_0][HEAT_SOL]->SetConvergence(false); - + if (multizone){ + + Output(output, geometry, solver, config, + config[val_iZone]->GetOuterIter(), StopCalc, val_iZone, val_iInst); + + /*--- Set the fluid convergence to false (to make sure outer subiterations converge) ---*/ + + integration[val_iZone][INST_0][HEAT_SOL]->SetConvergence(false); + } + //output->SetConvHistory_Body(NULL, geometry, solver, config, integration, true, 0.0, val_iZone, INST_0); } @@ -1462,9 +1343,9 @@ void CFEAIteration::Iterate(COutput *output, ) { su2double loadIncrement; - unsigned long IntIter = 0; config[val_iZone]->SetIntIter(IntIter); - unsigned long ExtIter = config[val_iZone]->GetExtIter(); - + unsigned long IntIter = 0; + unsigned long TimeIter = config[val_iZone]->GetTimeIter(); + bool StopCalc; unsigned long iIncrement; unsigned long nIncrements = config[val_iZone]->GetNumberIncrements(); @@ -1474,12 +1355,8 @@ void CFEAIteration::Iterate(COutput *output, bool disc_adj_fem = false; if (config[val_iZone]->GetKind_Solver() == DISC_ADJ_FEM) disc_adj_fem = true; - bool write_output = true; - bool incremental_load = config[val_iZone]->GetIncrementalLoad(); // If an incremental load is applied - ofstream ConvHist_file; - /*--- This is to prevent problems when running a linear solver ---*/ if (!nonlinear) incremental_load = false; @@ -1487,19 +1364,20 @@ void CFEAIteration::Iterate(COutput *output, integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); if (linear) { - - /*--- Set the value of the internal iteration ---*/ - - IntIter = ExtIter; - + + config[val_iZone]->SetInnerIter(0); + /*--- FEA equations ---*/ - config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS); /*--- Run the iteration ---*/ integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); + + Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + } /*--- If the structure is held static and the solver is nonlinear, we don't need to solve for static time, but we need to compute Mass Matrix and Integration constants ---*/ @@ -1508,43 +1386,37 @@ void CFEAIteration::Iterate(COutput *output, /*--- THIS IS THE DIRECT APPROACH (NO INCREMENTAL LOAD APPLIED) ---*/ if (!incremental_load) { - - /*--- Set the value of the internal iteration ---*/ - + IntIter = 0; - + config[val_iZone]->SetInnerIter(IntIter); + /*--- FEA equations ---*/ - config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); - - /*--- Write the convergence history headers ---*/ - - if (!disc_adj_fem) output->SetConvHistory_Body(NULL, geometry, solver, config, integration, true, 0.0, val_iZone, val_iInst); + config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS); /*--- Run the iteration ---*/ integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); - + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); + Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + /*----------------- If the solver is non-linear, we need to subiterate using a Newton-Raphson approach ----------------------*/ - for (IntIter = 1; IntIter < config[val_iZone]->GetDyn_nIntIter(); IntIter++) { + for (IntIter = 1; IntIter < config[val_iZone]->GetnInner_Iter(); IntIter++) { + config[val_iZone]->SetInnerIter(IntIter); + /*--- Limits to only one structural iteration for the discrete adjoint FEM problem ---*/ if (disc_adj_fem) break; - - /*--- Write the convergence history (first, compute Von Mises stress) ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); - write_output = output->PrintOutput(IntIter-1, config[val_iZone]->GetWrt_Con_Freq_DualTime()); - if (write_output) output->SetConvHistory_Body(&ConvHist_file, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); - - config[val_iZone]->SetIntIter(IntIter); - + integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); - if (integration[val_iZone][val_iInst][FEA_SOL]->GetConvergence()) break; + StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + + + if (StopCalc) break; } @@ -1554,7 +1426,7 @@ void CFEAIteration::Iterate(COutput *output, /*--- Set the initial condition: store the current solution as Solution_Old ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->SetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], ExtIter); + solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->SetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], TimeIter); /*--- The load increment is 1.0 ---*/ loadIncrement = 1.0; @@ -1564,38 +1436,32 @@ void CFEAIteration::Iterate(COutput *output, /*--- Set the value of the internal iteration ---*/ IntIter = 0; + config[val_iZone]->SetInnerIter(IntIter); /*--- FEA equations ---*/ - config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); - - /*--- Write the convergence history headers ---*/ - - if (!disc_adj_fem) output->SetConvHistory_Body(NULL, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); + config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS); /*--- Run the first iteration ---*/ integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); /*--- Write the convergence history (first, compute Von Mises stress) ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); - output->SetConvHistory_Body(&ConvHist_file, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); - + + Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + /*--- Run the second iteration ---*/ IntIter = 1; - - config[val_iZone]->SetIntIter(IntIter); + config[val_iZone]->SetInnerIter(IntIter); integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); /*--- Write the convergence history (first, compute Von Mises stress) ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); - output->SetConvHistory_Body(&ConvHist_file, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); - + Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); bool meetCriteria; su2double Residual_UTOL, Residual_RTOL, Residual_ETOL; @@ -1619,15 +1485,12 @@ void CFEAIteration::Iterate(COutput *output, for (IntIter = 2; IntIter < config[val_iZone]->GetDyn_nIntIter(); IntIter++) { /*--- Write the convergence history (first, compute Von Mises stress) ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); - output->SetConvHistory_Body(&ConvHist_file, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); - - config[val_iZone]->SetIntIter(IntIter); - + StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); - if (integration[val_iZone][val_iInst][FEA_SOL]->GetConvergence()) break; + if (StopCalc) break; } @@ -1640,7 +1503,7 @@ void CFEAIteration::Iterate(COutput *output, /*--- Here we have to restart the solution to the original one of the iteration ---*/ /*--- Retrieve the Solution_Old as the current solution before subiterating ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->ResetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], ExtIter); + solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->ResetInitialCondition(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], TimeIter); /*--- For the number of increments ---*/ for (iIncrement = 0; iIncrement < nIncrements; iIncrement++) { @@ -1650,12 +1513,12 @@ void CFEAIteration::Iterate(COutput *output, /*--- Set the load increment and the initial condition, and output the parameters of UTOL, RTOL, ETOL for the previous iteration ---*/ /*--- Set the convergence monitor to false, to force se solver to converge every subiteration ---*/ - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); + output->SetConvergence(false); /*--- FEA equations ---*/ - config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS); solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->SetLoad_Increment(loadIncrement); @@ -1667,16 +1530,15 @@ void CFEAIteration::Iterate(COutput *output, /*--- Set the value of the internal iteration ---*/ IntIter = 0; - config[val_iZone]->SetIntIter(IntIter); /*--- FEA equations ---*/ - config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(FEM_ELASTICITY, RUNTIME_FEA_SYS); /*--- Run the iteration ---*/ integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); /*----------------- If the solver is non-linear, we need to subiterate using a Newton-Raphson approach ----------------------*/ @@ -1684,23 +1546,19 @@ void CFEAIteration::Iterate(COutput *output, for (IntIter = 1; IntIter < config[val_iZone]->GetDyn_nIntIter(); IntIter++) { /*--- Write the convergence history (first, compute Von Mises stress) ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); - output->SetConvHistory_Body(&ConvHist_file, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); - - config[val_iZone]->SetIntIter(IntIter); + StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); integration[val_iZone][val_iInst][FEA_SOL]->Structural_Iteration(geometry, solver, numerics, - config, RUNTIME_FEA_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_FEA_SYS, val_iZone, val_iInst); - if (integration[val_iZone][val_iInst][FEA_SOL]->GetConvergence()) break; + if (StopCalc) break; } /*--- Write history for intermediate steps ---*/ if (iIncrement < nIncrements - 1){ /*--- Write the convergence history (first, compute Von Mises stress) ---*/ - solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); - output->SetConvHistory_Body(&ConvHist_file, geometry, solver, config, integration, false, 0.0, val_iZone, val_iInst); + StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); } } @@ -1754,9 +1612,9 @@ void CFEAIteration::Update(COutput *output, unsigned short val_iInst) { su2double Physical_dt, Physical_t; - unsigned long ExtIter = config[val_iZone]->GetExtIter(); - bool dynamic = (config[val_iZone]->GetDynamic_Analysis() == DYNAMIC); // Dynamic problems - bool static_fem = (config[val_iZone]->GetDynamic_Analysis() == STATIC); // Static problems + unsigned long TimeIter = config[val_iZone]->GetTimeIter(); + bool dynamic = (config[val_iZone]->GetTime_Domain()); // Dynamic problems + bool static_fem = (!config[val_iZone]->GetTime_Domain()); // Static problems bool fsi = config[val_iZone]->GetFSI_Simulation(); // Fluid-Structure Interaction problems @@ -1773,7 +1631,7 @@ void CFEAIteration::Update(COutput *output, /*--- Verify convergence criteria (based on total time) ---*/ Physical_dt = config[val_iZone]->GetDelta_DynTime(); - Physical_t = (ExtIter+1)*Physical_dt; + Physical_t = (TimeIter+1)*Physical_dt; if (Physical_t >= config[val_iZone]->GetTotal_DynTime()) integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(true); } else if ( static_fem && fsi) { @@ -1855,7 +1713,31 @@ bool CFEAIteration::Monitor(COutput *output, CVolumetricMovement ***grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, - unsigned short val_iInst) { return false; } + unsigned short val_iInst) { + + bool StopCalc = false; + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime - StartTime; + + solver[val_iZone][val_iInst][MESH_0][FEA_SOL]->Compute_NodalStress(geometry[val_iZone][val_iInst][MESH_0], + numerics[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone]); + + if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()){ + output->SetHistory_Output(geometry[val_iZone][INST_0][MESH_0], solver[val_iZone][INST_0][MESH_0], config[val_iZone], + config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), config[val_iZone]->GetInnerIter()); + } + + StopCalc = output->GetConvergence(); + + return StopCalc; + +} + void CFEAIteration::Postprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, @@ -1881,22 +1763,21 @@ void CFEAIteration::Solve(COutput *output, unsigned short val_iInst ) { - bool multizone = config[val_iZone]->GetMultizone_Problem(); - /*------------------ Structural subiteration ----------------------*/ Iterate(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + /*--- Write the convergence history for the structure (only screen output) ---*/ - if (multizone) output->SetConvHistory_Body(NULL, geometry, solver, config, integration, false, 0.0, val_iZone, INST_0); +// if (multizone) output->SetConvHistory_Body(geometry, solver, config, integration, false, 0.0, val_iZone, INST_0); /*--- Set the structural convergence to false (to make sure outer subiterations converge) ---*/ integration[val_iZone][INST_0][FEA_SOL]->SetConvergence(false); } -CAdjFluidIteration::CAdjFluidIteration(CConfig *config) : CIteration(config) { } +CAdjFluidIteration::CAdjFluidIteration(CConfig *config) : CFluidIteration(config) { } CAdjFluidIteration::~CAdjFluidIteration(void) { } void CAdjFluidIteration::Preprocess(COutput *output, CIntegration ****integration, @@ -1911,30 +1792,30 @@ void CAdjFluidIteration::Preprocess(COutput *output, unsigned short val_iInst) { unsigned short iMesh; - bool harmonic_balance = (config[ZONE_0]->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config[ZONE_0]->GetTime_Marching() == HARMONIC_BALANCE); bool dynamic_mesh = config[ZONE_0]->GetGrid_Movement(); - unsigned long IntIter = 0; config[ZONE_0]->SetIntIter(IntIter); - unsigned long ExtIter = config[ZONE_0]->GetExtIter(); + unsigned long InnerIter = 0; + unsigned long TimeIter = config[ZONE_0]->GetTimeIter(); /*--- For the unsteady adjoint, load a new direct solution from a restart file. ---*/ - if (((dynamic_mesh && ExtIter == 0) || config[val_iZone]->GetUnsteady_Simulation()) && !harmonic_balance) { - int Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(ExtIter) - 1; - if (rank == MASTER_NODE && val_iZone == ZONE_0 && config[val_iZone]->GetUnsteady_Simulation()) + if (((dynamic_mesh && TimeIter == 0) || config[val_iZone]->GetTime_Marching()) && !harmonic_balance) { + int Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 1; + if (rank == MASTER_NODE && val_iZone == ZONE_0 && config[val_iZone]->GetTime_Marching()) cout << endl << " Loading flow solution from direct iteration " << Direct_Iter << "." << endl; solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->LoadRestart(geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], Direct_Iter, true); } /*--- Continuous adjoint Euler, Navier-Stokes or Reynolds-averaged Navier-Stokes (RANS) equations ---*/ - if ((ExtIter == 0) || config[val_iZone]->GetUnsteady_Simulation()) { + if ((InnerIter == 0) || config[val_iZone]->GetTime_Marching()) { if (config[val_iZone]->GetKind_Solver() == ADJ_EULER) - config[val_iZone]->SetGlobalParam(ADJ_EULER, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(ADJ_EULER, RUNTIME_FLOW_SYS); if (config[val_iZone]->GetKind_Solver() == ADJ_NAVIER_STOKES) - config[val_iZone]->SetGlobalParam(ADJ_NAVIER_STOKES, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(ADJ_NAVIER_STOKES, RUNTIME_FLOW_SYS); if (config[val_iZone]->GetKind_Solver() == ADJ_RANS) - config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_FLOW_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_FLOW_SYS); /*--- Solve the Euler, Navier-Stokes or Reynolds-averaged Navier-Stokes (RANS) equations (one iteration) ---*/ @@ -1945,22 +1826,22 @@ void CAdjFluidIteration::Preprocess(COutput *output, cout << "Compute residuals to check the convergence of the direct problem." << endl; integration[val_iZone][val_iInst][FLOW_SOL]->MultiGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_FLOW_SYS, 0, val_iZone, val_iInst); + config, RUNTIME_FLOW_SYS, val_iZone, val_iInst); if (config[val_iZone]->GetKind_Solver() == ADJ_RANS) { /*--- Solve the turbulence model ---*/ - config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_TURB_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_TURB_SYS); integration[val_iZone][val_iInst][TURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_TURB_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_TURB_SYS, val_iZone, val_iInst); /*--- Solve transition model ---*/ if (config[val_iZone]->GetKind_Trans_Model() == LM) { - config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(RANS, RUNTIME_TRANS_SYS); integration[val_iZone][val_iInst][TRANS_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_TRANS_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_TRANS_SYS, val_iZone, val_iInst); } } @@ -2020,39 +1901,22 @@ void CAdjFluidIteration::Iterate(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter = 0; config[ZONE_0]->SetIntIter(IntIter); - unsigned long ExtIter = config[ZONE_0]->GetExtIter(); - bool unsteady = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND); - - /*--- Set the value of the internal iteration ---*/ - - ExtIter = config[val_iZone]->GetExtIter(); - - /* --- Setting up iteration values depending on if this is a - steady or an unsteady simulaiton */ - - if ( !unsteady ) - IntIter = ExtIter; - else - IntIter = config[val_iZone]->GetIntIter(); - - switch( config[val_iZone]->GetKind_Solver() ) { case ADJ_EULER: - config[val_iZone]->SetGlobalParam(ADJ_EULER, RUNTIME_ADJFLOW_SYS, ExtIter); break; + config[val_iZone]->SetGlobalParam(ADJ_EULER, RUNTIME_ADJFLOW_SYS); break; case ADJ_NAVIER_STOKES: - config[val_iZone]->SetGlobalParam(ADJ_NAVIER_STOKES, RUNTIME_ADJFLOW_SYS, ExtIter); break; + config[val_iZone]->SetGlobalParam(ADJ_NAVIER_STOKES, RUNTIME_ADJFLOW_SYS); break; case ADJ_RANS: - config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_ADJFLOW_SYS, ExtIter); break; + config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_ADJFLOW_SYS); break; } /*--- Iteration of the flow adjoint problem ---*/ integration[val_iZone][val_iInst][ADJFLOW_SOL]->MultiGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_ADJFLOW_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_ADJFLOW_SYS, val_iZone, val_iInst); /*--- Iteration of the turbulence model adjoint ---*/ @@ -2060,9 +1924,9 @@ void CAdjFluidIteration::Iterate(COutput *output, /*--- Adjoint turbulence model solution ---*/ - config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_ADJTURB_SYS, ExtIter); + config[val_iZone]->SetGlobalParam(ADJ_RANS, RUNTIME_ADJTURB_SYS); integration[val_iZone][val_iInst][ADJTURB_SOL]->SingleGrid_Iteration(geometry, solver, numerics, - config, RUNTIME_ADJTURB_SYS, IntIter, val_iZone, val_iInst); + config, RUNTIME_ADJTURB_SYS, val_iZone, val_iInst); } @@ -2081,12 +1945,12 @@ void CAdjFluidIteration::Update(COutput *output, su2double Physical_dt, Physical_t; unsigned short iMesh; - unsigned long ExtIter = config[ZONE_0]->GetExtIter(); + unsigned long TimeIter = config[ZONE_0]->GetTimeIter(); /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { /*--- Update dual time solver ---*/ @@ -2095,34 +1959,12 @@ void CAdjFluidIteration::Update(COutput *output, integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(false); } - Physical_dt = config[val_iZone]->GetDelta_UnstTime(); Physical_t = (ExtIter+1)*Physical_dt; + Physical_dt = config[val_iZone]->GetDelta_UnstTime(); Physical_t = (TimeIter+1)*Physical_dt; if (Physical_t >= config[val_iZone]->GetTotal_UnstTime()) integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(true); } } -bool CAdjFluidIteration::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) { return false; } -void CAdjFluidIteration::Postprocess(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) { } CDiscAdjFluidIteration::CDiscAdjFluidIteration(CConfig *config) : CIteration(config) { @@ -2150,30 +1992,29 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, StartTime = MPI_Wtime(); #endif - unsigned long IntIter = 0, iPoint; - config[ZONE_0]->SetIntIter(IntIter); - unsigned short ExtIter = config[val_iZone]->GetExtIter(); - bool dual_time_1st = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST); - bool dual_time_2nd = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND); + unsigned long iPoint; + unsigned short TimeIter = config[val_iZone]->GetTimeIter(); + bool dual_time_1st = (config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST); + bool dual_time_2nd = (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND); bool dual_time = (dual_time_1st || dual_time_2nd); unsigned short iMesh; int Direct_Iter; bool heat = config[val_iZone]->GetWeakly_Coupled_Heat(); bool grid_IsMoving = config[val_iZone]->GetGrid_Movement(); - /*--- Read the target pressure for inverse design. ---------------------------------------------*/ - if (config[val_iZone]->GetInvDesign_Cp() == YES) - output->SetCp_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL], geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], ExtIter); +// /*--- Read the target pressure for inverse design. ---------------------------------------------*/ +// if (config[val_iZone]->GetInvDesign_Cp() == YES) +// output->SetCp_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL], geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], ExtIter); - /*--- Read the target heat flux ----------------------------------------------------------------*/ - if (config[ZONE_0]->GetInvDesign_HeatFlux() == YES) - output->SetHeatFlux_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL], geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], ExtIter); +// /*--- Read the target heat flux ----------------------------------------------------------------*/ +// if (config[ZONE_0]->GetInvDesign_HeatFlux() == YES) +// output->SetHeatFlux_InverseDesign(solver[val_iZone][val_iInst][MESH_0][FLOW_SOL], geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], ExtIter); /*--- For the unsteady adjoint, load direct solutions from restart files. ---*/ - if (config[val_iZone]->GetUnsteady_Simulation()) { + if (config[val_iZone]->GetTime_Marching()) { - Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(ExtIter) - 2; + Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 2; /*--- For dual-time stepping we want to load the already converged solution at timestep n ---*/ @@ -2181,7 +2022,7 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, Direct_Iter += 1; } - if (ExtIter == 0){ + if (TimeIter == 0){ if (dual_time_2nd) { @@ -2236,7 +2077,7 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, LoadUnsteady_Solution(geometry, solver,config, val_iInst, val_iZone, Direct_Iter); - } else if ((ExtIter > 0) && dual_time) { + } else if ((TimeIter > 0) && dual_time) { /*--- Here the primal solutions (only working variables) are loaded and put in the correct order @@ -2341,13 +2182,13 @@ void CDiscAdjFluidIteration::Preprocess(COutput *output, /*--- Compute & set Grid Velocity via finite differences of the Coordinates. ---*/ if (grid_IsMoving) for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) - geometry[val_iZone][val_iInst][iMesh]->SetGridVelocity(config[val_iZone], ExtIter); + geometry[val_iZone][val_iInst][iMesh]->SetGridVelocity(config[val_iZone], TimeIter); }//if unsteady /*--- Store flow solution also in the adjoint solver in order to be able to reset it later ---*/ - if (ExtIter == 0 || dual_time) { + if (TimeIter == 0 || dual_time) { for (iMesh=0; iMesh<=config[val_iZone]->GetnMGLevels();iMesh++) { for (iPoint = 0; iPoint < geometry[val_iZone][val_iInst][iMesh]->GetnPoint(); iPoint++) { solver[val_iZone][val_iInst][iMesh][ADJFLOW_SOL]->node[iPoint]->SetSolution_Direct(solver[val_iZone][val_iInst][iMesh][FLOW_SOL]->node[iPoint]->GetSolution()); @@ -2427,18 +2268,10 @@ void CDiscAdjFluidIteration::Iterate(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long ExtIter = config[val_iZone]->GetExtIter(); unsigned short Kind_Solver = config[val_iZone]->GetKind_Solver(); - unsigned long IntIter = 0; - bool unsteady = config[val_iZone]->GetUnsteady_Simulation() != STEADY; bool frozen_visc = config[val_iZone]->GetFrozen_Visc_Disc(); bool heat = config[val_iZone]->GetWeakly_Coupled_Heat(); - if (!unsteady) - IntIter = ExtIter; - else { - IntIter = config[val_iZone]->GetIntIter(); - } /*--- Extract the adjoints of the conservative input variables and store them for the next iteration ---*/ @@ -2449,12 +2282,7 @@ void CDiscAdjFluidIteration::Iterate(COutput *output, solver[val_iZone][val_iInst][MESH_0][ADJFLOW_SOL]->ExtractAdjoint_Variables(geometry[val_iZone][val_iInst][MESH_0], config[val_iZone]); - /*--- Set the convergence criteria (only residual possible) ---*/ - - integration[val_iZone][val_iInst][ADJFLOW_SOL]->Convergence_Monitoring(geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], - IntIter, log10(solver[val_iZone][val_iInst][MESH_0][ADJFLOW_SOL]->GetRes_RMS(0)), MESH_0); - - } + } if (turbulent && !frozen_visc) { solver[val_iZone][val_iInst][MESH_0][ADJTURB_SOL]->ExtractAdjoint_Solution(geometry[val_iZone][val_iInst][MESH_0], @@ -2705,8 +2533,8 @@ void CDiscAdjFluidIteration::Update(COutput *output, /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(false); @@ -2726,9 +2554,7 @@ bool CDiscAdjFluidIteration::Monitor(COutput *output, unsigned short val_iInst) { bool StopCalc = false; - bool steady = (config[val_iZone]->GetUnsteady_Simulation() == STEADY); - bool output_history = false; - + #ifndef HAVE_MPI StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); #else @@ -2736,17 +2562,17 @@ bool CDiscAdjFluidIteration::Monitor(COutput *output, #endif UsedTime = StopTime - StartTime; - /*--- If convergence was reached --*/ - StopCalc = integration[val_iZone][INST_0][ADJFLOW_SOL]->GetConvergence(); - /*--- Write the convergence history for the fluid (only screen output) ---*/ - /*--- The logic is right now case dependent ----*/ - /*--- This needs to be generalized when the new output structure comes ---*/ - output_history = (steady && !(multizone && (config[val_iZone]->GetnInner_Iter()==1))); - - if (output_history) output->SetConvHistory_Body(NULL, geometry, solver, config, integration, false, UsedTime, val_iZone, INST_0); - + output->SetHistory_Output(geometry[ZONE_0][INST_0][MESH_0], + solver[ZONE_0][INST_0][MESH_0], + config[ZONE_0], + config[ZONE_0]->GetTimeIter(), + config[ZONE_0]->GetOuterIter(), + config[ZONE_0]->GetInnerIter()); + + StopCalc = output->GetConvergence(); + return StopCalc; } @@ -2784,7 +2610,7 @@ CDiscAdjFEAIteration::CDiscAdjFEAIteration(CConfig *config) : CIteration(config) for (iVar = 0; iVar < config->GetnPoissonRatio(); iVar++) myfile_res << "Sens_Nu_" << iVar << "\t"; - if (config->GetDynamic_Analysis() == DYNAMIC){ + if (config->GetTime_Domain()){ for (iVar = 0; iVar < config->GetnMaterialDensity(); iVar++) myfile_res << "Sens_Rho_" << iVar << "\t"; } @@ -2814,10 +2640,9 @@ void CDiscAdjFEAIteration::Preprocess(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter = 0, iPoint; - config[ZONE_0]->SetIntIter(IntIter); - unsigned short ExtIter = config[val_iZone]->GetExtIter(); - bool dynamic = (config[val_iZone]->GetDynamic_Analysis() == DYNAMIC); + unsigned long iPoint; + unsigned short TimeIter = config[val_iZone]->GetTimeIter(); + bool dynamic = (config[val_iZone]->GetTime_Domain()); int Direct_Iter; @@ -2825,7 +2650,7 @@ void CDiscAdjFEAIteration::Preprocess(COutput *output, if (dynamic) { - Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(ExtIter) - 1; + Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 1; /*--- We want to load the already converged solution at timesteps n and n-1 ---*/ @@ -2928,10 +2753,7 @@ void CDiscAdjFEAIteration::Iterate(COutput *output, unsigned short val_iInst) { - bool dynamic = (config[val_iZone]->GetDynamic_Analysis() == DYNAMIC); - - unsigned long nIntIter = config[val_iZone]->GetnIter(); - unsigned long IntIter = config[val_iZone]->GetIntIter(); + bool dynamic = (config[val_iZone]->GetTime_Domain()); /*--- Extract the adjoints of the conservative input variables and store them for the next iteration ---*/ @@ -2940,17 +2762,6 @@ void CDiscAdjFEAIteration::Iterate(COutput *output, solver[val_iZone][val_iInst][MESH_0][ADJFEA_SOL]->ExtractAdjoint_Variables(geometry[val_iZone][val_iInst][MESH_0], config[val_iZone]); - - /*--- Set the convergence criteria (only residual possible) ---*/ - - integration[val_iZone][val_iInst][ADJFEA_SOL]->Convergence_Monitoring(geometry[val_iZone][val_iInst][MESH_0],config[val_iZone], - IntIter,log10(solver[val_iZone][val_iInst][MESH_0][ADJFLOW_SOL]->GetRes_RMS(0)), MESH_0); - - /*--- Write the convergence history (only screen output) ---*/ - - if(IntIter != nIntIter-1) - output->SetConvHistory_Body(NULL, geometry, solver, config, integration, true, 0.0, val_iZone, val_iInst); - if (dynamic){ integration[val_iZone][val_iInst][ADJFEA_SOL]->SetConvergence(false); } @@ -2970,13 +2781,13 @@ void CDiscAdjFEAIteration::SetRecording(COutput *output, unsigned short val_iInst, unsigned short kind_recording) { - unsigned long IntIter = config[ZONE_0]->GetIntIter(); - unsigned long ExtIter = config[val_iZone]->GetExtIter(), DirectExtIter; - bool dynamic = (config[val_iZone]->GetDynamic_Analysis() == DYNAMIC); + unsigned long InnerIter = config[ZONE_0]->GetInnerIter(); + unsigned long TimeIter = config[val_iZone]->GetTimeIter(), DirectTimeIter; + bool dynamic = (config[val_iZone]->GetTime_Domain()); - DirectExtIter = 0; + DirectTimeIter = 0; if (dynamic){ - DirectExtIter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(ExtIter) - 1; + DirectTimeIter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 1; } /*--- Reset the tape ---*/ @@ -3019,7 +2830,7 @@ void CDiscAdjFEAIteration::SetRecording(COutput *output, /*--- Set the correct direct iteration number ---*/ if (dynamic){ - config[val_iZone]->SetExtIter(DirectExtIter); + config[val_iZone]->SetTimeIter(DirectTimeIter); } /*--- Run the direct iteration ---*/ @@ -3027,7 +2838,7 @@ void CDiscAdjFEAIteration::SetRecording(COutput *output, fem_iteration->Iterate(output,integration,geometry,solver,numerics, config,surface_movement,grid_movement,FFDBox, val_iZone, val_iInst); - config[val_iZone]->SetExtIter(ExtIter); + config[val_iZone]->SetTimeIter(TimeIter); /*--- Register structural variables and objective function as output ---*/ @@ -3043,7 +2854,7 @@ void CDiscAdjFEAIteration::SetRecording(COutput *output, /* --- Reset the number of the internal iterations---*/ - config[ZONE_0]->SetIntIter(IntIter); + config[ZONE_0]->SetInnerIter(InnerIter); } @@ -3249,7 +3060,20 @@ bool CDiscAdjFEAIteration::Monitor(COutput *output, CVolumetricMovement ***grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, - unsigned short val_iInst) { return false; } + unsigned short val_iInst) { + + /*--- Write the convergence history (only screen output) ---*/ + + output->SetHistory_Output(geometry[val_iZone][INST_0][MESH_0], + solver[val_iZone][INST_0][MESH_0], + config[val_iZone], + config[val_iZone]->GetTimeIter(), + config[val_iZone]->GetOuterIter(), + config[val_iZone]->GetInnerIter()); + + return false; + +} void CDiscAdjFEAIteration::Postprocess(COutput *output, CIntegration ****integration, CGeometry ****geometry, @@ -3263,7 +3087,7 @@ void CDiscAdjFEAIteration::Postprocess(COutput *output, unsigned short val_iInst) { - bool dynamic = (config[val_iZone]->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config[val_iZone]->GetTime_Domain()); /*--- Global sensitivities ---*/ solver[val_iZone][val_iInst][MESH_0][ADJFEA_SOL]->SetSensitivity(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0], config[val_iZone]); @@ -3281,7 +3105,7 @@ void CDiscAdjFEAIteration::Postprocess(COutput *output, myfile_res.precision(15); - myfile_res << config[val_iZone]->GetExtIter() << "\t"; + myfile_res << config[val_iZone]->GetTimeIter() << "\t"; switch (config[val_iZone]->GetKind_ObjFunc()){ case REFERENCE_GEOMETRY: @@ -3402,20 +3226,19 @@ void CDiscAdjHeatIteration::Preprocess(COutput *output, unsigned short val_iZone, unsigned short val_iInst) { - unsigned long IntIter = 0, iPoint; - config[ZONE_0]->SetIntIter(IntIter); - unsigned short ExtIter = config[val_iZone]->GetExtIter(); - bool dual_time_1st = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST); - bool dual_time_2nd = (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND); + unsigned long iPoint; + unsigned short TimeIter = config[val_iZone]->GetTimeIter(); + bool dual_time_1st = (config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST); + bool dual_time_2nd = (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND); bool dual_time = (dual_time_1st || dual_time_2nd); unsigned short iMesh; int Direct_Iter; /*--- For the unsteady adjoint, load direct solutions from restart files. ---*/ - if (config[val_iZone]->GetUnsteady_Simulation()) { + if (config[val_iZone]->GetTime_Marching()) { - Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(ExtIter) - 2; + Direct_Iter = SU2_TYPE::Int(config[val_iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 2; /*--- For dual-time stepping we want to load the already converged solution at timestep n ---*/ @@ -3423,7 +3246,7 @@ void CDiscAdjHeatIteration::Preprocess(COutput *output, Direct_Iter += 1; } - if (ExtIter == 0){ + if (TimeIter == 0){ if (dual_time_2nd) { @@ -3464,7 +3287,7 @@ void CDiscAdjHeatIteration::Preprocess(COutput *output, } - if ((ExtIter > 0) && dual_time){ + if ((TimeIter > 0) && dual_time){ /*--- Load solution timestep n - 2 ---*/ @@ -3517,7 +3340,7 @@ void CDiscAdjHeatIteration::Preprocess(COutput *output, /*--- Store flow solution also in the adjoint solver in order to be able to reset it later ---*/ - if (ExtIter == 0 || dual_time) { + if (TimeIter == 0 || dual_time) { for (iPoint = 0; iPoint < geometry[val_iZone][val_iInst][MESH_0]->GetnPoint(); iPoint++) { solver[val_iZone][val_iInst][MESH_0][ADJHEAT_SOL]->node[iPoint]->SetSolution_Direct(solver[val_iZone][val_iInst][MESH_0][HEAT_SOL]->node[iPoint]->GetSolution()); } @@ -3669,8 +3492,8 @@ void CDiscAdjHeatIteration::Update(COutput *output, /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { integration[val_iZone][val_iInst][ADJHEAT_SOL]->SetConvergence(false); @@ -3695,7 +3518,7 @@ void CDiscAdjHeatIteration::Output(COutput *output, CGeometry ****geometry, CSolver *****solver, CConfig **config, - unsigned long ExtIter, + unsigned long InnerIter, bool StopCalc, unsigned short val_iZone, unsigned short val_iInst) { } diff --git a/SU2_CFD/src/meson.build b/SU2_CFD/src/meson.build index bbf7ce6e8240..3195c085eff5 100644 --- a/SU2_CFD/src/meson.build +++ b/SU2_CFD/src/meson.build @@ -1,11 +1,4 @@ -su2_cfd_src = files(['output_structure.cpp', - 'output_cgns.cpp', - 'output_fieldview.cpp', - 'output_paraview.cpp', - 'output_physics.cpp', - 'output_su2.cpp', - 'output_tecplot.cpp', - 'solver_direct_transition.cpp', +su2_cfd_src = files(['solver_direct_transition.cpp', 'solver_adjoint_turbulent.cpp', 'integration_structure.cpp', 'solver_direct_mean_fem.cpp', @@ -43,6 +36,36 @@ su2_cfd_src = files(['output_structure.cpp', 'numerics_direct_elasticity_nonlinear.cpp', 'SU2_CFD.cpp']) +su2_cfd_src += files(['output/CAdjElasticityOutput.cpp', + 'output/CAdjFlowCompOutput.cpp', + 'output/CAdjFlowIncOutput.cpp', + 'output/CAdjHeatOutput.cpp', + 'output/CBaselineOutput.cpp', + 'output/CMultizoneOutput.cpp', + 'output/CElasticityOutput.cpp', + 'output/CFlowCompOutput.cpp', + 'output/CFlowCompFEMOutput.cpp', + 'output/CFlowOutput.cpp', + 'output/CFlowIncOutput.cpp', + 'output/CHeatOutput.cpp', + 'output/CMeshOutput.cpp', + 'output/output_physics.cpp', + 'output/COutput.cpp', + 'output/output_structure_legacy.cpp', + 'output/filewriter/CParallelDataSorter.cpp', + 'output/filewriter/CFVMDataSorter.cpp', + 'output/filewriter/CFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFVMDataSorter.cpp', + 'output/filewriter/CParallelFileWriter.cpp', + 'output/filewriter/CParaviewFileWriter.cpp', + 'output/filewriter/CParaviewBinaryFileWriter.cpp', + 'output/filewriter/CTecplotFileWriter.cpp', + 'output/filewriter/CTecplotBinaryFileWriter.cpp', + 'output/filewriter/CCSVFileWriter.cpp', + 'output/filewriter/CSU2FileWriter.cpp', + 'output/filewriter/CSU2BinaryFileWriter.cpp', + 'output/filewriter/CSU2MeshFileWriter.cpp']) su2_cfd_src += files(['variables/CIncNSVariable.cpp', 'variables/CTransLMVariable.cpp', diff --git a/SU2_CFD/src/numerics_direct_elasticity.cpp b/SU2_CFD/src/numerics_direct_elasticity.cpp index 94a8a06d874e..cd34693c4bdd 100644 --- a/SU2_CFD/src/numerics_direct_elasticity.cpp +++ b/SU2_CFD/src/numerics_direct_elasticity.cpp @@ -235,6 +235,11 @@ CFEAElasticity::~CFEAElasticity(void) { if (FAux_Dead_Load != NULL) delete [] FAux_Dead_Load; + if (E_i != NULL) delete [] E_i; + if (Nu_i != NULL) delete [] Nu_i; + if (Rho_s_i != NULL) delete [] Rho_s_i; + if (Rho_s_DL_i != NULL) delete [] Rho_s_DL_i; + if (Ni_Vec != NULL) delete [] Ni_Vec; } void CFEAElasticity::Compute_Mass_Matrix(CElement *element, CConfig *config) { diff --git a/SU2_CFD/src/numerics_direct_turbulent.cpp b/SU2_CFD/src/numerics_direct_turbulent.cpp index 9498c14b22b0..a38b4b80d6e9 100644 --- a/SU2_CFD/src/numerics_direct_turbulent.cpp +++ b/SU2_CFD/src/numerics_direct_turbulent.cpp @@ -1123,6 +1123,10 @@ CAvgGrad_TurbSST::CAvgGrad_TurbSST(unsigned short val_nDim, sigma_k2 = constants[1]; sigma_om2 = constants[3]; + F1_i = 0.0; F1_j = 0.0; + diff_kine = 0.0; + diff_omega = 0.0; + } CAvgGrad_TurbSST::~CAvgGrad_TurbSST(void) { diff --git a/SU2_CFD/src/numerics_structure.cpp b/SU2_CFD/src/numerics_structure.cpp index a97ee48883b4..c1700c085199 100644 --- a/SU2_CFD/src/numerics_structure.cpp +++ b/SU2_CFD/src/numerics_structure.cpp @@ -64,6 +64,8 @@ CNumerics::CNumerics(void) { l = NULL; m = NULL; + + using_uq = false; } diff --git a/SU2_CFD/src/output/CAdjElasticityOutput.cpp b/SU2_CFD/src/output/CAdjElasticityOutput.cpp new file mode 100644 index 000000000000..3f44b4eeb48d --- /dev/null +++ b/SU2_CFD/src/output/CAdjElasticityOutput.cpp @@ -0,0 +1,183 @@ +/*! + * \file output_adj_elasticity.cpp + * \brief Main subroutines for elasticity discrete adjoint output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CAdjElasticityOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CAdjElasticityOutput::CAdjElasticityOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + bool linear_analysis = (config->GetGeometricConditions() == SMALL_DEFORMATIONS); // Linear analysis. + bool nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. + + /*--- Initialize number of variables ---*/ + if (linear_analysis) nVar_FEM = nDim; + if (nonlinear_analysis) nVar_FEM = 3; + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RESIDUALS"); + requestedHistoryFields.emplace_back("SENSITIVITY"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + if (nRequestedScreenFields == 0){ + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("ADJOINT_DISP_X"); + requestedScreenFields.emplace_back("ADJOINT_DISP_Y"); + requestedScreenFields.emplace_back("SENS_E"); + requestedScreenFields.emplace_back("SENS_NU"); + nRequestedScreenFields = requestedScreenFields.size(); + } + + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("SENSITIVITY"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Adj. Comp. Fluid)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetAdj_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfAdjCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_AdjFileName(); + + /*--- Add the obj. function extension --- */ + + restartFilename = config->GetObjFunc_Extension(restartFilename); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("ADJOINT_DISP_X"); + +} + +CAdjElasticityOutput::~CAdjElasticityOutput(void) {} + +void CAdjElasticityOutput::SetHistoryOutputFields(CConfig *config){ + + // Residuals + AddHistoryOutput("ADJOINT_DISP_X", "Res[Ux_adj]", ScreenOutputFormat::FIXED, "RESIDUALS", ""); + AddHistoryOutput("ADJOINT_DISP_Y", "Res[Uy_adj]", ScreenOutputFormat::FIXED, "RESIDUALS", ""); + AddHistoryOutput("ADJOINT_DISP_Z", "Res[Uz_adj]", ScreenOutputFormat::FIXED, "RESIDUALS", ""); + + //Sensitivities + AddHistoryOutput("SENS_E", "Sens[E]", ScreenOutputFormat::FIXED, "SENSITIVITY", ""); + AddHistoryOutput("SENS_NU","Sens[Nu]", ScreenOutputFormat::FIXED, "SENSITIVITY", ""); + + +} + +inline void CAdjElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + SetHistoryOutputValue("ADJOINT_DISP_X", log10(solver[ADJFEA_SOL]->GetRes_RMS(0))); + SetHistoryOutputValue("ADJOINT_DISP_Y", log10(solver[ADJFEA_SOL]->GetRes_RMS(1))); + if (nVar_FEM == 3){ + SetHistoryOutputValue("ADJOINT_DISP_Z", log10(solver[ADJFEA_SOL]->GetRes_RMS(2))); + } + su2double Total_SensE = 0.0; su2double Total_SensNu = 0.0; + if (config->GetnElasticityMod() == 1){ + Total_SensE = solver[ADJFEA_SOL]->GetGlobal_Sens_E(0); + Total_SensNu = solver[ADJFEA_SOL]->GetGlobal_Sens_Nu(0); + } + else{ + // TODO: Update this and change tests + for (unsigned short iVar = 0; iVar < config->GetnElasticityMod(); iVar++){ + Total_SensE += solver[ADJFEA_SOL]->GetGlobal_Sens_E(0) + *solver[ADJFEA_SOL]->GetGlobal_Sens_E(0); + Total_SensNu += solver[ADJFEA_SOL]->GetGlobal_Sens_Nu(0) + *solver[ADJFEA_SOL]->GetGlobal_Sens_Nu(0); + } + Total_SensE = sqrt(Total_SensE); + Total_SensNu = sqrt(Total_SensNu); + } + SetHistoryOutputValue("SENS_E", Total_SensE); + SetHistoryOutputValue("SENS_NU", Total_SensNu); + +} + +void CAdjElasticityOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_Struc = solver[FEA_SOL]->node[iPoint]; + CPoint* Node_Geo = geometry->node[iPoint]; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("SENSITIVITY-X", iPoint, Node_Struc->GetSolution(0)); + SetVolumeOutputValue("SENSITIVITY-Y", iPoint, Node_Struc->GetSolution(1)); + if (nDim == 3) SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_Struc->GetSolution(2)); + +} + +void CAdjElasticityOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Geometrical sensitivities of the current objective function. + /// DESCRIPTION: Sensitivity x-component. + AddVolumeOutput("SENSITIVITY-X", "Sensitivity_x", "SENSITIVITY", "x-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity y-component. + AddVolumeOutput("SENSITIVITY-Y", "Sensitivity_y", "SENSITIVITY", "y-component of the sensitivity vector"); + if (nDim == 3) + /// DESCRIPTION: Sensitivity z-component. + AddVolumeOutput("SENSITIVITY-Z", "Sensitivity_z", "SENSITIVITY", "z-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity in normal direction. + AddVolumeOutput("SENSITIVITY", "Surface_Sensitivity", "SENSITIVITY", "sensitivity in normal direction"); + /// END_GROUP +} diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp new file mode 100644 index 000000000000..aee945be59d1 --- /dev/null +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -0,0 +1,463 @@ +/*! + * \file output_adj_flow_comp.cpp + * \brief Main subroutines for flow discrete adjoint output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CAdjFlowOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CAdjFlowCompOutput::CAdjFlowCompOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + turb_model = config->GetKind_Turb_Model(); + + cont_adj = config->GetContinuous_Adjoint(); + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + requestedHistoryFields.emplace_back("SENSITIVITY"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + if (nRequestedScreenFields == 0){ + if (config->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_ADJ_DENSITY"); + requestedScreenFields.emplace_back("RMS_ADJ_MOMENTUM-X"); + requestedScreenFields.emplace_back("SENS_GEO"); + requestedScreenFields.emplace_back("SENS_AOA"); + nRequestedScreenFields = requestedScreenFields.size(); + } + + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("SENSITIVITY"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Adj. Comp. Fluid)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetAdj_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfAdjCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_AdjFileName(); + + /*--- Add the obj. function extension --- */ + + restartFilename = config->GetObjFunc_Extension(restartFilename); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_ADJ_DENSITY"); + +} + +CAdjFlowCompOutput::~CAdjFlowCompOutput(void) {} + +void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ + + /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. + /// DESCRIPTION: Root-mean square residual of the adjoint density. + AddHistoryOutput("RMS_ADJ_DENSITY", "rms[A_Rho]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint momentum x-component. + AddHistoryOutput("RMS_ADJ_MOMENTUM-X", "rms[A_RhoU]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint momentum x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint momentum y-component. + AddHistoryOutput("RMS_ADJ_MOMENTUM-Y", "rms[A_RhoV]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint momentum y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint momentum z-component. + AddHistoryOutput("RMS_ADJ_MOMENTUM-Z", "rms[A_RhoW]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint momentum z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint energy. + AddHistoryOutput("RMS_ADJ_ENERGY", "rms[A_E]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint energy.", HistoryFieldType::RESIDUAL); + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Root-mean square residual of the adjoint nu tilde. + AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); + break; + case SST: + /// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy. + AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint dissipation. + AddHistoryOutput("RMS_ADJ_DISSIPATION", "rms[A_w]", ScreenOutputFormat::FIXED, "RMS_RES", " Root-mean square residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the adjoint density. + AddHistoryOutput("MAX_ADJ_DENSITY", "max[A_Rho]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint momentum x-component + AddHistoryOutput("MAX_ADJ_MOMENTUM-X", "max[A_RhoU]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint momentum x-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint momentum y-component + AddHistoryOutput("MAX_ADJ_MOMENTUM-Y", "max[A_RhoV]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint momentum y-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint momentum z-component + AddHistoryOutput("MAX_ADJ_MOMENTUM-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint momentum z-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint energy. + AddHistoryOutput("MAX_ADJ_ENERGY", "max[A_E]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint energy.", HistoryFieldType::RESIDUAL); + if (!config->GetFrozen_Visc_Disc()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Maximum residual of the adjoint nu tilde. + AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); + break; + case SST: + /// DESCRIPTION: Maximum residual of the adjoint kinetic energy. + AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint dissipation. + AddHistoryOutput("MAX_ADJ_DISSIPATION", "max[A_w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); + break; + default: break; + } + } + /// END_GROUP + + + /// /// BEGIN_GROUP: BGS_RES, DESCRIPTION: The Block Gauss Seidel residuals of the SOLUTION variables. + /// DESCRIPTION: BGS residual of the adjoint density. + AddHistoryOutput("BGS_ADJ_DENSITY", "bgs[A_Rho]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint momentum x-component + AddHistoryOutput("BGS_ADJ_MOMENTUM-X", "bgs[A_RhoU]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint momentum x-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint momentum y-component + AddHistoryOutput("BGS_ADJ_MOMENTUM-Y", "bgs[A_RhoV]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint momentum y-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint momentum z-component + AddHistoryOutput("BGS_ADJ_MOMENTUM-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint momentum z-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint energy. + AddHistoryOutput("BGS_ADJ_ENERGY", "bgs[A_E]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint energy.", HistoryFieldType::RESIDUAL); + if (!config->GetFrozen_Visc_Disc()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: BGS residual of the adjoint nu tilde. + AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); + break; + case SST: + /// DESCRIPTION: BGS residual of the adjoint kinetic energy. + AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint dissipation. + AddHistoryOutput("BGS_ADJ_DISSIPATION", "bgs[A_w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); + break; + default: break; + } + } + + /// END_GROUP + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Sensitivities of different geometrical or boundary values. + /// DESCRIPTION: Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING. + AddHistoryOutput("SENS_GEO", "Sens_Geo", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the angle of attack (only for compressible solver). + AddHistoryOutput("SENS_AOA", "Sens_AoA", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the angle of attack (only for compressible solver).", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the Mach number (only of compressible solver). + AddHistoryOutput("SENS_MACH", "Sens_Mach", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the Mach number (only of compressible solver).", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the far-field pressure. + AddHistoryOutput("SENS_PRESS", "Sens_Press", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the far-field pressure.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the far-field temperature. + AddHistoryOutput("SENS_TEMP", "Sens_Temp", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the far-field temperature.", HistoryFieldType::COEFFICIENT); + /// END_GROUP + +} + +void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver){ + + CSolver* adjflow_solver = solver[ADJFLOW_SOL]; + CSolver* adjturb_solver = solver[ADJTURB_SOL]; + + SetHistoryOutputValue("RMS_ADJ_DENSITY", log10(adjflow_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_ADJ_MOMENTUM-X", log10(adjflow_solver->GetRes_RMS(1))); + SetHistoryOutputValue("RMS_ADJ_MOMENTUM-Y", log10(adjflow_solver->GetRes_RMS(2))); + if (geometry->GetnDim() == 3) { + SetHistoryOutputValue("RMS_ADJ_MOMENTUM-Z", log10(adjflow_solver->GetRes_RMS(3))); + SetHistoryOutputValue("RMS_ADJ_ENERGY", log10(adjflow_solver->GetRes_RMS(4))); + } else { + SetHistoryOutputValue("RMS_ADJ_ENERGY", log10(adjflow_solver->GetRes_RMS(3))); + } + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("RMS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_RMS(0))); + break; + case SST: + SetHistoryOutputValue("RMS_ADJ_TKE", log10(adjturb_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_RMS(1))); + break; + default: break; + } + } + SetHistoryOutputValue("MAX_ADJ_DENSITY", log10(adjflow_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_ADJ_MOMENTUM-X", log10(adjflow_solver->GetRes_Max(1))); + SetHistoryOutputValue("MAX_ADJ_MOMENTUM-Y", log10(adjflow_solver->GetRes_Max(2))); + if (geometry->GetnDim() == 3) { + SetHistoryOutputValue("MAX_ADJ_MOMENTUM-Z", log10(adjflow_solver->GetRes_Max(3))); + SetHistoryOutputValue("MAX_ADJ_ENERGY", log10(adjflow_solver->GetRes_Max(4))); + } else { + SetHistoryOutputValue("MAX_ADJ_ENERGY", log10(adjflow_solver->GetRes_Max(3))); + } + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("MAX_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_Max(0))); + break; + case SST: + SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1))); + break; + default: break; + } + } + + if (multiZone){ + SetHistoryOutputValue("BGS_ADJ_DENSITY", log10(adjflow_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_ADJ_MOMENTUM-X", log10(adjflow_solver->GetRes_BGS(1))); + SetHistoryOutputValue("BGS_ADJ_MOMENTUM-Y", log10(adjflow_solver->GetRes_BGS(2))); + if (geometry->GetnDim() == 3) { + SetHistoryOutputValue("BGS_ADJ_MOMENTUM-Z", log10(adjflow_solver->GetRes_BGS(3))); + SetHistoryOutputValue("BGS_ADJ_ENERGY", log10(adjflow_solver->GetRes_BGS(4))); + } else { + SetHistoryOutputValue("BGS_ADJ_ENERGY", log10(adjflow_solver->GetRes_BGS(3))); + } + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("BGS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_BGS(0))); + break; + case SST: + SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_ADJOINT_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); + break; + default: break; + } + } + } + + SetHistoryOutputValue("SENS_GEO", adjflow_solver->GetTotal_Sens_Geo()); + SetHistoryOutputValue("SENS_AOA", adjflow_solver->GetTotal_Sens_AoA() * PI_NUMBER / 180.0); + SetHistoryOutputValue("SENS_MACH", adjflow_solver->GetTotal_Sens_Mach()); + SetHistoryOutputValue("SENS_PRESS", adjflow_solver->GetTotal_Sens_Press()); + SetHistoryOutputValue("SENS_TEMP", adjflow_solver->GetTotal_Sens_Temp()); + +} + +void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + /// BEGIN_GROUP: SOLUTION, DESCRIPTION: The SOLUTION variables of the adjoint solver. + /// DESCRIPTION: Adjoint density. + AddVolumeOutput("ADJ_DENSITY", "Adjoint_Density", "SOLUTION", "Adjoint density"); + /// DESCRIPTION: Adjoint momentum x-component. + AddVolumeOutput("ADJ_MOMENTUM-X", "Adjoint_Momentum_x", "SOLUTION", "x-component of the adjoint momentum vector"); + /// DESCRIPTION: Adjoint momentum y-component. + AddVolumeOutput("ADJ_MOMENTUM-Y", "Adjoint_Momentum_y", "SOLUTION", "y-component of the adjoint momentum vector"); + if (nDim == 3) + /// DESCRIPTION: Adjoint momentum z-component. + AddVolumeOutput("ADJ_MOMENTUM-Z", "Adjoint_Momentum_z", "SOLUTION", "z-component of the adjoint momentum vector"); + /// DESCRIPTION: Adjoint energy. + AddVolumeOutput("ADJ_ENERGY", "Adjoint_Energy", "SOLUTION", "Adjoint energy"); + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Adjoint nu tilde. + AddVolumeOutput("ADJ_NU_TILDE", "Adjoint_Nu_Tilde", "SOLUTION", "Adjoint Spalart-Allmaras variable"); + break; + case SST: + /// DESCRIPTION: Adjoint kinetic energy. + AddVolumeOutput("ADJ_TKE", "Adjoint_TKE", "SOLUTION", "Adjoint kinetic energy"); + /// DESCRIPTION: Adjoint dissipation. + AddVolumeOutput("ADJ_DISSIPATION", "Adjoint_Omega", "SOLUTION", "Adjoint rate of dissipation"); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: RESIDUAL, DESCRIPTION: Residuals of the SOLUTION variables. + /// DESCRIPTION: Residual of the adjoint density. + AddVolumeOutput("RES_ADJ_DENSITY", "Residual_Adjoint_Density", "RESIDUAL", "Residual of the adjoint density"); + /// DESCRIPTION: Residual of the adjoint momentum x-component. + AddVolumeOutput("RES_ADJ_MOMENTUM-X", "Residual_Adjoint_Momentum_x", "RESIDUAL", "Residual of the adjoint x-momentum"); + /// DESCRIPTION: Residual of the adjoint momentum y-component. + AddVolumeOutput("RES_ADJ_MOMENTUM-Y", "Residual_Adjoint_Momentum_y", "RESIDUAL", "Residual of the adjoint y-momentum"); + if (nDim == 3) + /// DESCRIPTION: Residual of the adjoint momentum z-component. + AddVolumeOutput("RES_ADJ_MOMENTUM-Z", "Residual_Adjoint_Momentum_z", "RESIDUAL", "Residual of the adjoint z-momentum"); + /// DESCRIPTION: Residual of the adjoint energy. + AddVolumeOutput("RES_ADJ_ENERGY", "Residual_Adjoint_Energy", "RESIDUAL", "Residual of the adjoint energy"); + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Residual of the nu tilde. + AddVolumeOutput("RES_ADJ_NU_TILDE", "Residual_Adjoint_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); + break; + case SST: + /// DESCRIPTION: Residual of the adjoint kinetic energy. + AddVolumeOutput("RES_ADJ_TKE", "Residual_Adjoint_TKE", "RESIDUAL", "Residual of the turb. kinetic energy"); + /// DESCRIPTION: Residual of the adjoint dissipation. + AddVolumeOutput("RES_ADJ_DISSIPATION", "Residual_Adjoint_Omega", "RESIDUAL", "Residual of the rate of dissipation"); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Geometrical sensitivities of the current objective function. + /// DESCRIPTION: Sensitivity x-component. + AddVolumeOutput("SENSITIVITY-X", "Sensitivity_x", "SENSITIVITY", "x-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity y-component. + AddVolumeOutput("SENSITIVITY-Y", "Sensitivity_y", "SENSITIVITY", "y-component of the sensitivity vector"); + if (nDim == 3) + /// DESCRIPTION: Sensitivity z-component. + AddVolumeOutput("SENSITIVITY-Z", "Sensitivity_z", "SENSITIVITY", "z-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity in normal direction. + AddVolumeOutput("SENSITIVITY", "Surface_Sensitivity", "SENSITIVITY", "sensitivity in normal direction"); + /// END_GROUP + +} + +void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_AdjFlow = solver[ADJFLOW_SOL]->node[iPoint]; + CVariable* Node_AdjTurb = NULL; + CPoint* Node_Geo = geometry->node[iPoint]; + + if (config->GetKind_Turb_Model() != NONE && + ((!config->GetFrozen_Visc_Disc() && !cont_adj) || + (!config->GetFrozen_Visc_Cont() && cont_adj))){ + Node_AdjTurb = solver[ADJTURB_SOL]->node[iPoint]; + } + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("ADJ_DENSITY", iPoint, Node_AdjFlow->GetSolution(0)); + SetVolumeOutputValue("ADJ_MOMENTUM-X", iPoint, Node_AdjFlow->GetSolution(1)); + SetVolumeOutputValue("ADJ_MOMENTUM-Y", iPoint, Node_AdjFlow->GetSolution(2)); + if (nDim == 3){ + SetVolumeOutputValue("ADJ_MOMENTUM-Z", iPoint, Node_AdjFlow->GetSolution(3)); + SetVolumeOutputValue("ADJ_ENERGY", iPoint, Node_AdjFlow->GetSolution(4)); + } else { + SetVolumeOutputValue("ADJ_ENERGY", iPoint, Node_AdjFlow->GetSolution(3)); + } + + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + // Turbulent + switch(turb_model){ + case SST: + SetVolumeOutputValue("ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(0)); + SetVolumeOutputValue("ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(0)); + break; + case NONE: + break; + } + } + + // Residuals + SetVolumeOutputValue("RES_ADJ_DENSITY", iPoint, Node_AdjFlow->GetSolution(0) - Node_AdjFlow->GetSolution_Old(0)); + SetVolumeOutputValue("RES_ADJ_MOMENTUM-X", iPoint, Node_AdjFlow->GetSolution(1) - Node_AdjFlow->GetSolution_Old(1)); + SetVolumeOutputValue("RES_ADJ_MOMENTUM-Y", iPoint, Node_AdjFlow->GetSolution(2) - Node_AdjFlow->GetSolution_Old(2)); + if (nDim == 3){ + SetVolumeOutputValue("RES_ADJ_MOMENTUM-Z", iPoint, Node_AdjFlow->GetSolution(3) - Node_AdjFlow->GetSolution_Old(3)); + SetVolumeOutputValue("RES_ADJ_ENERGY", iPoint, Node_AdjFlow->GetSolution(4) - Node_AdjFlow->GetSolution_Old(4)); + } else { + SetVolumeOutputValue("RES_ADJ_ENERGY", iPoint, Node_AdjFlow->GetSolution(3) - Node_AdjFlow->GetSolution_Old(3)); + } + + if ((!config->GetFrozen_Visc_Disc() && !cont_adj) || (!config->GetFrozen_Visc_Cont() && cont_adj)){ + switch(config->GetKind_Turb_Model()){ + case SST: + SetVolumeOutputValue("RES_ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(0) - Node_AdjTurb->GetSolution_Old(0)); + SetVolumeOutputValue("RES_ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(1) - Node_AdjTurb->GetSolution_Old(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("RES_ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(0) - Node_AdjTurb->GetSolution_Old(0)); + break; + case NONE: + break; + } + } + + SetVolumeOutputValue("SENSITIVITY-X", iPoint, Node_AdjFlow->GetSensitivity(0)); + SetVolumeOutputValue("SENSITIVITY-Y", iPoint, Node_AdjFlow->GetSensitivity(1)); + if (nDim == 3) + SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_AdjFlow->GetSensitivity(2)); + +} + +void CAdjFlowCompOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ + + SetVolumeOutputValue("SENSITIVITY", iPoint, solver[ADJFLOW_SOL]->GetCSensitivity(iMarker, iVertex)); + +} + + +bool CAdjFlowCompOutput::SetInit_Residuals(CConfig *config){ + + return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == STEADY && (curTimeIter < 2)); + +} + +bool CAdjFlowCompOutput::SetUpdate_Averages(CConfig *config){ + return false; + +// return (config->GetUnsteady_Simulation() != STEADY && !dualtime); + +} + diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp new file mode 100644 index 000000000000..0dd430963119 --- /dev/null +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -0,0 +1,490 @@ +/*! + * \file output_adj_flow_inc.cpp + * \brief Main subroutines for flow discrete adjoint output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CAdjFlowIncOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CAdjFlowIncOutput::CAdjFlowIncOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + turb_model = config->GetKind_Turb_Model(); + + heat = config->GetEnergy_Equation(); + + weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + requestedHistoryFields.emplace_back("SENSITIVITY"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + if (nRequestedScreenFields == 0){ + if (config->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_ADJ_PRESSURE"); + requestedScreenFields.emplace_back("RMS_ADJ_VELOCITY-X"); + requestedScreenFields.emplace_back("SENS_GEO"); + requestedScreenFields.emplace_back("SENS_AOA"); + nRequestedScreenFields = requestedScreenFields.size(); + } + + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("SENSITIVITY"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Adj. Incomp. Fluid)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetAdj_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfAdjCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_AdjFileName(); + + /*--- Add the obj. function extension --- */ + + restartFilename = config->GetObjFunc_Extension(restartFilename); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_ADJ_PRESSURE"); + +} + +CAdjFlowIncOutput::~CAdjFlowIncOutput(void) {} + +void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ + + /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. + /// DESCRIPTION: Root-mean square residual of the adjoint Pressure. + AddHistoryOutput("RMS_ADJ_PRESSURE", "rms[A_P]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Pressure.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint Velocity x-component. + AddHistoryOutput("RMS_ADJ_VELOCITY-X", "rms[A_U]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint Velocity y-component. + AddHistoryOutput("RMS_ADJ_VELOCITY-Y", "rms[A_V]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint Velocity z-component. + AddHistoryOutput("RMS_ADJ_VELOCITY-Z", "rms[A_W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the temperature. + AddHistoryOutput("RMS_ADJ_HEAT", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", " Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Root-mean square residual of the adjoint nu tilde. + AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); + break; + case SST: + /// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy. + AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the adjoint dissipation. + AddHistoryOutput("RMS_ADJ_DISSIPATION", "rms[A_w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the adjoint Pressure. + AddHistoryOutput("MAX_ADJ_PRESSURE", "max[A_Rho]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Pressure.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint Velocity x-component + AddHistoryOutput("MAX_ADJ_VELOCITY-X", "max[A_RhoU]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity x-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint Velocity y-component + AddHistoryOutput("MAX_ADJ_VELOCITY-Y", "max[A_RhoV]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity y-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint Velocity z-component + AddHistoryOutput("MAX_ADJ_VELOCITY-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the temperature. + AddHistoryOutput("MAX_ADJ_HEAT", "max[A_T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature.", HistoryFieldType::RESIDUAL); + if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Maximum residual of the adjoint nu tilde. + AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); + break; + case SST: + /// DESCRIPTION: Maximum residual of the adjoint kinetic energy. + AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the adjoint dissipation. + AddHistoryOutput("MAX_ADJ_DISSIPATION", "max[A_w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: BGS_RES, DESCRIPTION: The block Gauss Seidel residuals of the SOLUTION variables. + /// DESCRIPTION: BGS residual of the adjoint Pressure. + AddHistoryOutput("BGS_ADJ_PRESSURE", "bgs[A_Rho]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Pressure.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint Velocity x-component + AddHistoryOutput("BGS_ADJ_VELOCITY-X", "bsg[A_RhoU]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity x-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint Velocity y-component + AddHistoryOutput("BGS_ADJ_VELOCITY-Y", "bgs[A_RhoV]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity y-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint Velocity z-component + AddHistoryOutput("BGS_ADJ_VELOCITY-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the temperature. + AddHistoryOutput("BGS_ADJ_HEAT", "bgs[A_T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: BGS residual of the adjoint nu tilde. + AddHistoryOutput("BGS_ADJ_NU_TILDE", "bsg[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); + break; + case SST: + /// DESCRIPTION: BGS residual of the adjoint kinetic energy. + AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: BGS residual of the adjoint dissipation. + AddHistoryOutput("BGS_ADJ_DISSIPATION", "bgs[A_w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Sensitivities of different geometrical or boundary values. + /// DESCRIPTION: Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING. + AddHistoryOutput("SENS_GEO", "Sens_Geo", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the far-field pressure. + AddHistoryOutput("SENS_PRESS", "Sens_Press", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the far-field pressure.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the far-field temperature. + AddHistoryOutput("SENS_TEMP", "Sens_Temp", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", " Sensitivity of the objective function with respect to the far-field temperature.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the inlet velocity. + AddHistoryOutput("SENS_VEL_IN", "Sens_Vin", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", " Sensitivity of the objective function with respect to the inlet velocity.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sensitivity of the objective function with respect to the outlet pressure. + AddHistoryOutput("SENS_PRESS_OUT", "Sens_Pout", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sensitivity of the objective function with respect to the outlet pressure.", HistoryFieldType::COEFFICIENT); + /// END_GROUP + +} + +void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* adjflow_solver = solver[ADJFLOW_SOL]; + CSolver* adjturb_solver = solver[ADJTURB_SOL]; + CSolver* adjheat_solver = solver[ADJHEAT_SOL]; + + SetHistoryOutputValue("RMS_ADJ_PRESSURE", log10(adjflow_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_ADJ_VELOCITY-X", log10(adjflow_solver->GetRes_RMS(1))); + SetHistoryOutputValue("RMS_ADJ_VELOCITY-Y", log10(adjflow_solver->GetRes_RMS(2))); + if (nDim == 3) { + SetHistoryOutputValue("RMS_ADJ_VELOCITY-Z", log10(adjflow_solver->GetRes_RMS(3))); + } + if (weakly_coupled_heat){ + SetHistoryOutputValue("RMS_ADJ_HEAT", log10(adjheat_solver->GetRes_RMS(0))); + } + if (heat){ + if (nDim == 3) SetHistoryOutputValue("RMS_ADJ_HEAT", log10(adjflow_solver->GetRes_RMS(4))); + else SetHistoryOutputValue("RMS_ADJ_HEAT", log10(adjflow_solver->GetRes_RMS(3))); + } + if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("RMS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_RMS(0))); + break; + case SST: + SetHistoryOutputValue("RMS_ADJ_TKE", log10(adjturb_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_RMS(1))); + break; + default: break; + } + } + SetHistoryOutputValue("MAX_ADJ_PRESSURE", log10(adjflow_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_ADJ_VELOCITY-X", log10(adjflow_solver->GetRes_Max(1))); + SetHistoryOutputValue("MAX_ADJ_VELOCITY-Y", log10(adjflow_solver->GetRes_Max(2))); + if (nDim == 3) { + SetHistoryOutputValue("MAX_ADJ_VELOCITY-Z", log10(adjflow_solver->GetRes_Max(3))); + } + if (weakly_coupled_heat){ + SetHistoryOutputValue("MAX_ADJ_HEAT", log10(adjheat_solver->GetRes_Max(0))); + } + if (heat){ + if (nDim == 3) SetHistoryOutputValue("MAX_ADJ_HEAT", log10(adjflow_solver->GetRes_Max(4))); + else SetHistoryOutputValue("MAX_ADJ_HEAT", log10(adjflow_solver->GetRes_Max(3))); + } + if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("MAX_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_Max(0))); + break; + case SST: + SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1))); + break; + default: break; + } + } + + if (multiZone){ + SetHistoryOutputValue("BGS_ADJ_PRESSURE", log10(adjflow_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_ADJ_VELOCITY-X", log10(adjflow_solver->GetRes_BGS(1))); + SetHistoryOutputValue("BGS_ADJ_VELOCITY-Y", log10(adjflow_solver->GetRes_BGS(2))); + if (nDim == 3) { + SetHistoryOutputValue("BGS_ADJ_VELOCITY-Z", log10(adjflow_solver->GetRes_BGS(3))); + } + if (weakly_coupled_heat){ + SetHistoryOutputValue("BGS_ADJ_HEAT", log10(adjheat_solver->GetRes_BGS(0))); + } + if (heat){ + if (nDim == 3) SetHistoryOutputValue("BGS_ADJ_HEAT", log10(adjflow_solver->GetRes_BGS(4))); + else SetHistoryOutputValue("BGS_ADJ_HEAT", log10(adjflow_solver->GetRes_BGS(3))); + } + if (!config->GetFrozen_Visc_Disc() || !config->GetFrozen_Visc_Cont()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("BGS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_BGS(0))); + break; + case SST: + SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_ADJOINT_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); + break; + default: break; + } + } + } + + SetHistoryOutputValue("SENS_GEO", adjflow_solver->GetTotal_Sens_Geo()); + SetHistoryOutputValue("SENS_PRESS", adjflow_solver->GetTotal_Sens_Press()); + SetHistoryOutputValue("SENS_TEMP", adjflow_solver->GetTotal_Sens_Temp()); + SetHistoryOutputValue("SENS_VEL_IN", adjflow_solver->GetTotal_Sens_ModVel()); + SetHistoryOutputValue("SENS_PRESS_OUT", adjflow_solver->GetTotal_Sens_BPress()); + +} + +void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ + + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + /// BEGIN_GROUP: SOLUTION, DESCRIPTION: The SOLUTION variables of the adjoint solver. + /// DESCRIPTION: Adjoint Pressure. + AddVolumeOutput("ADJ_PRESSURE", "Adjoint_Pressure", "SOLUTION", "Adjoint pressure"); + /// DESCRIPTION: Adjoint Velocity x-component. + AddVolumeOutput("ADJ_VELOCITY-X", "Adjoint_Velocity_x", "SOLUTION", "x-component of the adjoint velocity vector"); + /// DESCRIPTION: Adjoint Velocity y-component. + AddVolumeOutput("ADJ_VELOCITY-Y", "Adjoint_Velocity_y", "SOLUTION", "y-component of the adjoint velocity vector"); + if (nDim == 3) + /// DESCRIPTION: Adjoint Velocity z-component. + AddVolumeOutput("ADJ_VELOCITY-Z", "Adjoint_Velocity_z", "SOLUTION", "z-component of the adjoint velocity vector"); + + if (weakly_coupled_heat || heat){ + AddVolumeOutput("ADJ_HEAT", "Adjoint_Heat", "SOLUTION", "Adjoint heat"); + } + + if (!config->GetFrozen_Visc_Disc()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Adjoint nu tilde. + AddVolumeOutput("ADJ_NU_TILDE", "Adjoint_Nu_Tilde", "SOLUTION", "Adjoint Spalart-Allmaras variable"); + break; + case SST: + /// DESCRIPTION: Adjoint kinetic energy. + AddVolumeOutput("ADJ_TKE", "Adjoint_TKE", "SOLUTION", "Adjoint turbulent kinetic energy"); + /// DESCRIPTION: Adjoint dissipation. + AddVolumeOutput("ADJ_DISSIPATION", "Adjoint_Omega", "SOLUTION", "Adjoint rate of dissipation"); + break; + default: break; + } + } + /// END_GROUP + + // Grid velocity + if (config->GetGrid_Movement()){ + AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); + AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); + if (nDim == 3 ) + AddVolumeOutput("GRID_VELOCITY-Z", "Grid_Velocity_z", "GRID_VELOCITY", "z-component of the grid velocity vector"); + } + + /// BEGIN_GROUP: RESIDUAL, DESCRIPTION: Residuals of the SOLUTION variables. + /// DESCRIPTION: Residual of the adjoint Pressure. + AddVolumeOutput("RES_ADJ_PRESSURE", "Residual_Adjoint_Pressure", "RESIDUAL", "Residual of the adjoint pressure"); + /// DESCRIPTION: Residual of the adjoint Velocity x-component. + AddVolumeOutput("RES_ADJ_VELOCITY-X", "Residual_Adjoint_Velocity_x", "RESIDUAL", "Residual of the adjoint x-velocity"); + /// DESCRIPTION: Residual of the adjoint Velocity y-component. + AddVolumeOutput("RES_ADJ_VELOCITY-Y", "Residual_Adjoint_Velocity_y", "RESIDUAL", "Residual of the adjoint y-velocity"); + if (nDim == 3) + /// DESCRIPTION: Residual of the adjoint Velocity z-component. + AddVolumeOutput("RES_ADJ_Velocity-Z", "Residual_Adjoint_Velocity_z", "RESIDUAL", "Residual of the adjoint z-velocity"); + /// DESCRIPTION: Residual of the adjoint energy. + AddVolumeOutput("RES_ADJ_HEAT", "Residual_Adjoint_Heat", "RESIDUAL", "Residual of the adjoint heat"); + if (!config->GetFrozen_Visc_Disc()){ + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Residual of the nu tilde. + AddVolumeOutput("RES_ADJ_NU_TILDE", "Residual_Adjoint_Nu_Tilde", "RESIDUAL", "Residual of the adjoint Spalart-Allmaras variable"); + break; + case SST: + /// DESCRIPTION: Residual of the adjoint kinetic energy. + AddVolumeOutput("RES_ADJ_TKE", "Residual_Adjoint_TKE", "RESIDUAL", "Residual of the adjoint turb. kinetic energy"); + /// DESCRIPTION: Residual of the adjoint dissipation. + AddVolumeOutput("RES_ADJ_DISSIPATION", "Residual_Adjoint_Omega", "RESIDUAL", "Residual of adjoint rate of dissipation"); + break; + default: break; + } + } + /// END_GROUP + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Geometrical sensitivities of the current objective function. + /// DESCRIPTION: Sensitivity x-component. + AddVolumeOutput("SENSITIVITY-X", "Sensitivity_x", "SENSITIVITY", "x-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity y-component. + AddVolumeOutput("SENSITIVITY-Y", "Sensitivity_y", "SENSITIVITY", "y-component of the sensitivity vector"); + if (nDim == 3) + /// DESCRIPTION: Sensitivity z-component. + AddVolumeOutput("SENSITIVITY-Z", "Sensitivity_z", "SENSITIVITY", "z-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity in normal direction. + AddVolumeOutput("SENSITIVITY", "Surface_Sensitivity", "SENSITIVITY", "sensitivity in normal direction"); + /// END_GROUP + +} + +void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_AdjFlow = solver[ADJFLOW_SOL]->node[iPoint]; + CVariable* Node_AdjHeat = NULL; + CVariable* Node_AdjTurb = NULL; + CPoint* Node_Geo = geometry->node[iPoint]; + + if (config->GetKind_Turb_Model() != NONE && !config->GetFrozen_Visc_Disc()){ + Node_AdjTurb = solver[ADJTURB_SOL]->node[iPoint]; + } + if (weakly_coupled_heat){ + Node_AdjHeat = solver[ADJHEAT_SOL]->node[iPoint]; + } + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("ADJ_PRESSURE", iPoint, Node_AdjFlow->GetSolution(0)); + SetVolumeOutputValue("ADJ_VELOCITY-X", iPoint, Node_AdjFlow->GetSolution(1)); + SetVolumeOutputValue("ADJ_VELOCITY-Y", iPoint, Node_AdjFlow->GetSolution(2)); + if (nDim == 3){ + SetVolumeOutputValue("ADJ_VELOCITY-Z", iPoint, Node_AdjFlow->GetSolution(3)); + } + + if (weakly_coupled_heat){ + SetVolumeOutputValue("ADJ_HEAT", iPoint, Node_AdjHeat->GetSolution(0)); + } + if (heat){ + if (nDim == 3) SetVolumeOutputValue("ADJ_HEAT", iPoint, Node_AdjFlow->GetSolution(4)); + else SetVolumeOutputValue("ADJ_HEAT", iPoint, Node_AdjFlow->GetSolution(3)); + } + // Turbulent + if (!config->GetFrozen_Visc_Disc()){ + switch(turb_model){ + case SST: + SetVolumeOutputValue("ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(0)); + SetVolumeOutputValue("ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(0)); + break; + case NONE: + break; + } + } + + // Residuals + SetVolumeOutputValue("RES_ADJ_PRESSURE", iPoint, Node_AdjFlow->GetSolution(0) - Node_AdjFlow->GetSolution_Old(0)); + SetVolumeOutputValue("RES_ADJ_VELOCITY-X", iPoint, Node_AdjFlow->GetSolution(1) - Node_AdjFlow->GetSolution_Old(1)); + SetVolumeOutputValue("RES_ADJ_VELOCITY-Y", iPoint, Node_AdjFlow->GetSolution(2) - Node_AdjFlow->GetSolution_Old(2)); + if (nDim == 3){ + SetVolumeOutputValue("RES_ADJ_VELOCITY-Z", iPoint, Node_AdjFlow->GetSolution(3) - Node_AdjFlow->GetSolution_Old(3)); + } + if (!config->GetFrozen_Visc_Disc()){ + switch(config->GetKind_Turb_Model()){ + case SST: + SetVolumeOutputValue("RES_ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(0) - Node_AdjTurb->GetSolution_Old(0)); + SetVolumeOutputValue("RES_ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(1) - Node_AdjTurb->GetSolution_Old(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("RES_ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(0) - Node_AdjTurb->GetSolution_Old(0)); + break; + case NONE: + break; + } + } + + SetVolumeOutputValue("SENSITIVITY-X", iPoint, Node_AdjFlow->GetSensitivity(0)); + SetVolumeOutputValue("SENSITIVITY-Y", iPoint, Node_AdjFlow->GetSensitivity(1)); + if (nDim == 3) + SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_AdjFlow->GetSensitivity(2)); + +} + +void CAdjFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ + + SetVolumeOutputValue("SENSITIVITY", iPoint, solver[ADJFLOW_SOL]->GetCSensitivity(iMarker, iVertex)); + +} + + +bool CAdjFlowIncOutput::SetInit_Residuals(CConfig *config){ + + return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == STEADY && (curTimeIter < 2)); + +} + +bool CAdjFlowIncOutput::SetUpdate_Averages(CConfig *config){ + return false; + +// return (config->GetUnsteady_Simulation() != STEADY && !dualtime); + +} + diff --git a/SU2_CFD/src/output/CAdjHeatOutput.cpp b/SU2_CFD/src/output/CAdjHeatOutput.cpp new file mode 100644 index 000000000000..feabf5c5adbd --- /dev/null +++ b/SU2_CFD/src/output/CAdjHeatOutput.cpp @@ -0,0 +1,198 @@ +/*! + * \file output_adj_heat.cpp + * \brief Main subroutines for flow discrete adjoint output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CAdjHeatOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CAdjHeatOutput::CAdjHeatOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + requestedHistoryFields.emplace_back("SENSITIVITY"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + if (nRequestedScreenFields == 0){ + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_ADJ_TEMPERATURE"); + requestedScreenFields.emplace_back("SENS_GEO"); + nRequestedScreenFields = requestedScreenFields.size(); + } + + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("SENSITIVITY"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Adj. Heat)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetAdj_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfAdjCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_AdjFileName(); + + /*--- Add the obj. function extension --- */ + + restartFilename = config->GetObjFunc_Extension(restartFilename); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_ADJ_TEMPERATURE"); + +} + +CAdjHeatOutput::~CAdjHeatOutput(void) {} + +void CAdjHeatOutput::SetHistoryOutputFields(CConfig *config){ + + /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the conservative variables. + /// DESCRIPTION: Root-mean square residual of the adjoint Pressure. + AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + /// END_GROUP + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the conservative variables. + /// DESCRIPTION: Maximum residual of the adjoint Pressure. + AddHistoryOutput("MAX_ADJ_TEMPERATURE", "max[A_T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the conservative variables. + /// DESCRIPTION: Maximum residual of the adjoint Pressure. + AddHistoryOutput("MAX_ADJ_TEMPERATURE", "max[A_T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Sensitivities of different geometrical or boundary values. + /// DESCRIPTION: Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING. + AddHistoryOutput("SENS_GEO", "Sens_Geo", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "Sum of the geometrical sensitivities on all markers set in MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// END_GROUP + +} + +void CAdjHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* adjheat_solver = solver[ADJHEAT_SOL]; + + SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_RMS(0))); + + SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_Max(0))); + + if (multiZone) + SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_BGS(0))); + + SetHistoryOutputValue("SENS_GEO", adjheat_solver->GetTotal_Sens_Geo()); + + +} + +void CAdjHeatOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + + /// BEGIN_GROUP: CONSERVATIVE, DESCRIPTION: The conservative variables of the adjoint solver. + /// DESCRIPTION: Adjoint Pressure. + AddVolumeOutput("ADJ_TEMPERATURE", "Adjoint_Temperature", "SOLUTION" ,"Adjoint Temperature"); + /// END_GROUP + + + /// BEGIN_GROUP: RESIDUAL, DESCRIPTION: Residuals of the conservative variables. + /// DESCRIPTION: Residual of the adjoint Pressure. + AddVolumeOutput("RES_ADJ_TEMPERATURE", "Residual_Adjoint_Temperature", "RESIDUAL", "Residual of the Adjoint Temperature"); + /// END_GROUP + + /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Geometrical sensitivities of the current objective function. + /// DESCRIPTION: Sensitivity x-component. + AddVolumeOutput("SENSITIVITY-X", "Sensitivity_x", "SENSITIVITY", "x-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity y-component. + AddVolumeOutput("SENSITIVITY-Y", "Sensitivity_y", "SENSITIVITY", "y-component of the sensitivity vector"); + if (nDim == 3) + /// DESCRIPTION: Sensitivity z-component. + AddVolumeOutput("SENSITIVITY-Z", "Sensitivity_z", "SENSITIVITY", "z-component of the sensitivity vector"); + /// DESCRIPTION: Sensitivity in normal direction. + AddVolumeOutput("SENSITIVITY", "Surface_Sensitivity", "SENSITIVITY", "sensitivity in normal direction"); + /// END_GROUP + +} + +void CAdjHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_AdjHeat = solver[ADJHEAT_SOL]->node[iPoint]; + CPoint* Node_Geo = geometry->node[iPoint]; + + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(0)); + + // Residuals + SetVolumeOutputValue("RES_ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(0) - Node_AdjHeat->GetSolution_Old(0)); + + SetVolumeOutputValue("SENSITIVITY-X", iPoint, Node_AdjHeat->GetSensitivity(0)); + SetVolumeOutputValue("SENSITIVITY-Y", iPoint, Node_AdjHeat->GetSensitivity(1)); + if (nDim == 3) + SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_AdjHeat->GetSensitivity(2)); + +} + +void CAdjHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ + + SetVolumeOutputValue("SENSITIVITY", iPoint, solver[ADJHEAT_SOL]->GetCSensitivity(iMarker, iVertex)); + +} + + diff --git a/SU2_CFD/src/output/CBaselineOutput.cpp b/SU2_CFD/src/output/CBaselineOutput.cpp new file mode 100644 index 000000000000..9139c03eb724 --- /dev/null +++ b/SU2_CFD/src/output/CBaselineOutput.cpp @@ -0,0 +1,126 @@ +/*! + * \file output_baseline.cpp + * \brief Main subroutines for flow discrete adjoint output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + + +#include "../../include/output/CBaselineOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CBaselineOutput::CBaselineOutput(CConfig *config, unsigned short nDim, CSolver* solver) : COutput(config, nDim, false) { + + /*--- Set the requested volume fields to all fields in the solver ---*/ + + requestedVolumeFields.clear(); + + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + + nRequestedVolumeFields = requestedVolumeFields.size(); + + /*--- Get the fields from the solver ---*/ + + fields = solver->GetSolutionFields(); + + /*--- Remove point ID ---*/ + + fields.erase(fields.begin()); + + /*--- Remove first and last character of the strings (the quotation marks) ---*/ + + for (unsigned short iField = 0; iField < fields.size(); iField++){ + fields[iField] = fields[iField].substr(1, fields[iField].size() - 2); + } + + /*--- Set the volume filename --- */ + + volumeFilename = "baseline"; + + /*--- Set the surface filename ---*/ + + surfaceFilename = "surface_baseline"; + +} + +CBaselineOutput::~CBaselineOutput(void) {} + +void CBaselineOutput::SetVolumeOutputFields(CConfig *config){ + + unsigned short iField = 0; + + /*--- The first three fields should be the coordinates, if not, something is wrong ---*/ + + if (fields[0] != "x" || fields[1] != "y"){ + SU2_MPI::Error("No coordinates found in the restart file!!", CURRENT_FUNCTION); + } + if (nDim == 3){ + if (fields[2] != "z"){ + SU2_MPI::Error("No coordinates found in the restart file!!", CURRENT_FUNCTION); + } + } + + // Grid coordinates + AddVolumeOutput(fields[0], fields[0], "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput(fields[1], fields[1], "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput(fields[2], fields[2], "COORDINATES", "z-component of the coordinate vector"); + + // Add all the remaining fields + + for (iField = nDim; iField < fields.size(); iField++){ + AddVolumeOutput(fields[iField], fields[iField], "SOLUTION",""); + } + +} + +void CBaselineOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + unsigned short iField = 0; + + if ( fields.size() != solver[0]->GetnVar()){ + SU2_MPI::Error("Number of requested fields and number of variables do not match.", CURRENT_FUNCTION); + } + + /*--- Take the solver at index 0 --- */ + + CVariable* Node_Sol = solver[0]->node[iPoint]; + + for (iField = 0; iField < fields.size(); iField++){ + SetVolumeOutputValue(fields[iField], iPoint, Node_Sol->GetSolution(iField)); + } + +} diff --git a/SU2_CFD/src/output/CElasticityOutput.cpp b/SU2_CFD/src/output/CElasticityOutput.cpp new file mode 100644 index 000000000000..9d041cb55a69 --- /dev/null +++ b/SU2_CFD/src/output/CElasticityOutput.cpp @@ -0,0 +1,250 @@ +/*! + * \file output_elasticity.cpp + * \brief Main subroutines for FEA output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CElasticityOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CElasticityOutput::CElasticityOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + linear_analysis = (config->GetGeometricConditions() == SMALL_DEFORMATIONS); // Linear analysis. + nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. + dynamic = (config->GetTime_Domain()); // Dynamic analysis. + + /*--- Initialize number of variables ---*/ + if (linear_analysis) nVar_FEM = nDim; + if (nonlinear_analysis) nVar_FEM = 3; + + /*--- Default fields for screen output ---*/ + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + /*--- Default fields for screen output ---*/ + if (nRequestedScreenFields == 0){ + if (dynamic) requestedScreenFields.emplace_back("TIME_ITER"); + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + if(linear_analysis){ + requestedScreenFields.emplace_back("RMS_DISP_X"); + requestedScreenFields.emplace_back("RMS_DISP_Y"); + requestedScreenFields.emplace_back("RMS_DISP_Z"); + } + if(nonlinear_analysis){ + requestedScreenFields.emplace_back("RMS_UTOL"); + requestedScreenFields.emplace_back("RMS_RTOL"); + requestedScreenFields.emplace_back("RMS_ETOL"); + } + requestedScreenFields.emplace_back("VMS"); + nRequestedScreenFields = requestedScreenFields.size(); + } + + /*--- Default fields for volume output ---*/ + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("STRESS"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Structure)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetVolume_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_FileName(); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_DISP_X"); + +} + +CElasticityOutput::~CElasticityOutput(void) {} + +void CElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* fea_solver = solver[FEA_SOL]; + + /*--- Residuals: ---*/ + /*--- Linear analysis: RMS of the displacements in the nDim coordinates ---*/ + /*--- Nonlinear analysis: UTOL, RTOL and DTOL (defined in the Postprocessing function) ---*/ + + + if (linear_analysis){ + SetHistoryOutputValue("RMS_DISP_X", log10(fea_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_DISP_Y", log10(fea_solver->GetRes_RMS(1))); + if (nDim == 3){ + SetHistoryOutputValue("RMS_DISP_Z", log10(fea_solver->GetRes_RMS(2))); + } + } else if (nonlinear_analysis){ + SetHistoryOutputValue("RMS_UTOL", log10(fea_solver->LinSysSol.norm())); + SetHistoryOutputValue("RMS_RTOL", log10(fea_solver->LinSysRes.norm())); + SetHistoryOutputValue("RMS_ETOL", log10(dotProd(fea_solver->LinSysSol, fea_solver->LinSysRes))); + + } + + if (multiZone){ + SetHistoryOutputValue("BGS_DISP_X", log10(fea_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_DISP_Y", log10(fea_solver->GetRes_BGS(1))); + if (nDim == 3) SetHistoryOutputValue("BGS_DISP_Z", log10(fea_solver->GetRes_BGS(2))); + } + + SetHistoryOutputValue("VMS", fea_solver->GetTotal_CFEA()); + SetHistoryOutputValue("LOAD_INCREMENT", fea_solver->GetLoad_Increment()); + SetHistoryOutputValue("LOAD_RAMP", fea_solver->GetForceCoeff()); + + SetHistoryOutputValue("LINSOL_ITER", fea_solver->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL", log10(fea_solver->GetLinSol_Residual())); + +} + +void CElasticityOutput::SetHistoryOutputFields(CConfig *config){ + + AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); + AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); + + // Residuals + + AddHistoryOutput("RMS_UTOL", "rms[U]", ScreenOutputFormat::FIXED, "RMS_RES", "", HistoryFieldType::RESIDUAL); + AddHistoryOutput("RMS_RTOL", "rms[R]", ScreenOutputFormat::FIXED, "RMS_RES", "", HistoryFieldType::RESIDUAL); + AddHistoryOutput("RMS_ETOL", "rms[E]", ScreenOutputFormat::FIXED, "RMS_RES", "", HistoryFieldType::RESIDUAL); + + AddHistoryOutput("RMS_DISP_X", "rms[DispX]", ScreenOutputFormat::FIXED, "RMS_RES", "", HistoryFieldType::RESIDUAL); + AddHistoryOutput("RMS_DISP_Y", "rms[DispY]", ScreenOutputFormat::FIXED, "RMS_RES", "", HistoryFieldType::RESIDUAL); + AddHistoryOutput("RMS_DISP_Z", "rms[DispZ]", ScreenOutputFormat::FIXED, "RMS_RES", "", HistoryFieldType::RESIDUAL); + + AddHistoryOutput("BGS_DISP_X", "bgs[DispX]", ScreenOutputFormat::FIXED, "BGS_RES", "", HistoryFieldType::RESIDUAL); + AddHistoryOutput("BGS_DISP_Y", "bgs[DispY]", ScreenOutputFormat::FIXED, "BGS_RES", "", HistoryFieldType::RESIDUAL); + AddHistoryOutput("BGS_DISP_Z", "bgs[DispZ]", ScreenOutputFormat::FIXED, "BGS_RES", "", HistoryFieldType::RESIDUAL); + + AddHistoryOutput("VMS", "VonMises", ScreenOutputFormat::SCIENTIFIC, "", "VMS"); + AddHistoryOutput("LOAD_INCREMENT", "Load_Increment", ScreenOutputFormat::FIXED, "", "LOAD_INCREMENT"); + AddHistoryOutput("LOAD_RAMP", "Load_Ramp", ScreenOutputFormat::FIXED, "", "LOAD_RAMP"); + +} + +void CElasticityOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_Struc = solver[FEA_SOL]->node[iPoint]; + CPoint* Node_Geo = geometry->node[iPoint]; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("DISPLACEMENT-X", iPoint, Node_Struc->GetSolution(0)); + SetVolumeOutputValue("DISPLACEMENT-Y", iPoint, Node_Struc->GetSolution(1)); + if (nDim == 3) SetVolumeOutputValue("DISPLACEMENT-Z", iPoint, Node_Struc->GetSolution(2)); + + if(dynamic){ + SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Struc->GetSolution_Vel(0)); + SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Struc->GetSolution_Vel(1)); + if (nDim == 3) SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Struc->GetSolution_Vel(2)); + + SetVolumeOutputValue("ACCELERATION-X", iPoint, Node_Struc->GetSolution_Accel(0)); + SetVolumeOutputValue("ACCELERATION-Y", iPoint, Node_Struc->GetSolution_Accel(1)); + if (nDim == 3) SetVolumeOutputValue("ACCELERATION-Z", iPoint, Node_Struc->GetSolution_Accel(2)); + } + + SetVolumeOutputValue("STRESS-XX", iPoint, Node_Struc->GetStress_FEM()[0]); + SetVolumeOutputValue("STRESS-YY", iPoint, Node_Struc->GetStress_FEM()[1]); + SetVolumeOutputValue("STRESS-XY", iPoint, Node_Struc->GetStress_FEM()[2]); + if (nDim == 3){ + SetVolumeOutputValue("STRESS-ZZ", iPoint, Node_Struc->GetStress_FEM()[3]); + SetVolumeOutputValue("STRESS-XZ", iPoint, Node_Struc->GetStress_FEM()[4]); + SetVolumeOutputValue("STRESS-YZ", iPoint, Node_Struc->GetStress_FEM()[5]); + } + SetVolumeOutputValue("VON_MISES_STRESS", iPoint, Node_Struc->GetVonMises_Stress()); + +} + +void CElasticityOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + AddVolumeOutput("DISPLACEMENT-X", "Displacement_x", "SOLUTION", "x-component of the displacement vector"); + AddVolumeOutput("DISPLACEMENT-Y", "Displacement_y", "SOLUTION", "y-component of the displacement vector"); + if (nDim == 3) AddVolumeOutput("DISPLACEMENT-Z", "Displacement_z", "SOLUTION", "z-component of the displacement vector"); + + if(dynamic){ + AddVolumeOutput("VELOCITY-X", "Velocity_x", "VELOCITY", "x-component of the velocity vector"); + AddVolumeOutput("VELOCITY-Y", "Velocity_y", "VELOCITY", "y-component of the velocity vector"); + if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "VELOCITY", "z-component of the velocity vector"); + + AddVolumeOutput("ACCELERATION-X", "Acceleration_x", "ACCELERATION", "x-component of the acceleration vector"); + AddVolumeOutput("ACCELERATION-Y", "Acceleration_y", "ACCELERATION", "y-component of the acceleration vector"); + if (nDim == 3) AddVolumeOutput("ACCELERATION-Z", "Acceleration_z", "ACCELERATION", "z-component of the acceleration vector"); + } + + AddVolumeOutput("STRESS-XX", "Sxx", "STRESS", "x-component of the normal stress vector"); + AddVolumeOutput("STRESS-YY", "Syy", "STRESS", "y-component of the normal stress vector"); + AddVolumeOutput("STRESS-XY", "Sxy", "STRESS", "xy shear stress component"); + + if (nDim == 3) { + AddVolumeOutput("STRESS-ZZ", "Szz", "STRESS", "z-component of the normal stress vector"); + AddVolumeOutput("STRESS-XZ", "Sxz", "STRESS", "xz shear stress component"); + AddVolumeOutput("STRESS-YZ", "Syz", "STRESS", "yz shear stress component"); + } + + AddVolumeOutput("VON_MISES_STRESS", "Von_Mises_Stress", "STRESS", "von-Mises stress"); + +} +bool CElasticityOutput::SetInit_Residuals(CConfig *config){ + + return (config->GetTime_Domain() == NO && (curInnerIter == 0)); + +} + + diff --git a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp new file mode 100644 index 000000000000..20769af8def6 --- /dev/null +++ b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp @@ -0,0 +1,331 @@ +/*! + * \file output_flow_comp_fem.cpp + * \brief Main subroutines for compressible flow output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CFlowCompFEMOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CFlowCompFEMOutput::CFlowCompFEMOutput(CConfig *config, unsigned short nDim) : CFlowOutput(config, nDim, true) { + + turb_model = config->GetKind_Turb_Model(); + + gridMovement = config->GetGrid_Movement(); + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + if (nRequestedScreenFields == 0){ + if (config->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_DENSITY"); + requestedScreenFields.emplace_back("RMS_MOMENTUM-X"); + requestedScreenFields.emplace_back("RMS_MOMENTUM-Y"); + requestedScreenFields.emplace_back("RMS_ENERGY"); + nRequestedScreenFields = requestedScreenFields.size(); + } + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("PRIMITIVE"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Comp. Fluid)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetVolume_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_FileName(); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_DENSITY"); + +} + +CFlowCompFEMOutput::~CFlowCompFEMOutput(void) {} + + + +void CFlowCompFEMOutput::SetHistoryOutputFields(CConfig *config){ + + /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. + /// DESCRIPTION: Root-mean square residual of the density. + AddHistoryOutput("RMS_DENSITY", "rms[Rho]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the momentum x-component. + AddHistoryOutput("RMS_MOMENTUM-X", "rms[RhoU]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the momentum y-component. + AddHistoryOutput("RMS_MOMENTUM-Y", "rms[RhoV]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the momentum z-component. + if (nDim == 3) AddHistoryOutput("RMS_MOMENTUM-Z", "rms[RhoW]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the energy. + AddHistoryOutput("RMS_ENERGY", "rms[RhoE]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the energy.", HistoryFieldType::RESIDUAL); + /// END_GROUP + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the density. + AddHistoryOutput("MAX_DENSITY", "max[Rho]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum square residual of the density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum x-component. + AddHistoryOutput("MAX_MOMENTUM-X", "max[RhoU]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum square residual of the momentum x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum y-component. + AddHistoryOutput("MAX_MOMENTUM-Y", "max[RhoV]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum square residual of the momentum y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum z-component. + if (nDim == 3) AddHistoryOutput("MAX_MOMENTUM-Z", "max[RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the energy. + AddHistoryOutput("MAX_ENERGY", "max[RhoE]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the energy.", HistoryFieldType::RESIDUAL); + /// END_GROUP + + /// DESCRIPTION: Linear solver iterations + AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL_ITER", "Number of iterations of the linear solver."); + + AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); + + /*--- Add analyze surface history fields --- */ + + AddAnalyzeSurfaceOutput(config); + + /*--- Add aerodynamic coefficients fields --- */ + + AddAerodynamicCoefficients(config); + +} + +void CFlowCompFEMOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + // Solution variables + AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density"); + AddVolumeOutput("MOMENTUM-X", "Momentum_x", "SOLUTION", "x-component of the momentum vector"); + AddVolumeOutput("MOMENTUM-Y", "Momentum_y", "SOLUTION", "y-component of the momentum vector"); + if (nDim == 3) + AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector"); + AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy"); + + // Primitive variables + AddVolumeOutput("PRESSURE", "Pressure", "PRIMITIVE", "Pressure"); + AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature"); + AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number"); + AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient"); + + if (config->GetKind_Solver() == FEM_NAVIER_STOKES){ + AddVolumeOutput("LAMINAR_VISCOSITY", "Laminar_Viscosity", "PRIMITIVE", "Laminar viscosity"); + } + + if (config->GetKind_Solver() == FEM_LES && (config->GetKind_SGS_Model() != IMPLICIT_LES)) { + AddVolumeOutput("EDDY_VISCOSITY", "Eddy_Viscosity", "PRIMITIVE", "Turbulent eddy viscosity"); + } +} + +void CFlowCompFEMOutput::LoadVolumeDataFEM(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iElem, unsigned long index, unsigned short dof){ + + unsigned short iDim; + + unsigned short nVar = solver[FLOW_SOL]->GetnVar(); + + /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary + geometrical information for the FEM DG solver. ---*/ + + CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + + CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); + + /*--- Get a pointer to the fluid model class from the DG-FEM solver + so that we can access the states below. ---*/ + + CFluidModel *DGFluidModel = solver[FLOW_SOL]->GetFluidModel(); + + /* Set the pointers for the solution for this element. */ + + const unsigned long offset = nVar*volElem[iElem].offsetDOFsSolLocal; + su2double *solDOFs = solver[FLOW_SOL]->GetVecSolDOFs() + offset; + + /*--- Get the conservative variables for this particular DOF. ---*/ + + const su2double *U = solDOFs+dof*nVar; + + /*--- Load the coordinate values of the solution DOFs. ---*/ + + const su2double *coor = volElem[iElem].coorSolDOFs.data() + dof*nDim; + + /*--- Prepare the primitive states. ---*/ + + const su2double DensityInv = 1.0/U[0]; + su2double vel[3], Velocity2 = 0.0; + for(iDim=0; iDimSetTDState_rhoe(U[0], StaticEnergy); + + + SetVolumeOutputValue("COORD-X", index, coor[0]); + SetVolumeOutputValue("COORD-Y", index, coor[1]); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", index, coor[2]); + SetVolumeOutputValue("DENSITY", index, U[0]); + SetVolumeOutputValue("MOMENTUM-X", index, U[1]); + SetVolumeOutputValue("MOMENTUM-Y", index, U[2]); + if (nDim == 3){ + SetVolumeOutputValue("MOMENTUM-Z", index, U[3]); + SetVolumeOutputValue("ENERGY", index, U[4]); + } else { + SetVolumeOutputValue("ENERGY", index, U[3]); + } + + SetVolumeOutputValue("PRESSURE", index, DGFluidModel->GetPressure()); + SetVolumeOutputValue("TEMPERATURE", index, DGFluidModel->GetTemperature()); + SetVolumeOutputValue("MACH", index, sqrt(Velocity2)/DGFluidModel->GetSoundSpeed()); + SetVolumeOutputValue("PRESSURE_COEFF", index, DGFluidModel->GetCp()); + + if (config->GetKind_Solver() == FEM_NAVIER_STOKES){ + SetVolumeOutputValue("LAMINAR_VISCOSITY", index, DGFluidModel->GetLaminarViscosity()); + } + if ((config->GetKind_Solver() == FEM_LES) && (config->GetKind_SGS_Model() != IMPLICIT_LES)){ + // todo: Export Eddy instead of Laminar viscosity + SetVolumeOutputValue("EDDY_VISCOSITY", index, DGFluidModel->GetLaminarViscosity()); + } +} + +void CFlowCompFEMOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ + + +} + +void CFlowCompFEMOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* flow_solver = solver[FLOW_SOL]; + + SetHistoryOutputValue("RMS_DENSITY", log10(flow_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_MOMENTUM-X", log10(flow_solver->GetRes_RMS(1))); + SetHistoryOutputValue("RMS_MOMENTUM-Y", log10(flow_solver->GetRes_RMS(2))); + if (nDim == 2) + SetHistoryOutputValue("RMS_ENERGY", log10(flow_solver->GetRes_RMS(3))); + else { + SetHistoryOutputValue("RMS_MOMENTUM-Z", log10(flow_solver->GetRes_RMS(3))); + SetHistoryOutputValue("RMS_ENERGY", log10(flow_solver->GetRes_RMS(4))); + } + + + SetHistoryOutputValue("MAX_DENSITY", log10(flow_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_MOMENTUM-X", log10(flow_solver->GetRes_Max(1))); + SetHistoryOutputValue("MAX_MOMENTUM-Y", log10(flow_solver->GetRes_Max(2))); + if (nDim == 2) + SetHistoryOutputValue("MAX_ENERGY", log10(flow_solver->GetRes_Max(3))); + else { + SetHistoryOutputValue("MAX_MOMENTUM-Z", log10(flow_solver->GetRes_Max(3))); + SetHistoryOutputValue("MAX_ENERGY", log10(flow_solver->GetRes_Max(4))); + } + + SetHistoryOutputValue("AOA", config->GetAoA()); + SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver()); + SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + + /*--- Set the analyse surface history values --- */ + + SetAnalyzeSurface(flow_solver, geometry, config, false); + + /*--- Set aeroydnamic coefficients --- */ + + SetAerodynamicCoefficients(config, flow_solver); + +} + +su2double CFlowCompFEMOutput::GetQ_Criterion(CConfig *config, CGeometry *geometry, CVariable* node_flow){ + + unsigned short iDim, jDim; + su2double Grad_Vel[3][3] = {{0.0, 0.0, 0.0},{0.0, 0.0, 0.0},{0.0, 0.0, 0.0}}; + su2double Omega[3][3] = {{0.0, 0.0, 0.0},{0.0, 0.0, 0.0},{0.0, 0.0, 0.0}}; + su2double Strain[3][3] = {{0.0, 0.0, 0.0},{0.0, 0.0, 0.0},{0.0, 0.0, 0.0}}; + for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short jDim = 0 ; jDim < nDim; jDim++) { + Grad_Vel[iDim][jDim] = node_flow->GetGradient_Primitive(iDim+1, jDim); + Strain[iDim][jDim] = 0.5*(Grad_Vel[iDim][jDim] + Grad_Vel[jDim][iDim]); + Omega[iDim][jDim] = 0.5*(Grad_Vel[iDim][jDim] - Grad_Vel[jDim][iDim]); + } + } + + su2double OmegaMag = 0.0, StrainMag = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + for (jDim = 0 ; jDim < nDim; jDim++) { + StrainMag += Strain[iDim][jDim]*Strain[iDim][jDim]; + OmegaMag += Omega[iDim][jDim]*Omega[iDim][jDim]; + } + } + StrainMag = sqrt(StrainMag); OmegaMag = sqrt(OmegaMag); + + su2double Q = 0.5*(OmegaMag - StrainMag); + + return Q; +} + + +bool CFlowCompFEMOutput::SetInit_Residuals(CConfig *config){ + + return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == STEADY && (curTimeIter < 2)); + +} + +bool CFlowCompFEMOutput::SetUpdate_Averages(CConfig *config){ + return false; + +// return (config->GetUnsteady_Simulation() != STEADY && !dualtime); + +} + + diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp new file mode 100644 index 000000000000..8d22c4faddc0 --- /dev/null +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -0,0 +1,693 @@ +/*! + * \file output_flow_comp.cpp + * \brief Main subroutines for compressible flow output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CFlowCompOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CFlowCompOutput::CFlowCompOutput(CConfig *config, unsigned short nDim) : CFlowOutput(config, nDim, false) { + + turb_model = config->GetKind_Turb_Model(); + + gridMovement = config->GetGrid_Movement(); + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + if (nRequestedScreenFields == 0){ + if (config->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_DENSITY"); + requestedScreenFields.emplace_back("RMS_MOMENTUM-X"); + requestedScreenFields.emplace_back("RMS_MOMENTUM-Y"); + requestedScreenFields.emplace_back("RMS_ENERGY"); + nRequestedScreenFields = requestedScreenFields.size(); + } + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("PRIMITIVE"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Comp. Fluid)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetVolume_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_FileName(); + + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_DENSITY"); + +} + +CFlowCompOutput::~CFlowCompOutput(void) {} + + + +void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ + + + /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. + /// DESCRIPTION: Root-mean square residual of the density. + AddHistoryOutput("RMS_DENSITY", "rms[Rho]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the momentum x-component. + AddHistoryOutput("RMS_MOMENTUM-X", "rms[RhoU]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the momentum y-component. + AddHistoryOutput("RMS_MOMENTUM-Y", "rms[RhoV]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the momentum z-component. + if (nDim == 3) AddHistoryOutput("RMS_MOMENTUM-Z", "rms[RhoW]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the energy. + AddHistoryOutput("RMS_ENERGY", "rms[RhoE]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the energy.", HistoryFieldType::RESIDUAL); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). + AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + break; + case SST: case SST_SUST: + /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). + AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). + AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + break; + default: break; + } + /// END_GROUP + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the density. + AddHistoryOutput("MAX_DENSITY", "max[Rho]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum square residual of the density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum x-component. + AddHistoryOutput("MAX_MOMENTUM-X", "max[RhoU]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum square residual of the momentum x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum y-component. + AddHistoryOutput("MAX_MOMENTUM-Y", "max[RhoV]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum square residual of the momentum y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum z-component. + if (nDim == 3) AddHistoryOutput("MAX_MOMENTUM-Z", "max[RhoW]", ScreenOutputFormat::FIXED,"MAX_RES", "Maximum residual of the z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the energy. + AddHistoryOutput("MAX_ENERGY", "max[RhoE]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the energy.", HistoryFieldType::RESIDUAL); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + break; + case SST: case SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + break; + default: break; + } + /// END_GROUP + + /// BEGIN_GROUP: BGS_RES, DESCRIPTION: The block Gauss Seidel residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the density. + AddHistoryOutput("BGS_DENSITY", "bgs[Rho]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the density.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum x-component. + AddHistoryOutput("BGS_MOMENTUM-X", "bgs[RhoU]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the momentum x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum y-component. + AddHistoryOutput("BGS_MOMENTUM-Y", "bgs[RhoV]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the momentum y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the momentum z-component. + if (nDim == 3) AddHistoryOutput("BGS_MOMENTUM-Z", "bgs[RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the energy. + AddHistoryOutput("BGS_ENERGY", "bgs[RhoE]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the energy.", HistoryFieldType::RESIDUAL); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + break; + case SST: case SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + break; + default: break; + } + /// END_GROUP + + vector Marker_Monitoring; + for (unsigned short iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++){ + Marker_Monitoring.push_back(config->GetMarker_Monitoring_TagBound(iMarker_Monitoring)); + } + /// BEGIN_GROUP: AEROELASTIC, DESCRIPTION: Aeroelastic plunge, pitch + /// DESCRIPTION: Aeroelastic plunge + AddHistoryOutputPerSurface("PLUNGE", "plunge", ScreenOutputFormat::FIXED, "AEROELASTIC", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Aeroelastic pitch + AddHistoryOutputPerSurface("PITCH", "pitch", ScreenOutputFormat::FIXED, "AEROELASTIC", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// END_GROUP + + + /// DESCRIPTION: Linear solver iterations + AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); + AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); + + /// BEGIN_GROUP: ENGINE_OUTPUT, DESCRIPTION: Engine output + /// DESCRIPTION: Aero CD drag + AddHistoryOutput("AEROCDRAG", "AeroCDrag", ScreenOutputFormat::SCIENTIFIC, "ENGINE_OUTPUT", "Aero CD drag", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Solid CD drag + AddHistoryOutput("SOLIDCDRAG", "SolidCDrag", ScreenOutputFormat::SCIENTIFIC, "ENGINE_OUTPUT", "Solid CD drag ", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Radial distortion + AddHistoryOutput("RADIAL_DISTORTION", "Radial_Distortion", ScreenOutputFormat::SCIENTIFIC, "ENGINE_OUTPUT", "Radial distortion ", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Circumferential distortion + AddHistoryOutput("CIRCUMFERENTIAL_DISTORTION", "Circumferential_Distortion", ScreenOutputFormat::SCIENTIFIC, "ENGINE_OUTPUT", "Circumferential distortion", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + /// BEGIN_GROUP: ROTATING_FRAME, DESCRIPTION: Coefficients related to a rotating frame of reference. + /// DESCRIPTION: Merit + AddHistoryOutput("MERIT", "CMerit", ScreenOutputFormat::SCIENTIFIC, "ROTATING_FRAME", "Merit", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: CT + AddHistoryOutput("CT", "CT", ScreenOutputFormat::SCIENTIFIC, "ROTATING_FRAME", "CT", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: CQ + AddHistoryOutput("CQ", "CQ", ScreenOutputFormat::SCIENTIFIC, "ROTATING_FRAME", "CQ", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + /// BEGIN_GROUP: EQUIVALENT_AREA, DESCRIPTION: Equivalent area. + /// DESCRIPTION: Equivalent area + AddHistoryOutput("EQUIV_AREA", "CEquiv_Area", ScreenOutputFormat::SCIENTIFIC, "EQUIVALENT_AREA", "Equivalent area", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Nearfield obj. function + AddHistoryOutput("NEARFIELD_OF", "CNearFieldOF", ScreenOutputFormat::SCIENTIFIC, "EQUIVALENT_AREA", "Nearfield obj. function ", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + /// /// BEGIN_GROUP: HEAT_COEFF, DESCRIPTION: Heat coefficients on all surfaces set with MARKER_MONITORING. + /// DESCRIPTION: Total heatflux + AddHistoryOutput("HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Maximal heatflux + AddHistoryOutput("HEATFLUX_MAX", "maxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total maximum heatflux on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Temperature + AddHistoryOutput("TEMPERATURE", "Temp", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total avg. temperature on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); + + if (config->GetDeform_Mesh()){ + AddHistoryOutput("DEFORM_MIN_VOLUME", "MinVolume", ScreenOutputFormat::SCIENTIFIC, "DEFORM", "Minimum volume in the mesh"); + AddHistoryOutput("DEFORM_MAX_VOLUME", "MaxVolume", ScreenOutputFormat::SCIENTIFIC, "DEFORM", "Maximum volume in the mesh"); + AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation"); + AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation"); + } + + /*--- Add analyze surface history fields --- */ + + AddAnalyzeSurfaceOutput(config); + + /*--- Add aerodynamic coefficients fields --- */ + + AddAerodynamicCoefficients(config); + + /*--- Add Cp diff fields ---*/ + + Add_CpInverseDesignOutput(config); + + /*--- Add combo obj value --- */ + + AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); +} + +void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + // Solution variables + AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density"); + AddVolumeOutput("MOMENTUM-X", "Momentum_x", "SOLUTION", "x-component of the momentum vector"); + AddVolumeOutput("MOMENTUM-Y", "Momentum_y", "SOLUTION", "y-component of the momentum vector"); + if (nDim == 3) + AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector"); + AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy"); + + // Turbulent Residuals + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); + AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart-Allmaras variable"); + break; + case NONE: + break; + } + + // Grid velocity + if (config->GetGrid_Movement()){ + AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); + AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); + if (nDim == 3 ) + AddVolumeOutput("GRID_VELOCITY-Z", "Grid_Velocity_z", "GRID_VELOCITY", "z-component of the grid velocity vector"); + } + + // Primitive variables + AddVolumeOutput("PRESSURE", "Pressure", "PRIMITIVE", "Pressure"); + AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature"); + AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number"); + AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient"); + + if (config->GetKind_Solver() == RANS || config->GetKind_Solver() == NAVIER_STOKES){ + AddVolumeOutput("LAMINAR_VISCOSITY", "Laminar_Viscosity", "PRIMITIVE", "Laminar viscosity"); + + AddVolumeOutput("SKIN_FRICTION-X", "Skin_Friction_Coefficient_x", "PRIMITIVE", "x-component of the skin friction vector"); + AddVolumeOutput("SKIN_FRICTION-Y", "Skin_Friction_Coefficient_y", "PRIMITIVE", "y-component of the skin friction vector"); + if (nDim == 3) + AddVolumeOutput("SKIN_FRICTION-Z", "Skin_Friction_Coefficient_z", "PRIMITIVE", "z-component of the skin friction vector"); + + AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); + AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); + + } + + if (config->GetKind_Solver() == RANS) { + AddVolumeOutput("EDDY_VISCOSITY", "Eddy_Viscosity", "PRIMITIVE", "Turbulent eddy viscosity"); + } + + if (config->GetKind_Trans_Model() == BC){ + AddVolumeOutput("INTERMITTENCY", "gamma_BC", "INTERMITTENCY", "Intermittency"); + } + + //Residuals + AddVolumeOutput("RES_DENSITY", "Residual_Pressure", "RESIDUAL", "Residual of the density"); + AddVolumeOutput("RES_MOMENTUM-X", "Residual_Momentum_x", "RESIDUAL", "Residual of the x-momentum component"); + AddVolumeOutput("RES_MOMENTUM-Y", "Residual_Momentum_y", "RESIDUAL", "Residual of the y-momentum component"); + if (nDim == 3) + AddVolumeOutput("RES_MOMENTUM-Z", "Residual_Momentum_z", "RESIDUAL", "Residual of the z-momentum component"); + AddVolumeOutput("RES_ENERGY", "Residual_Energy", "RESIDUAL", "Residual of the energy"); + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("RES_TKE", "Residual_TKE", "RESIDUAL", "Residual of turbulent kinetic energy"); + AddVolumeOutput("RES_DISSIPATION", "Residual_Omega", "RESIDUAL", "Residual of the rate of dissipation"); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); + break; + case NONE: + break; + } + + // Limiter values + AddVolumeOutput("LIMITER_DENSITY", "Limiter_Density", "LIMITER", "Limiter value of the density"); + AddVolumeOutput("LIMITER_MOMENTUM-X", "Limiter_Momentum_x", "LIMITER", "Limiter value of the x-momentum"); + AddVolumeOutput("LIMITER_MOMENTUM-Y", "Limiter_Momentum_y", "LIMITER", "Limiter value of the y-momentum"); + if (nDim == 3) + AddVolumeOutput("LIMITER_MOMENTUM-Z", "Limiter_Momentum_z", "LIMITER", "Limiter value of the z-momentum"); + AddVolumeOutput("LIMITER_ENERGY", "Limiter_Energy", "LIMITER", "Limiter value of the energy"); + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); + AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); + break; + case NONE: + break; + } + + + // Hybrid RANS-LES + if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ + AddVolumeOutput("DES_LENGTHSCALE", "DES_LengthScale", "DDES", "DES length scale value"); + AddVolumeOutput("WALL_DISTANCE", "Wall_Distance", "DDES", "Wall distance value"); + } + + // Roe Low Dissipation + if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ + AddVolumeOutput("ROE_DISSIPATION", "Roe_Dissipation", "ROE_DISSIPATION", "Value of the Roe dissipation"); + } + + if(config->GetKind_Solver() == RANS || config->GetKind_Solver() == NAVIER_STOKES){ + if (nDim == 3){ + AddVolumeOutput("VORTICITY_X", "Vorticity_x", "VORTEX_IDENTIFICATION", "x-component of the vorticity vector"); + AddVolumeOutput("VORTICITY_Y", "Vorticity_y", "VORTEX_IDENTIFICATION", "y-component of the vorticity vector"); + AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); + } + AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); + } + + if (config->GetTime_Domain()){ + SetTimeAveragedFields(); + } +} + +void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_Flow = solver[FLOW_SOL]->node[iPoint]; + CVariable* Node_Turb = NULL; + + if (config->GetKind_Turb_Model() != NONE){ + Node_Turb = solver[TURB_SOL]->node[iPoint]; + } + + CPoint* Node_Geo = geometry->node[iPoint]; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("DENSITY", iPoint, Node_Flow->GetSolution(0)); + SetVolumeOutputValue("MOMENTUM-X", iPoint, Node_Flow->GetSolution(1)); + SetVolumeOutputValue("MOMENTUM-Y", iPoint, Node_Flow->GetSolution(2)); + if (nDim == 3){ + SetVolumeOutputValue("MOMENTUM-Z", iPoint, Node_Flow->GetSolution(3)); + SetVolumeOutputValue("ENERGY", iPoint, Node_Flow->GetSolution(4)); + } else { + SetVolumeOutputValue("ENERGY", iPoint, Node_Flow->GetSolution(3)); + } + + // Turbulent Residuals + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(0)); + SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("NU_TILDE", iPoint, Node_Turb->GetSolution(0)); + break; + case NONE: + break; + } + + if (config->GetGrid_Movement()){ + SetVolumeOutputValue("GRID_VELOCITY-X", iPoint, Node_Geo->GetGridVel()[0]); + SetVolumeOutputValue("GRID_VELOCITY-Y", iPoint, Node_Geo->GetGridVel()[1]); + if (nDim == 3) + SetVolumeOutputValue("GRID_VELOCITY-Z", iPoint, Node_Geo->GetGridVel()[2]); + } + + SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetPressure()); + SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetTemperature()); + SetVolumeOutputValue("MACH", iPoint, sqrt(Node_Flow->GetVelocity2())/Node_Flow->GetSoundSpeed()); + su2double VelMag = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++){ + VelMag += solver[FLOW_SOL]->GetVelocity_Inf(iDim)*solver[FLOW_SOL]->GetVelocity_Inf(iDim); + } + su2double factor = 1.0/(0.5*solver[FLOW_SOL]->GetDensity_Inf()*VelMag); + SetVolumeOutputValue("PRESSURE_COEFF", iPoint, (Node_Flow->GetPressure() - solver[FLOW_SOL]->GetPressure_Inf())*factor); + + if (config->GetKind_Solver() == RANS || config->GetKind_Solver() == NAVIER_STOKES){ + SetVolumeOutputValue("LAMINAR_VISCOSITY", iPoint, Node_Flow->GetLaminarViscosity()); + } + + if (config->GetKind_Solver() == RANS) { + SetVolumeOutputValue("EDDY_VISCOSITY", iPoint, Node_Flow->GetEddyViscosity()); + } + + if (config->GetKind_Trans_Model() == BC){ + SetVolumeOutputValue("INTERMITTENCY", iPoint, Node_Turb->GetGammaBC()); + } + + SetVolumeOutputValue("RES_DENSITY", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 0)); + SetVolumeOutputValue("RES_MOMENTUM-X", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 1)); + SetVolumeOutputValue("RES_MOMENTUM-Y", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 2)); + if (nDim == 3){ + SetVolumeOutputValue("RES_MOMENTUM-Z", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 3)); + SetVolumeOutputValue("RES_ENERGY", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 4)); + } else { + SetVolumeOutputValue("RES_ENERGY", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 3)); + } + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("RES_TKE", iPoint, solver[TURB_SOL]->LinSysRes.GetBlock(iPoint, 0)); + SetVolumeOutputValue("RES_DISSIPATION", iPoint, solver[TURB_SOL]->LinSysRes.GetBlock(iPoint, 1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("RES_NU_TILDE", iPoint, solver[TURB_SOL]->LinSysRes.GetBlock(iPoint, 0)); + break; + case NONE: + break; + } + + SetVolumeOutputValue("LIMITER_DENSITY", iPoint, Node_Flow->GetLimiter_Primitive(0)); + SetVolumeOutputValue("LIMITER_MOMENTUM-X", iPoint, Node_Flow->GetLimiter_Primitive(1)); + SetVolumeOutputValue("LIMITER_MOMENTUM-Y", iPoint, Node_Flow->GetLimiter_Primitive(2)); + if (nDim == 3){ + SetVolumeOutputValue("LIMITER_MOMENTUM-Z", iPoint, Node_Flow->GetLimiter_Primitive(3)); + SetVolumeOutputValue("LIMITER_ENERGY", iPoint, Node_Flow->GetLimiter_Primitive(4)); + } else { + SetVolumeOutputValue("LIMITER_ENERGY", iPoint, Node_Flow->GetLimiter_Primitive(3)); + } + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter_Primitive(0)); + SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter_Primitive(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter_Primitive(0)); + break; + case NONE: + break; + } + + if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ + SetVolumeOutputValue("DES_LENGTHSCALE", iPoint, Node_Flow->GetDES_LengthScale()); + SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance()); + } + + if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ + SetVolumeOutputValue("ROE_DISSIPATION", iPoint, Node_Flow->GetRoe_Dissipation()); + } + + if(config->GetKind_Solver() == RANS || config->GetKind_Solver() == NAVIER_STOKES){ + if (nDim == 3){ + SetVolumeOutputValue("VORTICITY_X", iPoint, Node_Flow->GetVorticity()[0]); + SetVolumeOutputValue("VORTICITY_Y", iPoint, Node_Flow->GetVorticity()[1]); + SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(config, geometry, Node_Flow)); + } + SetVolumeOutputValue("VORTICITY_Z", iPoint, Node_Flow->GetVorticity()[2]); + } + + if (config->GetTime_Domain()){ + LoadTimeAveragedData(iPoint, Node_Flow); + } +} + +void CFlowCompOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ + + if ((config->GetKind_Solver() == NAVIER_STOKES) || (config->GetKind_Solver() == RANS)) { + SetVolumeOutputValue("SKIN_FRICTION-X", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 0)); + SetVolumeOutputValue("SKIN_FRICTION-Y", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 1)); + if (nDim == 3) + SetVolumeOutputValue("SKIN_FRICTION-Z", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 2)); + + SetVolumeOutputValue("HEAT_FLUX", iPoint, solver[FLOW_SOL]->GetHeatFlux(iMarker, iVertex)); + SetVolumeOutputValue("Y_PLUS", iPoint, solver[FLOW_SOL]->GetYPlus(iMarker, iVertex)); + } +} + +void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* flow_solver = solver[FLOW_SOL]; + CSolver* turb_solver = solver[TURB_SOL]; + CSolver* mesh_solver = solver[MESH_SOL]; + + SetHistoryOutputValue("RMS_DENSITY", log10(flow_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_MOMENTUM-X", log10(flow_solver->GetRes_RMS(1))); + SetHistoryOutputValue("RMS_MOMENTUM-Y", log10(flow_solver->GetRes_RMS(2))); + if (nDim == 2) + SetHistoryOutputValue("RMS_ENERGY", log10(flow_solver->GetRes_RMS(3))); + else { + SetHistoryOutputValue("RMS_MOMENTUM-Z", log10(flow_solver->GetRes_RMS(3))); + SetHistoryOutputValue("RMS_ENERGY", log10(flow_solver->GetRes_RMS(4))); + } + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("RMS_NU_TILDE", log10(turb_solver->GetRes_RMS(0))); + break; + case SST: case SST_SUST: + SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); + break; + default: break; + } + + SetHistoryOutputValue("MAX_DENSITY", log10(flow_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_MOMENTUM-X", log10(flow_solver->GetRes_Max(1))); + SetHistoryOutputValue("MAX_MOMENTUM-Y", log10(flow_solver->GetRes_Max(2))); + if (nDim == 2) + SetHistoryOutputValue("MAX_ENERGY", log10(flow_solver->GetRes_Max(3))); + else { + SetHistoryOutputValue("MAX_MOMENTUM-Z", log10(flow_solver->GetRes_Max(3))); + SetHistoryOutputValue("MAX_ENERGY", log10(flow_solver->GetRes_Max(4))); + } + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("MAX_NU_TILDE", log10(turb_solver->GetRes_Max(0))); + break; + case SST: case SST_SUST: + SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); + break; + default: break; + } + + if (multiZone){ + SetHistoryOutputValue("BGS_DENSITY", log10(flow_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_MOMENTUM-X", log10(flow_solver->GetRes_BGS(1))); + SetHistoryOutputValue("BGS_MOMENTUM-Y", log10(flow_solver->GetRes_BGS(2))); + if (nDim == 2) + SetHistoryOutputValue("BGS_ENERGY", log10(flow_solver->GetRes_BGS(3))); + else { + SetHistoryOutputValue("BGS_MOMENTUM-Z", log10(flow_solver->GetRes_BGS(3))); + SetHistoryOutputValue("BGS_ENERGY", log10(flow_solver->GetRes_BGS(4))); + } + + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); + break; + case SST: + SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); + break; + default: break; + } + } + + SetHistoryOutputValue("HEATFLUX", flow_solver->GetTotal_HeatFlux()); + SetHistoryOutputValue("HEATFLUX_MAX", flow_solver->GetTotal_MaxHeatFlux()); + SetHistoryOutputValue("TEMPERATURE", flow_solver->GetTotal_AvgTemperature()); + + SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + + SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL", log10(flow_solver->GetLinSol_Residual())); + + if (config->GetDeform_Mesh()){ + SetHistoryOutputValue("DEFORM_MIN_VOLUME", mesh_solver->GetMinimum_Volume()); + SetHistoryOutputValue("DEFORM_MAX_VOLUME", mesh_solver->GetMaximum_Volume()); + SetHistoryOutputValue("DEFORM_ITER", mesh_solver->GetIterLinSolver()); + SetHistoryOutputValue("DEFORM_RESIDUAL", log10(mesh_solver->GetLinSol_Residual())); + } + + /*--- Set the analyse surface history values --- */ + + SetAnalyzeSurface(flow_solver, geometry, config, false); + + /*--- Set aeroydnamic coefficients --- */ + + SetAerodynamicCoefficients(config, flow_solver); + + /*--- Set Cp diff fields ---*/ + + Set_CpInverseDesign(flow_solver, geometry, config); + + /*--- Set combo obj value --- */ + + SetHistoryOutputValue("COMBO", flow_solver->GetTotal_ComboObj()); + +} + +su2double CFlowCompOutput::GetQ_Criterion(CConfig *config, CGeometry *geometry, CVariable* node_flow){ + + unsigned short iDim; + su2double Grad_Vel[3][3] = {{0.0, 0.0, 0.0},{0.0, 0.0, 0.0},{0.0, 0.0, 0.0}}; + + for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short jDim = 0 ; jDim < nDim; jDim++) { + Grad_Vel[iDim][jDim] = node_flow->GetGradient_Primitive(iDim+1, jDim); + } + } + + su2double s11 = Grad_Vel[0][0]; + su2double s12 = 0.5 * (Grad_Vel[0][1] + Grad_Vel[1][0]); + su2double s13 = 0.5 * (Grad_Vel[0][2] + Grad_Vel[2][0]); + su2double s22 = Grad_Vel[1][1]; + su2double s23 = 0.5 * (Grad_Vel[1][2] + Grad_Vel[2][1]); + su2double s33 = Grad_Vel[2][2]; + su2double omega12 = 0.5 * (Grad_Vel[0][1] - Grad_Vel[1][0]); + su2double omega13 = 0.5 * (Grad_Vel[0][2] - Grad_Vel[2][0]); + su2double omega23 = 0.5 * (Grad_Vel[1][2] - Grad_Vel[2][1]); + + su2double Q = 2. * pow( omega12, 2.) + 2. * pow( omega13, 2.) + 2. * pow( omega23, 2.) - \ + pow( s11, 2.) - pow( s22, 2.) - pow( s33, 2.0) - 2. * pow( s12, 2.) - 2. * pow( s13, 2.) - 2. * pow( s23, 2.0); + + return Q; +} + + +bool CFlowCompOutput::SetInit_Residuals(CConfig *config){ + + return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == STEADY && (curInnerIter < 2)); + +} + +bool CFlowCompOutput::SetUpdate_Averages(CConfig *config){ + + return (config->GetTime_Marching() != STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); + +} + + diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp new file mode 100644 index 000000000000..87633de48fae --- /dev/null +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -0,0 +1,642 @@ +/*! + * \file output_flow_inc.cpp + * \brief Main subroutines for incompressible flow output + * \author R. Sanchez + * \version 6.0.1 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CFlowIncOutput.hpp" + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutput(config, nDim, false) { + + turb_model = config->GetKind_Turb_Model(); + + heat = config->GetEnergy_Equation(); + + weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + if (nRequestedScreenFields == 0){ + if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_PRESSURE"); + requestedScreenFields.emplace_back("RMS_VELOCITY-X"); + requestedScreenFields.emplace_back("RMS_VELOCITY-Y"); + nRequestedScreenFields = requestedScreenFields.size(); + } + + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + requestedVolumeFields.emplace_back("PRIMITIVE"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Incomp. Fluid)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetVolume_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_FileName(); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_PRESSURE"); + + +} + +CFlowIncOutput::~CFlowIncOutput(void) {} + + +void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ + + /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. + /// DESCRIPTION: Root-mean square residual of the pressure. + AddHistoryOutput("RMS_PRESSURE", "rms[P]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the pressure.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the velocity x-component. + AddHistoryOutput("RMS_VELOCITY-X", "rms[U]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the velocity x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the velocity y-component. + AddHistoryOutput("RMS_VELOCITY-Y", "rms[V]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the velocity y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the velocity z-component. + if (nDim == 3) AddHistoryOutput("RMS_VELOCITY-Z", "rms[W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the velocity z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the temperature. + if (heat || weakly_coupled_heat) AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). + AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + break; + case SST: case SST_SUST: + /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). + AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). + AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + break; + default: break; + } + /// END_GROUP + + /// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the pressure. + AddHistoryOutput("MAX_PRESSURE", "max[P]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the pressure.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the velocity x-component. + AddHistoryOutput("MAX_VELOCITY-X", "max[U]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the velocity x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the velocity y-component. + AddHistoryOutput("MAX_VELOCITY-Y", "max[V]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the velocity y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the velocity z-component. + if (nDim == 3) + AddHistoryOutput("MAX_VELOCITY-Z", "max[W]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the velocity z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the temperature. + if (heat || weakly_coupled_heat) + AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + break; + case SST: case SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + break; + default: break; + } + /// END_GROUP + + /// BEGIN_GROUP: BGS_RES, DESCRIPTION: The block-gauss seidel residuals of the SOLUTION variables. + /// DESCRIPTION: Maximum residual of the pressure. + AddHistoryOutput("BGS_PRESSURE", "bgs[P]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the pressure.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the velocity x-component. + AddHistoryOutput("BGS_VELOCITY-X", "bgs[U]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the velocity x-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the velocity y-component. + AddHistoryOutput("BGS_VELOCITY-Y", "bgs[V]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the velocity y-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the velocity z-component. + if (nDim == 3) + AddHistoryOutput("BGS_VELOCITY-Z", "bgs[W]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the velocity z-component.", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the temperature. + if (heat || weakly_coupled_heat) + AddHistoryOutput("BGS_TEMPERATURE", "bgs[T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the temperature.", HistoryFieldType::RESIDUAL); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + break; + case SST: case SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + break; + default: break; + } + /// END_GROUP + + /// BEGIN_GROUP: HEAT_COEFF, DESCRIPTION: Heat coefficients on all surfaces set with MARKER_MONITORING. + /// DESCRIPTION: Total heatflux + AddHistoryOutput("HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Maximal heatflux + AddHistoryOutput("HEATFLUX_MAX", "maxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total maximum heatflux on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Temperature + AddHistoryOutput("TEMPERATURE", "Temp", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total avg. temperature on all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + /// DESCRIPTION: Angle of attack + AddHistoryOutput("AOA", "AoA", ScreenOutputFormat::SCIENTIFIC,"AOA", "Angle of attack"); + /// DESCRIPTION: Linear solver iterations + AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); + AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); + AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); + + if (config->GetDeform_Mesh()){ + AddHistoryOutput("DEFORM_MIN_VOLUME", "MinVolume", ScreenOutputFormat::SCIENTIFIC, "DEFORM", "Minimum volume in the mesh"); + AddHistoryOutput("DEFORM_MAX_VOLUME", "MaxVolume", ScreenOutputFormat::SCIENTIFIC, "DEFORM", "Maximum volume in the mesh"); + AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation"); + AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation"); + } + + /*--- Add analyze surface history fields --- */ + + AddAnalyzeSurfaceOutput(config); + + /*--- Add aerodynamic coefficients fields --- */ + + AddAerodynamicCoefficients(config); + +} + +void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* flow_solver = solver[FLOW_SOL]; + CSolver* turb_solver = solver[TURB_SOL]; + CSolver* heat_solver = solver[HEAT_SOL]; + CSolver* mesh_solver = solver[MESH_SOL]; + + SetHistoryOutputValue("RMS_PRESSURE", log10(flow_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_VELOCITY-X", log10(flow_solver->GetRes_RMS(1))); + SetHistoryOutputValue("RMS_VELOCITY-Y", log10(flow_solver->GetRes_RMS(2))); + if (nDim == 3) SetHistoryOutputValue("RMS_VELOCITY-Z", log10(flow_solver->GetRes_RMS(3))); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("RMS_NU_TILDE", log10(turb_solver->GetRes_RMS(0))); + break; + case SST: case SST_SUST: + SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); + SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); + break; + } + + SetHistoryOutputValue("MAX_PRESSURE", log10(flow_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_VELOCITY-X", log10(flow_solver->GetRes_Max(1))); + SetHistoryOutputValue("MAX_VELOCITY-Y", log10(flow_solver->GetRes_Max(2))); + if (nDim == 3) SetHistoryOutputValue("RMS_VELOCITY-Z", log10(flow_solver->GetRes_Max(3))); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("MAX_NU_TILDE", log10(turb_solver->GetRes_Max(0))); + break; + case SST: case SST_SUST: + SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); + SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); + break; + } + + if (multiZone){ + SetHistoryOutputValue("BGS_PRESSURE", log10(flow_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_VELOCITY-X", log10(flow_solver->GetRes_BGS(1))); + SetHistoryOutputValue("BGS_VELOCITY-Y", log10(flow_solver->GetRes_BGS(2))); + if (nDim == 3) SetHistoryOutputValue("BGS_VELOCITY-Z", log10(flow_solver->GetRes_BGS(3))); + + switch(turb_model){ + case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); + break; + case SST: + SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); + SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); + break; + } + } + + if (weakly_coupled_heat){ + SetHistoryOutputValue("HEATFLUX", heat_solver->GetTotal_HeatFlux()); + SetHistoryOutputValue("HEATFLUX_MAX", heat_solver->GetTotal_MaxHeatFlux()); + SetHistoryOutputValue("TEMPERATURE", heat_solver->GetTotal_AvgTemperature()); + SetHistoryOutputValue("RMS_TEMPERATURE", log10(heat_solver->GetRes_RMS(0))); + SetHistoryOutputValue("MAX_TEMPERATURE", log10(heat_solver->GetRes_Max(0))); + if (multiZone) SetHistoryOutputValue("BGS_HEAT", log10(heat_solver->GetRes_BGS(0))); + } + if (heat){ + SetHistoryOutputValue("HEATFLUX", flow_solver->GetTotal_HeatFlux()); + SetHistoryOutputValue("HEATFLUX_MAX", flow_solver->GetTotal_MaxHeatFlux()); + SetHistoryOutputValue("TEMPERATURE", flow_solver->GetTotal_AvgTemperature()); + if (nDim == 3) SetHistoryOutputValue("RMS_TEMPERATURE", log10(flow_solver->GetRes_RMS(4))); + else SetHistoryOutputValue("RMS_TEMPERATURE", log10(flow_solver->GetRes_RMS(3))); + + if (nDim == 3) SetHistoryOutputValue("MAX_TEMPERATURE", log10(flow_solver->GetRes_Max(4))); + else SetHistoryOutputValue("MAX_TEMPERATURE", log10(flow_solver->GetRes_Max(3))); + if (multiZone){ + if (nDim == 3) SetHistoryOutputValue("BGS_TEMPERATURE", log10(flow_solver->GetRes_BGS(4))); + else SetHistoryOutputValue("BGS_TEMPERATURE", log10(flow_solver->GetRes_BGS(3))); + } + + } + + SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL", log10(flow_solver->GetLinSol_Residual())); + + if (config->GetDeform_Mesh()){ + SetHistoryOutputValue("DEFORM_MIN_VOLUME", mesh_solver->GetMinimum_Volume()); + SetHistoryOutputValue("DEFORM_MAX_VOLUME", mesh_solver->GetMaximum_Volume()); + SetHistoryOutputValue("DEFORM_ITER", mesh_solver->GetIterLinSolver()); + SetHistoryOutputValue("DEFORM_RESIDUAL", log10(mesh_solver->GetLinSol_Residual())); + } + + SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + + + /*--- Set the analyse surface history values --- */ + + SetAnalyzeSurface(flow_solver, geometry, config, false); + + /*--- Set aeroydnamic coefficients --- */ + + SetAerodynamicCoefficients(config, flow_solver); + +} + + +void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + // SOLUTION variables + AddVolumeOutput("PRESSURE", "Pressure", "SOLUTION", "Pressure"); + AddVolumeOutput("VELOCITY-X", "Velocity_x", "SOLUTION", "x-component of the velocity vector"); + AddVolumeOutput("VELOCITY-Y", "Velocity_y", "SOLUTION", "y-component of the velocity vector"); + if (nDim == 3) + AddVolumeOutput("VELOCITY-Z", "Velocity_z", "SOLUTION", "z-component of the velocity vector"); + if (heat || weakly_coupled_heat) + AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); + AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart–Allmaras variable"); + break; + case NONE: + break; + } + + // Grid velocity + if (config->GetGrid_Movement()){ + AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); + AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); + if (nDim == 3 ) + AddVolumeOutput("GRID_VELOCITY-Z", "Grid_Velocity_z", "GRID_VELOCITY", "z-component of the grid velocity vector"); + } + + // Primitive variables + AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient"); + AddVolumeOutput("DENSITY", "Density", "PRIMITIVE", "Density"); + + if (config->GetKind_Solver() == INC_RANS || config->GetKind_Solver() == INC_NAVIER_STOKES){ + AddVolumeOutput("LAMINAR_VISCOSITY", "Laminar_Viscosity", "PRIMITIVE", "Laminar viscosity"); + + AddVolumeOutput("SKIN_FRICTION-X", "Skin_Friction_Coefficient_x", "PRIMITIVE", "x-component of the skin friction vector"); + AddVolumeOutput("SKIN_FRICTION-Y", "Skin_Friction_Coefficient_y", "PRIMITIVE", "y-component of the skin friction vector"); + if (nDim == 3) + AddVolumeOutput("SKIN_FRICTION-Z", "Skin_Friction_Coefficient_z", "PRIMITIVE", "z-component of the skin friction vector"); + + AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); + AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); + + } + + if (config->GetKind_Solver() == INC_RANS) { + AddVolumeOutput("EDDY_VISCOSITY", "Eddy_Viscosity", "PRIMITIVE", "Turbulent eddy viscosity"); + } + + if (config->GetKind_Trans_Model() == BC){ + AddVolumeOutput("INTERMITTENCY", "gamma_BC", "INTERMITTENCY", "Intermittency"); + } + + //Residuals + AddVolumeOutput("RES_PRESSURE", "Residual_Pressure", "RESIDUAL", "Residual of the pressure"); + AddVolumeOutput("RES_VELOCITY-X", "Residual_Velocity_x", "RESIDUAL", "Residual of the x-velocity component"); + AddVolumeOutput("RES_VELOCITY-Y", "Residual_Velocity_y", "RESIDUAL", "Residual of the y-velocity component"); + if (nDim == 3) + AddVolumeOutput("RES_VELOCITY-Z", "Residual_Velocity_z", "RESIDUAL", "Residual of the z-velocity component"); + AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("RES_TKE", "Residual_TKE", "RESIDUAL", "Residual of turbulent kinetic energy"); + AddVolumeOutput("RES_DISSIPATION", "Residual_Omega", "RESIDUAL", "Residual of the rate of dissipation."); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart–Allmaras variable"); + break; + case NONE: + break; + } + + // Limiter values + AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); + AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); + AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); + if (nDim == 3) + AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); + AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy."); + AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate."); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of Spalart–Allmaras variable."); + break; + case NONE: + break; + } + + // Hybrid RANS-LES + if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ + AddVolumeOutput("DES_LENGTHSCALE", "DES_LengthScale", "DDES", "DES length scale value"); + AddVolumeOutput("WALL_DISTANCE", "Wall_Distance", "DDES", "Wall distance value"); + } + + // Roe Low Dissipation + if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ + AddVolumeOutput("ROE_DISSIPATION", "Roe_Dissipation", "ROE_DISSIPATION", "Value of the Roe dissipation"); + } + + if(config->GetKind_Solver() == INC_RANS || config->GetKind_Solver() == INC_NAVIER_STOKES){ + if (nDim == 3){ + AddVolumeOutput("VORTICITY_X", "Vorticity_x", "VORTEX_IDENTIFICATION", "x-component of the vorticity vector"); + AddVolumeOutput("VORTICITY_Y", "Vorticity_y", "VORTEX_IDENTIFICATION", "y-component of the vorticity vector"); + AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); + } + AddVolumeOutput("VORTICITY_Z", "Vorticity_z", "VORTEX_IDENTIFICATION", "z-component of the vorticity vector"); + } +} + +void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_Flow = solver[FLOW_SOL]->node[iPoint]; + CVariable* Node_Heat = NULL; + CVariable* Node_Turb = NULL; + + if (config->GetKind_Turb_Model() != NONE){ + Node_Turb = solver[TURB_SOL]->node[iPoint]; + } + if (weakly_coupled_heat){ + Node_Heat = solver[HEAT_SOL]->node[iPoint]; + } + + CPoint* Node_Geo = geometry->node[iPoint]; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetSolution(0)); + SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetSolution(1)); + SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetSolution(2)); + if (nDim == 3){ + SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetSolution(3)); + if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(4)); + } else { + if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(3)); + } + if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(0)); + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(0)); + SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("NU_TILDE", iPoint, Node_Turb->GetSolution(0)); + break; + case NONE: + break; + } + + if (config->GetGrid_Movement()){ + SetVolumeOutputValue("GRID_VELOCITY-X", iPoint, Node_Geo->GetGridVel()[0]); + SetVolumeOutputValue("GRID_VELOCITY-Y", iPoint, Node_Geo->GetGridVel()[1]); + if (nDim == 3) + SetVolumeOutputValue("GRID_VELOCITY-Z", iPoint, Node_Geo->GetGridVel()[2]); + } + + su2double VelMag = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++){ + VelMag += solver[FLOW_SOL]->GetVelocity_Inf(iDim)*solver[FLOW_SOL]->GetVelocity_Inf(iDim); + } + su2double factor = 1.0/(0.5*solver[FLOW_SOL]->GetDensity_Inf()*VelMag); + SetVolumeOutputValue("PRESSURE_COEFF", iPoint, (Node_Flow->GetPressure() - config->GetPressure_FreeStreamND())*factor); + SetVolumeOutputValue("DENSITY", iPoint, Node_Flow->GetDensity()); + + if (config->GetKind_Solver() == INC_RANS || config->GetKind_Solver() == INC_NAVIER_STOKES){ + SetVolumeOutputValue("LAMINAR_VISCOSITY", iPoint, Node_Flow->GetLaminarViscosity()); + } + + if (config->GetKind_Solver() == INC_RANS) { + SetVolumeOutputValue("EDDY_VISCOSITY", iPoint, Node_Flow->GetEddyViscosity()); + } + + if (config->GetKind_Trans_Model() == BC){ + SetVolumeOutputValue("INTERMITTENCY", iPoint, Node_Turb->GetGammaBC()); + } + + SetVolumeOutputValue("RES_PRESSURE", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 0)); + SetVolumeOutputValue("RES_VELOCITY-X", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 1)); + SetVolumeOutputValue("RES_VELOCITY-Y", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 2)); + if (nDim == 3){ + SetVolumeOutputValue("RES_VELOCITY-Z", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 3)); + SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 4)); + } else { + SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[FLOW_SOL]->LinSysRes.GetBlock(iPoint, 3)); + } + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("RES_TKE", iPoint, solver[TURB_SOL]->LinSysRes.GetBlock(iPoint, 0)); + SetVolumeOutputValue("RES_DISSIPATION", iPoint, solver[TURB_SOL]->LinSysRes.GetBlock(iPoint, 1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("RES_NU_TILDE", iPoint, solver[TURB_SOL]->LinSysRes.GetBlock(iPoint, 0)); + break; + case NONE: + break; + } + + SetVolumeOutputValue("LIMITER_PRESSURE", iPoint, Node_Flow->GetLimiter_Primitive(0)); + SetVolumeOutputValue("LIMITER_VELOCITY-X", iPoint, Node_Flow->GetLimiter_Primitive(1)); + SetVolumeOutputValue("LIMITER_VELOCITY-Y", iPoint, Node_Flow->GetLimiter_Primitive(2)); + if (nDim == 3){ + SetVolumeOutputValue("LIMITER_VELOCITY-Z", iPoint, Node_Flow->GetLimiter_Primitive(3)); + SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(4)); + } else { + SetVolumeOutputValue("LIMITER_TEMPERATURE", iPoint, Node_Flow->GetLimiter_Primitive(3)); + } + + switch(config->GetKind_Turb_Model()){ + case SST: case SST_SUST: + SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter_Primitive(0)); + SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter_Primitive(1)); + break; + case SA: case SA_COMP: case SA_E: + case SA_E_COMP: case SA_NEG: + SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter_Primitive(0)); + break; + case NONE: + break; + } + + if (config->GetKind_HybridRANSLES() != NO_HYBRIDRANSLES){ + SetVolumeOutputValue("DES_LENGTHSCALE", iPoint, Node_Flow->GetDES_LengthScale()); + SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance()); + } + + if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ + SetVolumeOutputValue("ROE_DISSIPATION", iPoint, Node_Flow->GetRoe_Dissipation()); + } + + if(config->GetKind_Solver() == INC_RANS || config->GetKind_Solver() == INC_NAVIER_STOKES){ + if (nDim == 3){ + SetVolumeOutputValue("VORTICITY_X", iPoint, Node_Flow->GetVorticity()[0]); + SetVolumeOutputValue("VORTICITY_Y", iPoint, Node_Flow->GetVorticity()[1]); + SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(config, geometry, Node_Flow)); + } + SetVolumeOutputValue("VORTICITY_Z", iPoint, Node_Flow->GetVorticity()[2]); + } +} + +void CFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ + + if ((config->GetKind_Solver() == INC_NAVIER_STOKES) || (config->GetKind_Solver() == INC_RANS)) { + SetVolumeOutputValue("SKIN_FRICTION-X", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 0)); + SetVolumeOutputValue("SKIN_FRICTION-Y", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 1)); + if (nDim == 3) + SetVolumeOutputValue("SKIN_FRICTION-Z", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 2)); + + if (weakly_coupled_heat) + SetVolumeOutputValue("HEAT_FLUX", iPoint, solver[HEAT_SOL]->GetHeatFlux(iMarker, iVertex)); + else { + SetVolumeOutputValue("HEAT_FLUX", iPoint, solver[FLOW_SOL]->GetHeatFlux(iMarker, iVertex)); + + } + SetVolumeOutputValue("Y_PLUS", iPoint, solver[FLOW_SOL]->GetYPlus(iMarker, iVertex)); + } +} + +su2double CFlowIncOutput::GetQ_Criterion(CConfig *config, CGeometry *geometry, CVariable* node_flow){ + + unsigned short iDim; + su2double Grad_Vel[3][3] = {{0.0, 0.0, 0.0},{0.0, 0.0, 0.0},{0.0, 0.0, 0.0}}; + + for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short jDim = 0 ; jDim < nDim; jDim++) { + Grad_Vel[iDim][jDim] = node_flow->GetGradient_Primitive(iDim+1, jDim); + } + } + + su2double s11 = Grad_Vel[0][0]; + su2double s12 = 0.5 * (Grad_Vel[0][1] + Grad_Vel[1][0]); + su2double s13 = 0.5 * (Grad_Vel[0][2] + Grad_Vel[2][0]); + su2double s22 = Grad_Vel[1][1]; + su2double s23 = 0.5 * (Grad_Vel[1][2] + Grad_Vel[2][1]); + su2double s33 = Grad_Vel[2][2]; + su2double omega12 = 0.5 * (Grad_Vel[0][1] - Grad_Vel[1][0]); + su2double omega13 = 0.5 * (Grad_Vel[0][2] - Grad_Vel[2][0]); + su2double omega23 = 0.5 * (Grad_Vel[1][2] - Grad_Vel[2][1]); + + su2double Q = 2. * pow( omega12, 2.) + 2. * pow( omega13, 2.) + 2. * pow( omega23, 2.) - \ + pow( s11, 2.) - pow( s22, 2.) - pow( s33, 2.0) - 2. * pow( s12, 2.) - 2. * pow( s13, 2.) - 2. * pow( s23, 2.0); + + return Q; +} + +bool CFlowIncOutput::SetInit_Residuals(CConfig *config){ + + return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == STEADY && (curTimeIter < 2)); + +} + +bool CFlowIncOutput::SetUpdate_Averages(CConfig *config){ + return false; + +// return (config->GetUnsteady_Simulation() != STEADY && !dualtime); + +} diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp new file mode 100644 index 000000000000..76208552ba1d --- /dev/null +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -0,0 +1,2895 @@ +/*! + * \file output_flow.cpp + * \brief Main subroutines for compressible flow output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ +#include "../../include/output/CFlowOutput.hpp" +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CFlowOutput::CFlowOutput(CConfig *config, unsigned short nDim, bool fem_output) : COutput (config, nDim, fem_output){ + +} + + +CFlowOutput::~CFlowOutput(void){} + +void CFlowOutput::AddAnalyzeSurfaceOutput(CConfig *config){ + + + /// DESCRIPTION: Average mass flow + AddHistoryOutput("AVG_MASSFLOW", "Avg_Massflow", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average mass flow on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Mach number + AddHistoryOutput("AVG_MACH", "Avg_Mach", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average mach number on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Temperature + AddHistoryOutput("AVG_TEMP", "Avg_Temp", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average temperature on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Pressure + AddHistoryOutput("AVG_PRESS", "Avg_Press", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average pressure on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Density + AddHistoryOutput("AVG_DENSITY", "Avg_Density", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average density on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Enthalpy + AddHistoryOutput("AVG_ENTHALPY", "Avg_Enthalpy", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average enthalpy on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average velocity in normal direction of the surface + AddHistoryOutput("AVG_NORMALVEL", "Avg_NormalVel", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average normal velocity on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Flow uniformity + AddHistoryOutput("UNIFORMITY", "Uniformity", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total flow uniformity on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Secondary strength + AddHistoryOutput("SECONDARY_STRENGTH", "Secondary_Strength", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total secondary strength on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Momentum distortion + AddHistoryOutput("MOMENTUM_DISTORTION", "Momentum_Distortion", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total momentum distortion on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Secondary over uniformity + AddHistoryOutput("SECONDARY_OVER_UNIFORMITY", "Secondary_Over_Uniformity", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total secondary over uniformity on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average total temperature + AddHistoryOutput("AVG_TOTALTEMP", "Avg_TotalTemp", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average total temperature all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average total pressure + AddHistoryOutput("AVG_TOTALPRESS", "Avg_TotalPress", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average total pressure on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Pressure drop + AddHistoryOutput("PRESSURE_DROP", "Pressure_Drop", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total pressure drop on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + + /// BEGIN_GROUP: AERO_COEFF_SURF, DESCRIPTION: Surface values on non-solid markers. + vector Marker_Analyze; + for (unsigned short iMarker_Analyze = 0; iMarker_Analyze < config->GetnMarker_Analyze(); iMarker_Analyze++){ + Marker_Analyze.push_back(config->GetMarker_Analyze_TagBound(iMarker_Analyze)); + } + + /// DESCRIPTION: Average mass flow + AddHistoryOutputPerSurface("AVG_MASSFLOW", "Avg_Massflow", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Mach number + AddHistoryOutputPerSurface("AVG_MACH", "Avg_Mach", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Temperature + AddHistoryOutputPerSurface("AVG_TEMP", "Avg_Temp", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Pressure + AddHistoryOutputPerSurface("AVG_PRESS", "Avg_Press", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Density + AddHistoryOutputPerSurface("AVG_DENSITY", "Avg_Density", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average Enthalpy + AddHistoryOutputPerSurface("AVG_ENTHALPY", "Avg_Enthalpy", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average velocity in normal direction of the surface + AddHistoryOutputPerSurface("AVG_NORMALVEL", "Avg_NormalVel", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Flow uniformity + AddHistoryOutputPerSurface("UNIFORMITY", "Uniformity", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Secondary strength + AddHistoryOutputPerSurface("SECONDARY_STRENGTH", "Secondary_Strength", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Momentum distortion + AddHistoryOutputPerSurface("MOMENTUM_DISTORTION", "Momentum_Distortion", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Secondary over uniformity + AddHistoryOutputPerSurface("SECONDARY_OVER_UNIFORMITY", "Secondary_Over_Uniformity", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average total temperature + AddHistoryOutputPerSurface("AVG_TOTALTEMP", "Avg_TotalTemp", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Average total pressure + AddHistoryOutputPerSurface("AVG_TOTALPRESS", "Avg_TotalPress", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Pressure drop + AddHistoryOutputPerSurface("PRESSURE_DROP", "Pressure_Drop", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); + /// END_GROUP + +} + +void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfig *config, bool output){ + + unsigned short iDim, iMarker, iMarker_Analyze; + unsigned long iVertex, iPoint; + su2double Mach = 0.0, Pressure, Temperature = 0.0, TotalPressure = 0.0, TotalTemperature = 0.0, + Enthalpy, Velocity[3], TangVel[3], Velocity2, MassFlow, Density, Area, + AxiFactor = 1.0, SoundSpeed, Vn, Vn2, Vtang2, Weight = 1.0; + + su2double Gas_Constant = config->GetGas_ConstantND(); + su2double Gamma = config->GetGamma(); + unsigned short nMarker = config->GetnMarker_All(); + unsigned short nDim = geometry->GetnDim(); + unsigned short Kind_Average = config->GetKind_Average(); + + bool compressible = config->GetKind_Regime() == COMPRESSIBLE; + bool incompressible = config->GetKind_Regime() == INCOMPRESSIBLE; + bool energy = config->GetEnergy_Equation(); + + + bool axisymmetric = config->GetAxisymmetric(); + unsigned short nMarker_Analyze = config->GetnMarker_Analyze(); + + su2double *Vector = new su2double[nDim]; + su2double *Surface_MassFlow = new su2double[nMarker]; + su2double *Surface_Mach = new su2double[nMarker]; + su2double *Surface_Temperature = new su2double[nMarker]; + su2double *Surface_Density = new su2double[nMarker]; + su2double *Surface_Enthalpy = new su2double[nMarker]; + su2double *Surface_NormalVelocity = new su2double[nMarker]; + su2double *Surface_StreamVelocity2 = new su2double[nMarker]; + su2double *Surface_TransvVelocity2 = new su2double[nMarker]; + su2double *Surface_Pressure = new su2double[nMarker]; + su2double *Surface_TotalTemperature = new su2double[nMarker]; + su2double *Surface_TotalPressure = new su2double[nMarker]; + su2double *Surface_VelocityIdeal = new su2double[nMarker]; + su2double *Surface_Area = new su2double[nMarker]; + su2double *Surface_MassFlow_Abs = new su2double[nMarker]; + + su2double Tot_Surface_MassFlow = 0.0; + su2double Tot_Surface_Mach = 0.0; + su2double Tot_Surface_Temperature = 0.0; + su2double Tot_Surface_Density = 0.0; + su2double Tot_Surface_Enthalpy = 0.0; + su2double Tot_Surface_NormalVelocity = 0.0; + su2double Tot_Surface_StreamVelocity2 = 0.0; + su2double Tot_Surface_TransvVelocity2 = 0.0; + su2double Tot_Surface_Pressure = 0.0; + su2double Tot_Surface_TotalTemperature = 0.0; + su2double Tot_Surface_TotalPressure = 0.0; + su2double Tot_Momentum_Distortion = 0.0; + su2double Tot_SecondOverUniformity = 0.0; + su2double Tot_Surface_PressureDrop = 0.0; + + /*--- Compute the numerical fan face Mach number, and the total area of the inflow ---*/ + + for (iMarker = 0; iMarker < nMarker; iMarker++) { + + Surface_MassFlow[iMarker] = 0.0; + Surface_Mach[iMarker] = 0.0; + Surface_Temperature[iMarker] = 0.0; + Surface_Density[iMarker] = 0.0; + Surface_Enthalpy[iMarker] = 0.0; + Surface_NormalVelocity[iMarker] = 0.0; + Surface_StreamVelocity2[iMarker] = 0.0; + Surface_TransvVelocity2[iMarker] = 0.0; + Surface_Pressure[iMarker] = 0.0; + Surface_TotalTemperature[iMarker] = 0.0; + Surface_TotalPressure[iMarker] = 0.0; + Surface_VelocityIdeal[iMarker] = 0.0; + Surface_Area[iMarker] = 0.0; + Surface_MassFlow_Abs[iMarker] = 0.0; + + if (config->GetMarker_All_Analyze(iMarker) == YES) { + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + if (geometry->node[iPoint]->GetDomain()) { + + geometry->vertex[iMarker][iVertex]->GetNormal(Vector); + + if (axisymmetric) { + if (geometry->node[iPoint]->GetCoord(1) != 0.0) + AxiFactor = 2.0*PI_NUMBER*geometry->node[iPoint]->GetCoord(1); + else + AxiFactor = 1.0; + } else { + AxiFactor = 1.0; + } + + Density = solver->node[iPoint]->GetDensity(); + Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vn = 0.0; Vtang2 = 0.0; + + for (iDim = 0; iDim < nDim; iDim++) { + Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); + Velocity[iDim] = solver->node[iPoint]->GetVelocity(iDim); + Velocity2 += Velocity[iDim] * Velocity[iDim]; + Vn += Velocity[iDim] * Vector[iDim] * AxiFactor; + MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; + } + + Area = sqrt (Area); + if (AxiFactor == 0.0) Vn = 0.0; else Vn /= Area; + Vn2 = Vn * Vn; + Pressure = solver->node[iPoint]->GetPressure(); + SoundSpeed = solver->node[iPoint]->GetSoundSpeed(); + + for (iDim = 0; iDim < nDim; iDim++) { + TangVel[iDim] = Velocity[iDim] - Vn*Vector[iDim]*AxiFactor/Area; + Vtang2 += TangVel[iDim]*TangVel[iDim]; + } + + if (incompressible){ + if (config->GetKind_DensityModel() == VARIABLE) { + Mach = sqrt(solver->node[iPoint]->GetVelocity2())/ + sqrt(solver->node[iPoint]->GetSpecificHeatCp()*config->GetPressure_ThermodynamicND()/(solver->node[iPoint]->GetSpecificHeatCv()*solver->node[iPoint]->GetDensity())); + } else { + Mach = sqrt(solver->node[iPoint]->GetVelocity2())/ + sqrt(config->GetBulk_Modulus()/(solver->node[iPoint]->GetDensity())); + } + Temperature = solver->node[iPoint]->GetTemperature(); + Enthalpy = solver->node[iPoint]->GetSpecificHeatCp()*Temperature; + TotalTemperature = Temperature + 0.5*Velocity2/solver->node[iPoint]->GetSpecificHeatCp(); + TotalPressure = Pressure + 0.5*Density*Velocity2; + } + else{ + Mach = sqrt(Velocity2)/SoundSpeed; + Temperature = Pressure / (Gas_Constant * Density); + Enthalpy = solver->node[iPoint]->GetEnthalpy(); + TotalTemperature = Temperature * (1.0 + Mach * Mach * 0.5 * (Gamma - 1.0)); + TotalPressure = Pressure * pow( 1.0 + Mach * Mach * 0.5 * (Gamma - 1.0), Gamma / (Gamma - 1.0)); + } + + /*--- Compute the mass Surface_MassFlow ---*/ + + Surface_Area[iMarker] += Area; + Surface_MassFlow[iMarker] += MassFlow; + Surface_MassFlow_Abs[iMarker] += abs(MassFlow); + + if (Kind_Average == AVERAGE_MASSFLUX) Weight = abs(MassFlow); + else if (Kind_Average == AVERAGE_AREA) Weight = abs(Area); + else Weight = 1.0; + + Surface_Mach[iMarker] += Mach*Weight; + Surface_Temperature[iMarker] += Temperature*Weight; + Surface_Density[iMarker] += Density*Weight; + Surface_Enthalpy[iMarker] += Enthalpy*Weight; + Surface_NormalVelocity[iMarker] += Vn*Weight; + Surface_Pressure[iMarker] += Pressure*Weight; + Surface_TotalTemperature[iMarker] += TotalTemperature*Weight; + Surface_TotalPressure[iMarker] += TotalPressure*Weight; + + /*--- For now, always used the area to weight the uniformities. ---*/ + + Weight = abs(Area); + + Surface_StreamVelocity2[iMarker] += Vn2*Weight; + Surface_TransvVelocity2[iMarker] += Vtang2*Weight; + + } + } + + } + + } + + /*--- Copy to the appropriate structure ---*/ + + su2double *Surface_MassFlow_Local = new su2double [nMarker_Analyze]; + su2double *Surface_Mach_Local = new su2double [nMarker_Analyze]; + su2double *Surface_Temperature_Local = new su2double [nMarker_Analyze]; + su2double *Surface_Density_Local = new su2double [nMarker_Analyze]; + su2double *Surface_Enthalpy_Local = new su2double [nMarker_Analyze]; + su2double *Surface_NormalVelocity_Local = new su2double [nMarker_Analyze]; + su2double *Surface_StreamVelocity2_Local = new su2double [nMarker_Analyze]; + su2double *Surface_TransvVelocity2_Local = new su2double [nMarker_Analyze]; + su2double *Surface_Pressure_Local = new su2double [nMarker_Analyze]; + su2double *Surface_TotalTemperature_Local = new su2double [nMarker_Analyze]; + su2double *Surface_TotalPressure_Local = new su2double [nMarker_Analyze]; + su2double *Surface_Area_Local = new su2double [nMarker_Analyze]; + su2double *Surface_MassFlow_Abs_Local = new su2double [nMarker_Analyze]; + + su2double *Surface_MassFlow_Total = new su2double [nMarker_Analyze]; + su2double *Surface_Mach_Total = new su2double [nMarker_Analyze]; + su2double *Surface_Temperature_Total = new su2double [nMarker_Analyze]; + su2double *Surface_Density_Total = new su2double [nMarker_Analyze]; + su2double *Surface_Enthalpy_Total = new su2double [nMarker_Analyze]; + su2double *Surface_NormalVelocity_Total = new su2double [nMarker_Analyze]; + su2double *Surface_StreamVelocity2_Total = new su2double [nMarker_Analyze]; + su2double *Surface_TransvVelocity2_Total = new su2double [nMarker_Analyze]; + su2double *Surface_Pressure_Total = new su2double [nMarker_Analyze]; + su2double *Surface_TotalTemperature_Total = new su2double [nMarker_Analyze]; + su2double *Surface_TotalPressure_Total = new su2double [nMarker_Analyze]; + su2double *Surface_Area_Total = new su2double [nMarker_Analyze]; + su2double *Surface_MassFlow_Abs_Total = new su2double [nMarker_Analyze]; + + su2double *Surface_MomentumDistortion_Total = new su2double [nMarker_Analyze]; + + for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + Surface_MassFlow_Local[iMarker_Analyze] = 0.0; + Surface_Mach_Local[iMarker_Analyze] = 0.0; + Surface_Temperature_Local[iMarker_Analyze] = 0.0; + Surface_Density_Local[iMarker_Analyze] = 0.0; + Surface_Enthalpy_Local[iMarker_Analyze] = 0.0; + Surface_NormalVelocity_Local[iMarker_Analyze] = 0.0; + Surface_StreamVelocity2_Local[iMarker_Analyze] = 0.0; + Surface_TransvVelocity2_Local[iMarker_Analyze] = 0.0; + Surface_Pressure_Local[iMarker_Analyze] = 0.0; + Surface_TotalTemperature_Local[iMarker_Analyze] = 0.0; + Surface_TotalPressure_Local[iMarker_Analyze] = 0.0; + Surface_Area_Local[iMarker_Analyze] = 0.0; + Surface_MassFlow_Abs_Local[iMarker_Analyze] = 0.0; + + Surface_MassFlow_Total[iMarker_Analyze] = 0.0; + Surface_Mach_Total[iMarker_Analyze] = 0.0; + Surface_Temperature_Total[iMarker_Analyze] = 0.0; + Surface_Density_Total[iMarker_Analyze] = 0.0; + Surface_Enthalpy_Total[iMarker_Analyze] = 0.0; + Surface_NormalVelocity_Total[iMarker_Analyze] = 0.0; + Surface_StreamVelocity2_Total[iMarker_Analyze] = 0.0; + Surface_TransvVelocity2_Total[iMarker_Analyze] = 0.0; + Surface_Pressure_Total[iMarker_Analyze] = 0.0; + Surface_TotalTemperature_Total[iMarker_Analyze] = 0.0; + Surface_TotalPressure_Total[iMarker_Analyze] = 0.0; + Surface_Area_Total[iMarker_Analyze] = 0.0; + Surface_MassFlow_Abs_Total[iMarker_Analyze] = 0.0; + + Surface_MomentumDistortion_Total[iMarker_Analyze] = 0.0; + + } + + /*--- Compute the numerical fan face Mach number, mach number, temperature and the total area ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + if (config->GetMarker_All_Analyze(iMarker) == YES) { + + for (iMarker_Analyze= 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + + /*--- Add the Surface_MassFlow, and Surface_Area to the particular boundary ---*/ + + if (config->GetMarker_All_TagBound(iMarker) == config->GetMarker_Analyze_TagBound(iMarker_Analyze)) { + Surface_MassFlow_Local[iMarker_Analyze] += Surface_MassFlow[iMarker]; + Surface_Mach_Local[iMarker_Analyze] += Surface_Mach[iMarker]; + Surface_Temperature_Local[iMarker_Analyze] += Surface_Temperature[iMarker]; + Surface_Density_Local[iMarker_Analyze] += Surface_Density[iMarker]; + Surface_Enthalpy_Local[iMarker_Analyze] += Surface_Enthalpy[iMarker]; + Surface_NormalVelocity_Local[iMarker_Analyze] += Surface_NormalVelocity[iMarker]; + Surface_StreamVelocity2_Local[iMarker_Analyze] += Surface_StreamVelocity2[iMarker]; + Surface_TransvVelocity2_Local[iMarker_Analyze] += Surface_TransvVelocity2[iMarker]; + Surface_Pressure_Local[iMarker_Analyze] += Surface_Pressure[iMarker]; + Surface_TotalTemperature_Local[iMarker_Analyze] += Surface_TotalTemperature[iMarker]; + Surface_TotalPressure_Local[iMarker_Analyze] += Surface_TotalPressure[iMarker]; + Surface_Area_Local[iMarker_Analyze] += Surface_Area[iMarker]; + Surface_MassFlow_Abs_Local[iMarker_Analyze] += Surface_MassFlow_Abs[iMarker]; + } + + } + + } + + } + +#ifdef HAVE_MPI + + SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); + +#else + + for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + Surface_MassFlow_Total[iMarker_Analyze] = Surface_MassFlow_Local[iMarker_Analyze]; + Surface_Mach_Total[iMarker_Analyze] = Surface_Mach_Local[iMarker_Analyze]; + Surface_Temperature_Total[iMarker_Analyze] = Surface_Temperature_Local[iMarker_Analyze]; + Surface_Density_Total[iMarker_Analyze] = Surface_Density_Local[iMarker_Analyze]; + Surface_Enthalpy_Total[iMarker_Analyze] = Surface_Enthalpy_Local[iMarker_Analyze]; + Surface_NormalVelocity_Total[iMarker_Analyze] = Surface_NormalVelocity_Local[iMarker_Analyze]; + Surface_StreamVelocity2_Total[iMarker_Analyze] = Surface_StreamVelocity2_Local[iMarker_Analyze]; + Surface_TransvVelocity2_Total[iMarker_Analyze] = Surface_TransvVelocity2_Local[iMarker_Analyze]; + Surface_Pressure_Total[iMarker_Analyze] = Surface_Pressure_Local[iMarker_Analyze]; + Surface_TotalTemperature_Total[iMarker_Analyze] = Surface_TotalTemperature_Local[iMarker_Analyze]; + Surface_TotalPressure_Total[iMarker_Analyze] = Surface_TotalPressure_Local[iMarker_Analyze]; + Surface_Area_Total[iMarker_Analyze] = Surface_Area_Local[iMarker_Analyze]; + Surface_MassFlow_Abs_Total[iMarker_Analyze] = Surface_MassFlow_Abs_Local[iMarker_Analyze]; + } + +#endif + + /*--- Compute the value of Surface_Area_Total, and Surface_Pressure_Total, and + set the value in the config structure for future use ---*/ + + for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + + if (Kind_Average == AVERAGE_MASSFLUX) Weight = Surface_MassFlow_Abs_Total[iMarker_Analyze]; + else if (Kind_Average == AVERAGE_AREA) Weight = abs(Surface_Area_Total[iMarker_Analyze]); + else Weight = 1.0; + + if (Weight != 0.0) { + Surface_Mach_Total[iMarker_Analyze] /= Weight; + Surface_Temperature_Total[iMarker_Analyze] /= Weight; + Surface_Density_Total[iMarker_Analyze] /= Weight; + Surface_Enthalpy_Total[iMarker_Analyze] /= Weight; + Surface_NormalVelocity_Total[iMarker_Analyze] /= Weight; + Surface_Pressure_Total[iMarker_Analyze] /= Weight; + Surface_TotalTemperature_Total[iMarker_Analyze] /= Weight; + Surface_TotalPressure_Total[iMarker_Analyze] /= Weight; + } + else { + Surface_Mach_Total[iMarker_Analyze] = 0.0; + Surface_Temperature_Total[iMarker_Analyze] = 0.0; + Surface_Density_Total[iMarker_Analyze] = 0.0; + Surface_Enthalpy_Total[iMarker_Analyze] = 0.0; + Surface_NormalVelocity_Total[iMarker_Analyze] = 0.0; + Surface_Pressure_Total[iMarker_Analyze] = 0.0; + Surface_TotalTemperature_Total[iMarker_Analyze] = 0.0; + Surface_TotalPressure_Total[iMarker_Analyze] = 0.0; + } + + /*--- Compute flow uniformity parameters separately (always area for now). ---*/ + + Area = fabs(Surface_Area_Total[iMarker_Analyze]); + + if (Area != 0.0) { + Surface_MomentumDistortion_Total[iMarker_Analyze] = Surface_StreamVelocity2_Total[iMarker_Analyze]/(Surface_NormalVelocity_Total[iMarker_Analyze]*Surface_NormalVelocity_Total[iMarker_Analyze]*Area) - 1.0; + Surface_StreamVelocity2_Total[iMarker_Analyze] /= Area; + Surface_TransvVelocity2_Total[iMarker_Analyze] /= Area; + } + else { + Surface_MomentumDistortion_Total[iMarker_Analyze] = 0.0; + Surface_StreamVelocity2_Total[iMarker_Analyze] = 0.0; + Surface_TransvVelocity2_Total[iMarker_Analyze] = 0.0; + } + + } + + for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + + su2double MassFlow = Surface_MassFlow_Total[iMarker_Analyze] * config->GetDensity_Ref() * config->GetVelocity_Ref(); + if (config->GetSystemMeasurements() == US) MassFlow *= 32.174; + SetHistoryOutputPerSurfaceValue("AVG_MASSFLOW", MassFlow, iMarker_Analyze); + Tot_Surface_MassFlow += MassFlow; + + su2double Mach = Surface_Mach_Total[iMarker_Analyze]; + SetHistoryOutputPerSurfaceValue("AVG_MACH", Mach, iMarker_Analyze); + Tot_Surface_Mach += Mach; + + su2double Temperature = Surface_Temperature_Total[iMarker_Analyze] * config->GetTemperature_Ref(); + SetHistoryOutputPerSurfaceValue("AVG_TEMP", Temperature, iMarker_Analyze); + Tot_Surface_Temperature += Temperature; + + su2double Pressure = Surface_Pressure_Total[iMarker_Analyze] * config->GetPressure_Ref(); + SetHistoryOutputPerSurfaceValue("AVG_PRESS", Pressure, iMarker_Analyze); + Tot_Surface_Pressure += Pressure; + + su2double Density = Surface_Density_Total[iMarker_Analyze] * config->GetDensity_Ref(); + SetHistoryOutputPerSurfaceValue("AVG_DENSITY", Density, iMarker_Analyze); + Tot_Surface_Density += Density; + + su2double Enthalpy = Surface_Enthalpy_Total[iMarker_Analyze]; + SetHistoryOutputPerSurfaceValue("AVG_ENTHALPY", Enthalpy, iMarker_Analyze); + Tot_Surface_Enthalpy += Enthalpy; + + su2double NormalVelocity = Surface_NormalVelocity_Total[iMarker_Analyze] * config->GetVelocity_Ref(); + SetHistoryOutputPerSurfaceValue("AVG_NORMALVEL", NormalVelocity, iMarker_Analyze); + Tot_Surface_NormalVelocity += NormalVelocity; + + su2double Uniformity = sqrt(Surface_StreamVelocity2_Total[iMarker_Analyze]) * config->GetVelocity_Ref(); + SetHistoryOutputPerSurfaceValue("UNIFORMITY", Uniformity, iMarker_Analyze); + Tot_Surface_StreamVelocity2 += Uniformity; + + su2double SecondaryStrength = sqrt(Surface_TransvVelocity2_Total[iMarker_Analyze]) * config->GetVelocity_Ref(); + SetHistoryOutputPerSurfaceValue("SECONDARY_STRENGTH", SecondaryStrength, iMarker_Analyze); + Tot_Surface_TransvVelocity2 += SecondaryStrength; + + su2double MomentumDistortion = Surface_MomentumDistortion_Total[iMarker_Analyze]; + SetHistoryOutputPerSurfaceValue("MOMENTUM_DISTORTION", MomentumDistortion, iMarker_Analyze); + Tot_Momentum_Distortion += MomentumDistortion; + + su2double SecondOverUniform = SecondaryStrength/Uniformity; + SetHistoryOutputPerSurfaceValue("SECONDARY_OVER_UNIFORMITY", SecondOverUniform, iMarker_Analyze); + Tot_SecondOverUniformity += SecondOverUniform; + + su2double TotalTemperature = Surface_TotalTemperature_Total[iMarker_Analyze] * config->GetTemperature_Ref(); + SetHistoryOutputPerSurfaceValue("AVG_TOTALTEMP", TotalTemperature, iMarker_Analyze); + Tot_Surface_TotalTemperature += TotalTemperature; + + su2double TotalPressure = Surface_TotalPressure_Total[iMarker_Analyze] * config->GetPressure_Ref(); + SetHistoryOutputPerSurfaceValue("AVG_TOTALPRESS", TotalPressure, iMarker_Analyze); + Tot_Surface_TotalPressure += TotalPressure; + + } + + /*--- Compute the average static pressure drop between two surfaces. Note + that this assumes we have two surfaces being analyzed and that the outlet + is first followed by the inlet. This is because we may also want to choose + outlet values (temperature, uniformity, etc.) for our design problems, + which require the outlet to be listed first. This is a simple first version + that could be generalized to a different orders/lists/etc. ---*/ + + for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + su2double Pressure_Drop = 0.0; + if (nMarker_Analyze == 2) { + Pressure_Drop = (Surface_Pressure_Total[1]-Surface_Pressure_Total[0]) * config->GetPressure_Ref(); + config->SetSurface_PressureDrop(iMarker_Analyze, Pressure_Drop); + } + SetHistoryOutputPerSurfaceValue("PRESSURE_DROP", Pressure_Drop, iMarker_Analyze); + Tot_Surface_PressureDrop += Pressure_Drop; + } + + SetHistoryOutputValue("AVG_MASSFLOW", Tot_Surface_MassFlow); + SetHistoryOutputValue("AVG_MACH", Tot_Surface_Mach); + SetHistoryOutputValue("AVG_TEMP", Tot_Surface_Temperature); + SetHistoryOutputValue("AVG_PRESS", Tot_Surface_Pressure); + SetHistoryOutputValue("AVG_DENSITY", Tot_Surface_Density); + SetHistoryOutputValue("AVG_ENTHALPY", Tot_Surface_Enthalpy); + SetHistoryOutputValue("AVG_NORMALVEL", Tot_Surface_Enthalpy); + SetHistoryOutputValue("UNIFORMITY", Tot_Surface_StreamVelocity2); + SetHistoryOutputValue("SECONDARY_STRENGTH", Tot_Surface_TransvVelocity2); + SetHistoryOutputValue("MOMENTUM_DISTORTION", Tot_Momentum_Distortion); + SetHistoryOutputValue("SECONDARY_OVER_UNIFORMITY", Tot_SecondOverUniformity); + SetHistoryOutputValue("AVG_TOTALTEMP", Tot_Surface_TotalTemperature); + SetHistoryOutputValue("AVG_TOTALPRESS", Tot_Surface_TotalPressure); + SetHistoryOutputValue("PRESSURE_DROP", Tot_Surface_PressureDrop); + + if ((rank == MASTER_NODE) && !config->GetDiscrete_Adjoint() && output) { + + cout.precision(6); + cout.setf(ios::scientific, ios::floatfield); + cout << endl << "Computing surface mean values." << endl << endl; + + for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { + cout << "Surface "<< config->GetMarker_Analyze_TagBound(iMarker_Analyze) << ":" << endl; + + if (nDim == 3) { if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Area (m^2): "; else cout << setw(20) << "Area (ft^2): "; } + else { if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Area (m): "; else cout << setw(20) << "Area (ft): "; } + + if (config->GetSystemMeasurements() == SI) cout << setw(15) << fabs(Surface_Area_Total[iMarker_Analyze]); + else if (config->GetSystemMeasurements() == US) cout << setw(15) << fabs(Surface_Area_Total[iMarker_Analyze])*12.0*12.0; + + cout << endl; + + su2double MassFlow = config->GetSurface_MassFlow(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Mf (kg/s): " << setw(15) << MassFlow; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Mf (lbs/s): " << setw(15) << MassFlow; + + su2double NormalVelocity = config->GetSurface_NormalVelocity(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Vn (m/s): " << setw(15) << NormalVelocity; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Vn (ft/s): " << setw(15) << NormalVelocity; + + cout << endl; + + su2double Uniformity = config->GetSurface_Uniformity(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Uniformity (m/s): " << setw(15) << Uniformity; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Uniformity (ft/s): " << setw(15) << Uniformity; + + su2double SecondaryStrength = config->GetSurface_SecondaryStrength(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Secondary (m/s): " << setw(15) << SecondaryStrength; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Secondary (ft/s): " << setw(15) << SecondaryStrength; + + cout << endl; + + su2double MomentumDistortion = config->GetSurface_MomentumDistortion(iMarker_Analyze); + cout << setw(20) << "Mom. Distortion: " << setw(15) << MomentumDistortion; + + su2double SecondOverUniform = config->GetSurface_SecondOverUniform(iMarker_Analyze); + cout << setw(20) << "Second/Uniform: " << setw(15) << SecondOverUniform; + + cout << endl; + + su2double Pressure = config->GetSurface_Pressure(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "P (Pa): " << setw(15) << Pressure; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "P (psf): " << setw(15) << Pressure; + + su2double TotalPressure = config->GetSurface_TotalPressure(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "PT (Pa): " << setw(15) <GetSystemMeasurements() == US) cout << setw(20) << "PT (psf): " << setw(15) <GetSurface_Mach(iMarker_Analyze); + cout << setw(20) << "Mach: " << setw(15) << Mach; + + su2double Density = config->GetSurface_Density(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Rho (kg/m^3): " << setw(15) << Density; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Rho (lb/ft^3): " << setw(15) << Density*32.174; + + cout << endl; + + if (compressible || energy) { + su2double Temperature = config->GetSurface_Temperature(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "T (K): " << setw(15) << Temperature; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "T (R): " << setw(15) << Temperature; + + su2double TotalTemperature = config->GetSurface_TotalTemperature(iMarker_Analyze); + if (config->GetSystemMeasurements() == SI) cout << setw(20) << "TT (K): " << setw(15) << TotalTemperature; + else if (config->GetSystemMeasurements() == US) cout << setw(20) << "TT (R): " << setw(15) << TotalTemperature; + + cout << endl; + } + + } + cout.unsetf(ios_base::floatfield); + + } + + delete [] Surface_MassFlow_Local; + delete [] Surface_Mach_Local; + delete [] Surface_Temperature_Local; + delete [] Surface_Density_Local; + delete [] Surface_Enthalpy_Local; + delete [] Surface_NormalVelocity_Local; + delete [] Surface_StreamVelocity2_Local; + delete [] Surface_TransvVelocity2_Local; + delete [] Surface_Pressure_Local; + delete [] Surface_TotalTemperature_Local; + delete [] Surface_TotalPressure_Local; + delete [] Surface_Area_Local; + delete [] Surface_MassFlow_Abs_Local; + + delete [] Surface_MassFlow_Total; + delete [] Surface_Mach_Total; + delete [] Surface_Temperature_Total; + delete [] Surface_Density_Total; + delete [] Surface_Enthalpy_Total; + delete [] Surface_NormalVelocity_Total; + delete [] Surface_StreamVelocity2_Total; + delete [] Surface_TransvVelocity2_Total; + delete [] Surface_Pressure_Total; + delete [] Surface_TotalTemperature_Total; + delete [] Surface_TotalPressure_Total; + delete [] Surface_Area_Total; + delete [] Surface_MassFlow_Abs_Total; + delete [] Surface_MomentumDistortion_Total; + + delete [] Surface_MassFlow; + delete [] Surface_Mach; + delete [] Surface_Temperature; + delete [] Surface_Density; + delete [] Surface_Enthalpy; + delete [] Surface_NormalVelocity; + delete [] Surface_StreamVelocity2; + delete [] Surface_TransvVelocity2; + delete [] Surface_Pressure; + delete [] Surface_TotalTemperature; + delete [] Surface_TotalPressure; + delete [] Surface_Area; + delete [] Vector; + delete [] Surface_VelocityIdeal; + delete [] Surface_MassFlow_Abs; + + std::cout << std::resetiosflags(std::cout.flags()); +} + +void CFlowOutput::AddAerodynamicCoefficients(CConfig *config){ + + /// BEGIN_GROUP: AERO_COEFF, DESCRIPTION: Sum of the aerodynamic coefficients and forces on all surfaces (markers) set with MARKER_MONITORING. + /// DESCRIPTION: Drag coefficient + AddHistoryOutput("DRAG", "CD", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total drag coefficient on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Lift coefficient + AddHistoryOutput("LIFT", "CL", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total lift coefficient on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sideforce coefficient + AddHistoryOutput("SIDEFORCE", "CSF", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total sideforce coefficient on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Moment around the x-axis + AddHistoryOutput("MOMENT_X", "CMx", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total momentum x-component on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Moment around the y-axis + AddHistoryOutput("MOMENT_Y", "CMy", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total momentum y-component on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Moment around the z-axis + AddHistoryOutput("MOMENT_Z", "CMz", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total momentum z-component on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Force in x direction + AddHistoryOutput("FORCE_X", "CFx", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total force x-component on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Force in y direction + AddHistoryOutput("FORCE_Y", "CFy", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total force y-component on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Force in z direction + AddHistoryOutput("FORCE_Z", "CFz", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total force z-component on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Lift-to-drag ratio + AddHistoryOutput("EFFICIENCY", "CEff", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total lift-to-drag ratio on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + /// END_GROUP + + /// BEGIN_GROUP: AERO_COEFF_SURF, DESCRIPTION: Aerodynamic coefficients and forces per surface. + vector Marker_Monitoring; + for (unsigned short iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++){ + Marker_Monitoring.push_back(config->GetMarker_Monitoring_TagBound(iMarker_Monitoring)); + } + /// DESCRIPTION: Drag coefficient + AddHistoryOutputPerSurface("DRAG_ON_SURFACE", "CD", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Lift coefficient + AddHistoryOutputPerSurface("LIFT_ON_SURFACE", "CL", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Sideforce coefficient + AddHistoryOutputPerSurface("SIDEFORCE_ON_SURFACE", "CSF", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Moment around the x-axis + AddHistoryOutputPerSurface("MOMENT-X_ON_SURFACE", "CMx", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Moment around the y-axis + AddHistoryOutputPerSurface("MOMENT-Y_ON_SURFACE", "CMy", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Moment around the z-axis + AddHistoryOutputPerSurface("MOMENT-Z_ON_SURFACE", "CMz", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Force in x direction + AddHistoryOutputPerSurface("FORCE-X_ON_SURFACE", "CFx", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Force in y direction + AddHistoryOutputPerSurface("FORCE-Y_ON_SURFACE", "CFy", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Force in z direction + AddHistoryOutputPerSurface("FORCE-Z_ON_SURFACE", "CFz", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// DESCRIPTION: Lift-to-drag ratio + AddHistoryOutputPerSurface("EFFICIENCY_ON_SURFACE", "CEff", ScreenOutputFormat::FIXED, "AERO_COEFF_SURF", Marker_Monitoring, HistoryFieldType::COEFFICIENT); + /// END_GROUP + + /// DESCRIPTION: Angle of attack + AddHistoryOutput("AOA", "AoA", ScreenOutputFormat::SCIENTIFIC, "AOA", "Angle of attack"); +} + +void CFlowOutput::SetAerodynamicCoefficients(CConfig *config, CSolver *flow_solver){ + + SetHistoryOutputValue("DRAG", flow_solver->GetTotal_CD()); + SetHistoryOutputValue("LIFT", flow_solver->GetTotal_CL()); + if (nDim == 3) + SetHistoryOutputValue("SIDEFORCE", flow_solver->GetTotal_CSF()); + if (nDim == 3){ + SetHistoryOutputValue("MOMENT_X", flow_solver->GetTotal_CMx()); + SetHistoryOutputValue("MOMENT_Y", flow_solver->GetTotal_CMy()); + } + SetHistoryOutputValue("MOMENT_Z", flow_solver->GetTotal_CMz()); + SetHistoryOutputValue("FORCE_X", flow_solver->GetTotal_CFx()); + SetHistoryOutputValue("FORCE_Y", flow_solver->GetTotal_CFy()); + if (nDim == 3) + SetHistoryOutputValue("FORCE_Z", flow_solver->GetTotal_CFz()); + SetHistoryOutputValue("EFFICIENCY", flow_solver->GetTotal_CEff()); + + for (unsigned short iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { + SetHistoryOutputPerSurfaceValue("DRAG_ON_SURFACE", flow_solver->GetSurface_CD(iMarker_Monitoring), iMarker_Monitoring); + SetHistoryOutputPerSurfaceValue("LIFT_ON_SURFACE", flow_solver->GetSurface_CL(iMarker_Monitoring), iMarker_Monitoring); + if (nDim == 3) + SetHistoryOutputPerSurfaceValue("SIDEFORCE_ON_SURFACE", flow_solver->GetSurface_CSF(iMarker_Monitoring), iMarker_Monitoring); + if (nDim == 3){ + SetHistoryOutputPerSurfaceValue("MOMENT-X_ON_SURFACE", flow_solver->GetSurface_CMx(iMarker_Monitoring), iMarker_Monitoring); + SetHistoryOutputPerSurfaceValue("MOMENT-Y_ON_SURFACE", flow_solver->GetSurface_CMy(iMarker_Monitoring), iMarker_Monitoring); + } + SetHistoryOutputPerSurfaceValue("MOMENT-Z_ON_SURFACE", flow_solver->GetSurface_CMz(iMarker_Monitoring), iMarker_Monitoring); + SetHistoryOutputPerSurfaceValue("FORCE-X_ON_SURFACE", flow_solver->GetSurface_CFx(iMarker_Monitoring), iMarker_Monitoring); + SetHistoryOutputPerSurfaceValue("FORCE-Y_ON_SURFACE", flow_solver->GetSurface_CFy(iMarker_Monitoring), iMarker_Monitoring); + if (nDim == 3) + SetHistoryOutputPerSurfaceValue("FORCE-Z_ON_SURFACE", flow_solver->GetSurface_CFz(iMarker_Monitoring), iMarker_Monitoring); + + SetHistoryOutputPerSurfaceValue("EFFICIENCY_ON_SURFACE", flow_solver->GetSurface_CEff(iMarker_Monitoring), iMarker_Monitoring); + if (config->GetAeroelastic_Simulation()){ + SetHistoryOutputPerSurfaceValue("PITCH", config->GetAeroelastic_pitch(iMarker_Monitoring), iMarker_Monitoring); + SetHistoryOutputPerSurfaceValue("PLUNGE", config->GetAeroelastic_plunge(iMarker_Monitoring), iMarker_Monitoring); + } + } + + SetHistoryOutputValue("AOA", config->GetAoA()); +} + + +void CFlowOutput::Add_CpInverseDesignOutput(CConfig *config){ + + AddHistoryOutput("CP_DIFF", "Cp_Diff", ScreenOutputFormat::FIXED, "CP_DIFF", "Cp difference for inverse design"); + +} + +void CFlowOutput::Set_CpInverseDesign(CSolver *solver, CGeometry *geometry, CConfig *config){ + + unsigned short iMarker, icommas, Boundary, iDim; + unsigned long iVertex, iPoint, (*Point2Vertex)[2], nPointLocal = 0, nPointGlobal = 0; + su2double XCoord, YCoord, ZCoord, Pressure, PressureCoeff = 0, Cp, CpTarget, *Normal = NULL, Area, PressDiff = 0.0; + bool *PointInDomain; + string text_line, surfCp_filename; + ifstream Surface_file; + char cstr[200]; + + /*--- Prepare to read the surface pressure files (CSV) ---*/ + + surfCp_filename = "TargetCp"; + + surfCp_filename = config->GetUnsteady_FileName(surfCp_filename, (int)curTimeIter, ".dat"); + + strcpy (cstr, surfCp_filename.c_str()); + + /*--- Read the surface pressure file ---*/ + + string::size_type position; + + Surface_file.open(cstr, ios::in); + + if (!(Surface_file.fail())) { + + nPointLocal = geometry->GetnPoint(); +#ifdef HAVE_MPI + SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#else + nPointGlobal = nPointLocal; +#endif + + Point2Vertex = new unsigned long[nPointGlobal][2]; + PointInDomain = new bool[nPointGlobal]; + + for (iPoint = 0; iPoint < nPointGlobal; iPoint ++) + PointInDomain[iPoint] = false; + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + Boundary = config->GetMarker_All_KindBC(iMarker); + + if ((Boundary == EULER_WALL ) || + (Boundary == HEAT_FLUX ) || + (Boundary == ISOTHERMAL ) || + (Boundary == NEARFIELD_BOUNDARY)) { + for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { + + /*--- The Pressure file uses the global numbering ---*/ + + iPoint = geometry->node[geometry->vertex[iMarker][iVertex]->GetNode()]->GetGlobalIndex(); + + if (geometry->vertex[iMarker][iVertex]->GetNode() < geometry->GetnPointDomain()) { + Point2Vertex[iPoint][0] = iMarker; + Point2Vertex[iPoint][1] = iVertex; + PointInDomain[iPoint] = true; + solver->SetCPressureTarget(iMarker, iVertex, 0.0); + } + + } + } + } + + getline(Surface_file, text_line); + + while (getline(Surface_file, text_line)) { + for (icommas = 0; icommas < 50; icommas++) { + position = text_line.find( ",", 0 ); + if (position!=string::npos) text_line.erase (position,1); + } + stringstream point_line(text_line); + + if (geometry->GetnDim() == 2) point_line >> iPoint >> XCoord >> YCoord >> Pressure >> PressureCoeff; + if (geometry->GetnDim() == 3) point_line >> iPoint >> XCoord >> YCoord >> ZCoord >> Pressure >> PressureCoeff; + + if (PointInDomain[iPoint]) { + + /*--- Find the vertex for the Point and Marker ---*/ + + iMarker = Point2Vertex[iPoint][0]; + iVertex = Point2Vertex[iPoint][1]; + + solver->SetCPressureTarget(iMarker, iVertex, PressureCoeff); + + } + + } + + Surface_file.close(); + + delete [] Point2Vertex; + delete [] PointInDomain; + + /*--- Compute the pressure difference ---*/ + + PressDiff = 0.0; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + Boundary = config->GetMarker_All_KindBC(iMarker); + + if ((Boundary == EULER_WALL ) || + (Boundary == HEAT_FLUX ) || + (Boundary == ISOTHERMAL ) || + (Boundary == NEARFIELD_BOUNDARY)) { + for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { + + Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + + Cp = solver->GetCPressure(iMarker, iVertex); + CpTarget = solver->GetCPressureTarget(iMarker, iVertex); + + Area = 0.0; + for (iDim = 0; iDim < geometry->GetnDim(); iDim++) + Area += Normal[iDim]*Normal[iDim]; + Area = sqrt(Area); + + PressDiff += Area * (CpTarget - Cp) * (CpTarget - Cp); + } + + } + } + +#ifdef HAVE_MPI + su2double MyPressDiff = PressDiff; + SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); +#endif + + } + + /*--- Update the total Cp difference coeffient ---*/ + + solver->SetTotal_CpDiff(PressDiff); + + SetHistoryOutputValue("CP_DIFF", PressDiff); + +} + +void CFlowOutput::WriteAdditionalFiles(CConfig *config, CGeometry *geometry, CSolver **solver_container){ + + if (config->GetFixed_CL_Mode() || config->GetFixed_CM_Mode()){ + WriteMetaData(config, geometry); + } + + if (config->GetWrt_ForcesBreakdown()){ + WriteForcesBreakdown(config, geometry, solver_container); + } + +} + +void CFlowOutput::WriteMetaData(CConfig *config, CGeometry *geometry){ + + ofstream meta_file; + + string filename = "flow"; + + filename = config->GetFilename(filename, ".meta", curTimeIter); + + /*--- All processors open the file. ---*/ + + if (rank == MASTER_NODE) { + meta_file.open(filename.c_str(), ios::out); + meta_file.precision(15); + + if (config->GetTime_Marching() == DT_STEPPING_1ST || config->GetTime_Marching() == DT_STEPPING_2ND) + meta_file <<"ITER= " << curTimeIter + 1 << endl; + else + meta_file <<"ITER= " << curInnerIter + config->GetExtIter_OffSet() + 1 << endl; + meta_file <<"AOA= " << config->GetAoA() - config->GetAoA_Offset() << endl; + meta_file <<"SIDESLIP_ANGLE= " << config->GetAoS() - config->GetAoS_Offset() << endl; + meta_file <<"INITIAL_BCTHRUST= " << config->GetInitial_BCThrust() << endl; + meta_file <<"DCD_DCL_VALUE= " << config->GetdCD_dCL() << endl; + meta_file <<"DCMX_DCL_VALUE= " << config->GetdCMx_dCL() << endl; + meta_file <<"DCMY_DCL_VALUE= " << config->GetdCMy_dCL() << endl; + meta_file <<"DCMZ_DCL_VALUE= " << config->GetdCMz_dCL() << endl; + + if (( config->GetKind_Solver() == DISC_ADJ_EULER || + config->GetKind_Solver() == DISC_ADJ_NAVIER_STOKES || + config->GetKind_Solver() == DISC_ADJ_RANS )) { + meta_file << "SENS_AOA=" << GetHistoryFieldValue("SENS_AOA") * PI_NUMBER / 180.0 << endl; + } + } + + meta_file.close(); + +} + +void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSolver **solver_container){ + + char cstr[200]; + unsigned short iDim, iMarker_Monitoring; + ofstream Breakdown_file; + + bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); + bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + bool unsteady = (config->GetTime_Marching() != NO); + bool viscous = config->GetViscous(); + bool dynamic_grid = config->GetDynamic_Grid(); + bool gravity = config->GetGravityForce(); + bool turbulent = config->GetKind_Solver() == RANS; + bool fixed_cl = config->GetFixed_CL_Mode(); + unsigned short Kind_Solver = config->GetKind_Solver(); + unsigned short Kind_Turb_Model = config->GetKind_Turb_Model(); + unsigned short Ref_NonDim = config->GetRef_NonDim(); + + unsigned short nDim = geometry->GetnDim(); + + /*--- Output the mean flow solution using only the master node ---*/ + + if ( rank == MASTER_NODE) { + + cout << endl << "Writing the forces breakdown file ("<< config->GetBreakdown_FileName() << ")." << endl; + + /*--- Initialize variables to store information from all domains (direct solution) ---*/ + + su2double Total_CL = 0.0, Total_CD = 0.0, Total_CSF = 0.0, + Total_CMx = 0.0, Total_CMy = 0.0, Total_CMz = 0.0, Total_CEff = 0.0, + Total_CoPx = 0.0, Total_CoPy = 0.0, Total_CoPz = 0.0, + Total_CFx = 0.0, Total_CFy = 0.0, Total_CFz = 0.0, Inv_CL = 0.0, + Inv_CD = 0.0, Inv_CSF = 0.0, Inv_CMx = 0.0, Inv_CMy = 0.0, + Inv_CMz = 0.0, Inv_CEff = 0.0, Inv_CFx = 0.0, Inv_CFy = 0.0, Inv_CFz = + 0.0, Mnt_CL = 0.0, + Mnt_CD = 0.0, Mnt_CSF = 0.0, Mnt_CMx = 0.0, Mnt_CMy = 0.0, + Mnt_CMz = 0.0, Mnt_CEff = 0.0, Mnt_CFx = 0.0, Mnt_CFy = 0.0, Mnt_CFz = + 0.0, Visc_CL = 0.0, + Visc_CD = 0.0, Visc_CSF = 0.0, Visc_CMx = 0.0, Visc_CMy = 0.0, + Visc_CMz = 0.0, Visc_CEff = 0.0, Visc_CFx = 0.0, Visc_CFy = 0.0, Visc_CFz = + 0.0, *Surface_CL = NULL, *Surface_CD = NULL, + *Surface_CSF = NULL, *Surface_CEff = NULL, *Surface_CFx = NULL, + *Surface_CFy = NULL, *Surface_CFz = NULL, + *Surface_CMx = NULL, *Surface_CMy = NULL, *Surface_CMz = NULL, + *Surface_CL_Inv = NULL, + *Surface_CD_Inv = NULL, *Surface_CSF_Inv = NULL, + *Surface_CEff_Inv = NULL, *Surface_CFx_Inv = NULL, *Surface_CFy_Inv = + NULL, *Surface_CFz_Inv = NULL, *Surface_CMx_Inv = NULL, + *Surface_CMy_Inv = NULL, *Surface_CMz_Inv = NULL, + *Surface_CL_Visc = NULL, + *Surface_CD_Visc = NULL, *Surface_CSF_Visc = NULL, + *Surface_CEff_Visc = NULL, *Surface_CFx_Visc = NULL, *Surface_CFy_Visc = + NULL, *Surface_CFz_Visc = NULL, *Surface_CMx_Visc = NULL, + *Surface_CMy_Visc = NULL, *Surface_CMz_Visc = NULL, + *Surface_CL_Mnt = NULL, + *Surface_CD_Mnt = NULL, *Surface_CSF_Mnt = NULL, + *Surface_CEff_Mnt = NULL, *Surface_CFx_Mnt = NULL, *Surface_CFy_Mnt = + NULL, *Surface_CFz_Mnt = NULL, *Surface_CMx_Mnt = NULL, + *Surface_CMy_Mnt = NULL, *Surface_CMz_Mnt = NULL; + + /*--- WARNING: when compiling on Windows, ctime() is not available. Comment out + the two lines below that use the dt variable. ---*/ + //time_t now = time(0); + //string dt = ctime(&now); dt[24] = '.'; + + /*--- Allocate memory for the coefficients being monitored ---*/ + + Surface_CL = new su2double[config->GetnMarker_Monitoring()]; + Surface_CD = new su2double[config->GetnMarker_Monitoring()]; + Surface_CSF = new su2double[config->GetnMarker_Monitoring()]; + Surface_CEff = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFx = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFy = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFz = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMx = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMy = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMz = new su2double[config->GetnMarker_Monitoring()]; + + Surface_CL_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CD_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CSF_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CEff_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFx_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFy_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFz_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMx_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMy_Inv = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMz_Inv = new su2double[config->GetnMarker_Monitoring()]; + + Surface_CL_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CD_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CSF_Visc = + new su2double[config->GetnMarker_Monitoring()]; + Surface_CEff_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFx_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFy_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFz_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMx_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMy_Visc = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMz_Visc = new su2double[config->GetnMarker_Monitoring()]; + + + Surface_CL_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CD_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CSF_Mnt = + new su2double[config->GetnMarker_Monitoring()]; + Surface_CEff_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFx_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFy_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CFz_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMx_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMy_Mnt = new su2double[config->GetnMarker_Monitoring()]; + Surface_CMz_Mnt = new su2double[config->GetnMarker_Monitoring()]; + + /*--- Flow solution coefficients ---*/ + + Total_CL = solver_container[FLOW_SOL]->GetTotal_CL(); + Total_CD = solver_container[FLOW_SOL]->GetTotal_CD(); + Total_CSF = solver_container[FLOW_SOL]->GetTotal_CSF(); + Total_CEff = solver_container[FLOW_SOL]->GetTotal_CEff(); + Total_CMx = solver_container[FLOW_SOL]->GetTotal_CMx(); + Total_CMy = solver_container[FLOW_SOL]->GetTotal_CMy(); + Total_CMz = solver_container[FLOW_SOL]->GetTotal_CMz(); + Total_CFx = solver_container[FLOW_SOL]->GetTotal_CFx(); + Total_CFy = solver_container[FLOW_SOL]->GetTotal_CFy(); + Total_CFz = solver_container[FLOW_SOL]->GetTotal_CFz(); + + if (nDim == 2) { + Total_CoPx = solver_container[FLOW_SOL]->GetTotal_CoPx() / solver_container[FLOW_SOL]->GetTotal_CFy(); + Total_CoPy = solver_container[FLOW_SOL]->GetTotal_CoPy() / solver_container[FLOW_SOL]->GetTotal_CFx(); + Total_CoPz = 0.0; + } + if (nDim == 3) { + Total_CoPx = solver_container[FLOW_SOL]->GetTotal_CoPx() / solver_container[FLOW_SOL]->GetTotal_CFz(); + Total_CoPy = 0.0; + Total_CoPz = solver_container[FLOW_SOL]->GetTotal_CoPz() / solver_container[FLOW_SOL]->GetTotal_CFx(); + } + + if (config->GetSystemMeasurements() == US) { Total_CoPx *= 12.0; Total_CoPy *= 12.0; Total_CoPz *= 12.0; } + + /*--- Flow inviscid solution coefficients ---*/ + + Inv_CL = + solver_container[FLOW_SOL]->GetAllBound_CL_Inv(); + Inv_CD = + solver_container[FLOW_SOL]->GetAllBound_CD_Inv(); + Inv_CSF = + solver_container[FLOW_SOL]->GetAllBound_CSF_Inv(); + Inv_CEff = + solver_container[FLOW_SOL]->GetAllBound_CEff_Inv(); + Inv_CMx = + solver_container[FLOW_SOL]->GetAllBound_CMx_Inv(); + Inv_CMy = + solver_container[FLOW_SOL]->GetAllBound_CMy_Inv(); + Inv_CMz = + solver_container[FLOW_SOL]->GetAllBound_CMz_Inv(); + Inv_CFx = + solver_container[FLOW_SOL]->GetAllBound_CFx_Inv(); + Inv_CFy = + solver_container[FLOW_SOL]->GetAllBound_CFy_Inv(); + Inv_CFz = + solver_container[FLOW_SOL]->GetAllBound_CFz_Inv(); + + /*--- Flow viscous solution coefficients ---*/ + + Visc_CL = + solver_container[FLOW_SOL]->GetAllBound_CL_Visc(); + Visc_CD = + solver_container[FLOW_SOL]->GetAllBound_CD_Visc(); + Visc_CSF = + solver_container[FLOW_SOL]->GetAllBound_CSF_Visc(); + Visc_CEff = + solver_container[FLOW_SOL]->GetAllBound_CEff_Visc(); + Visc_CMx = + solver_container[FLOW_SOL]->GetAllBound_CMx_Visc(); + Visc_CMy = + solver_container[FLOW_SOL]->GetAllBound_CMy_Visc(); + Visc_CMz = + solver_container[FLOW_SOL]->GetAllBound_CMz_Visc(); + Visc_CFx = + solver_container[FLOW_SOL]->GetAllBound_CFx_Visc(); + Visc_CFy = + solver_container[FLOW_SOL]->GetAllBound_CFy_Visc(); + Visc_CFz = + solver_container[FLOW_SOL]->GetAllBound_CFz_Visc(); + + /*--- Flow momentum solution coefficients ---*/ + + Mnt_CL = + solver_container[FLOW_SOL]->GetAllBound_CL_Mnt(); + Mnt_CD = + solver_container[FLOW_SOL]->GetAllBound_CD_Mnt(); + Mnt_CSF = + solver_container[FLOW_SOL]->GetAllBound_CSF_Mnt(); + Mnt_CEff = + solver_container[FLOW_SOL]->GetAllBound_CEff_Mnt(); + Mnt_CMx = + solver_container[FLOW_SOL]->GetAllBound_CMx_Mnt(); + Mnt_CMy = + solver_container[FLOW_SOL]->GetAllBound_CMy_Mnt(); + Mnt_CMz = + solver_container[FLOW_SOL]->GetAllBound_CMz_Mnt(); + Mnt_CFx = + solver_container[FLOW_SOL]->GetAllBound_CFx_Mnt(); + Mnt_CFy = + solver_container[FLOW_SOL]->GetAllBound_CFy_Mnt(); + Mnt_CFz = + solver_container[FLOW_SOL]->GetAllBound_CFz_Mnt(); + + + /*--- Look over the markers being monitored and get the desired values ---*/ + + for (iMarker_Monitoring = 0; + iMarker_Monitoring < config->GetnMarker_Monitoring(); + iMarker_Monitoring++) { + Surface_CL[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CL( + iMarker_Monitoring); + Surface_CD[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CD( + iMarker_Monitoring); + Surface_CSF[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CSF( + iMarker_Monitoring); + Surface_CEff[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CEff( + iMarker_Monitoring); + Surface_CMx[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMx( + iMarker_Monitoring); + Surface_CMy[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMy( + iMarker_Monitoring); + Surface_CMz[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMz( + iMarker_Monitoring); + Surface_CFx[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFx( + iMarker_Monitoring); + Surface_CFy[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFy( + iMarker_Monitoring); + Surface_CFz[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFz( + iMarker_Monitoring); + + Surface_CL_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CL_Inv( + iMarker_Monitoring); + Surface_CD_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CD_Inv( + iMarker_Monitoring); + Surface_CSF_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CSF_Inv( + iMarker_Monitoring); + Surface_CEff_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CEff_Inv( + iMarker_Monitoring); + Surface_CMx_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMx_Inv( + iMarker_Monitoring); + Surface_CMy_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMy_Inv( + iMarker_Monitoring); + Surface_CMz_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMz_Inv( + iMarker_Monitoring); + Surface_CFx_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFx_Inv( + iMarker_Monitoring); + Surface_CFy_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFy_Inv( + iMarker_Monitoring); + Surface_CFz_Inv[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFz_Inv( + iMarker_Monitoring); + Surface_CL_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CL_Visc( + iMarker_Monitoring); + Surface_CD_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CD_Visc( + iMarker_Monitoring); + Surface_CSF_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CSF_Visc( + iMarker_Monitoring); + Surface_CEff_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CEff_Visc( + iMarker_Monitoring); + Surface_CMx_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMx_Visc( + iMarker_Monitoring); + Surface_CMy_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMy_Visc( + iMarker_Monitoring); + Surface_CMz_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMz_Visc( + iMarker_Monitoring); + Surface_CFx_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFx_Visc( + iMarker_Monitoring); + Surface_CFy_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFy_Visc( + iMarker_Monitoring); + Surface_CFz_Visc[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFz_Visc( + iMarker_Monitoring); + + Surface_CL_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CL_Mnt( + iMarker_Monitoring); + Surface_CD_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CD_Mnt( + iMarker_Monitoring); + Surface_CSF_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CSF_Mnt( + iMarker_Monitoring); + Surface_CEff_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CEff_Mnt( + iMarker_Monitoring); + Surface_CMx_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMx_Mnt( + iMarker_Monitoring); + Surface_CMy_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMy_Mnt( + iMarker_Monitoring); + Surface_CMz_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CMz_Mnt( + iMarker_Monitoring); + Surface_CFx_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFx_Mnt( + iMarker_Monitoring); + Surface_CFy_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFy_Mnt( + iMarker_Monitoring); + Surface_CFz_Mnt[iMarker_Monitoring] = + solver_container[FLOW_SOL]->GetSurface_CFz_Mnt( + iMarker_Monitoring); + + } + + + /*--- Write file name with extension ---*/ + + string filename = config->GetBreakdown_FileName(); + strcpy (cstr, filename.data()); + + Breakdown_file.open(cstr, ios::out); + + Breakdown_file << "\n" <<"-------------------------------------------------------------------------" << "\n"; + Breakdown_file <<"| ___ _ _ ___ |" << "\n"; + Breakdown_file <<"| / __| | | |_ ) Release 6.1.0 \"Falcon\" |" << "\n"; + Breakdown_file <<"| \\__ \\ |_| |/ / |" << "\n"; + Breakdown_file <<"| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << "\n"; + Breakdown_file << "| |" << "\n"; + //Breakdown_file << "| Local date and time: " << dt << " |" << "\n"; + Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; + Breakdown_file << "| The current SU2 release has been coordinated by the |" << "\n"; + Breakdown_file << "| SU2 International Developers Society |" << "\n"; + Breakdown_file << "| with selected contributions from the open-source community |" << "\n"; + Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; + Breakdown_file << "| The main research teams contributing to the current release are: |" << "\n"; + Breakdown_file << "| - Prof. Juan J. Alonso's group at Stanford University. |" << "\n"; + Breakdown_file << "| - Prof. Piero Colonna's group at Delft University of Technology. |" << "\n"; + Breakdown_file << "| - Prof. Nicolas R. Gauger's group at Kaiserslautern U. of Technology. |" << "\n"; + Breakdown_file << "| - Prof. Alberto Guardone's group at Polytechnic University of Milan. |" << "\n"; + Breakdown_file << "| - Prof. Rafael Palacios' group at Imperial College London. |" << "\n"; + Breakdown_file << "| - Prof. Vincent Terrapon's group at the University of Liege. |" << "\n"; + Breakdown_file << "| - Prof. Edwin van der Weide's group at the University of Twente. |" << "\n"; + Breakdown_file << "| - Lab. of New Concepts in Aeronautics at Tech. Inst. of Aeronautics. |" << "\n"; + Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; + Breakdown_file << "| Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, |" << "\n"; + Breakdown_file << "| Tim Albring, and the SU2 contributors. |" << "\n"; + Breakdown_file << "| |" << "\n"; + Breakdown_file << "| SU2 is free software; you can redistribute it and/or |" << "\n"; + Breakdown_file << "| modify it under the terms of the GNU Lesser General Public |" << "\n"; + Breakdown_file << "| License as published by the Free Software Foundation; either |" << "\n"; + Breakdown_file << "| version 2.1 of the License, or (at your option) any later version. |" << "\n"; + Breakdown_file << "| |" << "\n"; + Breakdown_file << "| SU2 is distributed in the hope that it will be useful, |" << "\n"; + Breakdown_file << "| but WITHOUT ANY WARRANTY; without even the implied warranty of |" << "\n"; + Breakdown_file << "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |" << "\n"; + Breakdown_file << "| Lesser General Public License for more details. |" << "\n"; + Breakdown_file << "| |" << "\n"; + Breakdown_file << "| You should have received a copy of the GNU Lesser General Public |" << "\n"; + Breakdown_file << "| License along with SU2. If not, see . |" << "\n"; + Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; + + Breakdown_file.precision(6); + + Breakdown_file << "\n" << "\n" << "Problem definition:" << "\n" << "\n"; + + switch (Kind_Solver) { + case EULER: case INC_EULER: + if (compressible) Breakdown_file << "Compressible Euler equations." << "\n"; + if (incompressible) Breakdown_file << "Incompressible Euler equations." << "\n"; + break; + case NAVIER_STOKES: case INC_NAVIER_STOKES: + if (compressible) Breakdown_file << "Compressible Laminar Navier-Stokes' equations." << "\n"; + if (incompressible) Breakdown_file << "Incompressible Laminar Navier-Stokes' equations." << "\n"; + break; + case RANS: case INC_RANS: + if (compressible) Breakdown_file << "Compressible RANS equations." << "\n"; + if (incompressible) Breakdown_file << "Incompressible RANS equations." << "\n"; + Breakdown_file << "Turbulence model: "; + switch (Kind_Turb_Model) { + case SA: Breakdown_file << "Spalart Allmaras" << "\n"; break; + case SA_NEG: Breakdown_file << "Negative Spalart Allmaras" << "\n"; break; + case SA_E: Breakdown_file << "Edwards Spalart Allmaras" << "\n"; break; + case SA_COMP: Breakdown_file << "Compressibility Correction Spalart Allmaras" << "\n"; break; + case SA_E_COMP: Breakdown_file << "Compressibility Correction Edwards Spalart Allmaras" << "\n"; break; + case SST: Breakdown_file << "Menter's SST" << "\n"; break; + case SST_SUST: Breakdown_file << "Menter's SST with sustaining terms" << "\n"; break; + } + break; + } + + + /*--- Compressible version of console output ---*/ + + if (compressible) { + + + if (compressible) { + Breakdown_file << "Mach number: " << config->GetMach() <<"."<< "\n"; + Breakdown_file << "Angle of attack (AoA): " << config->GetAoA() <<" deg, and angle of sideslip (AoS): " << config->GetAoS() <<" deg."<< "\n"; + if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == INC_NAVIER_STOKES) || + (Kind_Solver == RANS) || (Kind_Solver == INC_RANS)) + Breakdown_file << "Reynolds number: " << config->GetReynolds() <<"."<< "\n"; + } + + if (fixed_cl) { + Breakdown_file << "Simulation at a cte. CL: " << config->GetTarget_CL() << ".\n"; + Breakdown_file << "Approx. Delta CL / Delta AoA: " << config->GetdCL_dAlpha() << " (1/deg).\n"; + Breakdown_file << "Approx. Delta CD / Delta CL: " << config->GetdCD_dCL() << ".\n"; + if (nDim == 3 ) { + Breakdown_file << "Approx. Delta CMx / Delta CL: " << config->GetdCMx_dCL() << ".\n"; + Breakdown_file << "Approx. Delta CMy / Delta CL: " << config->GetdCMy_dCL() << ".\n"; + } + Breakdown_file << "Approx. Delta CMz / Delta CL: " << config->GetdCMz_dCL() << ".\n"; + } + + if (Ref_NonDim == DIMENSIONAL) { Breakdown_file << "Dimensional simulation." << "\n"; } + else if (Ref_NonDim == FREESTREAM_PRESS_EQ_ONE) { Breakdown_file << "Non-Dimensional simulation (P=1.0, Rho=1.0, T=1.0 at the farfield)." << "\n"; } + else if (Ref_NonDim == FREESTREAM_VEL_EQ_MACH) { Breakdown_file << "Non-Dimensional simulation (V=Mach, Rho=1.0, T=1.0 at the farfield)." << "\n"; } + else if (Ref_NonDim == FREESTREAM_VEL_EQ_ONE) { Breakdown_file << "Non-Dimensional simulation (V=1.0, Rho=1.0, T=1.0 at the farfield)." << "\n"; } + + if (config->GetSystemMeasurements() == SI) { + Breakdown_file << "The reference area is " << config->GetRefArea() << " m^2." << "\n"; + Breakdown_file << "The reference length is " << config->GetRefLength() << " m." << "\n"; + } + + if (config->GetSystemMeasurements() == US) { + Breakdown_file << "The reference area is " << config->GetRefArea()*12.0*12.0 << " in^2." << "\n"; + Breakdown_file << "The reference length is " << config->GetRefLength()*12.0 << " in." << "\n"; + } + Breakdown_file << "\n" << "\n" <<"Problem definition:" << "\n" << "\n"; + if (compressible) { + if (viscous) { + Breakdown_file << "Viscous flow: Computing pressure using the ideal gas law" << "\n"; + Breakdown_file << "based on the free-stream temperature and a density computed" << "\n"; + Breakdown_file << "from the Reynolds number." << "\n"; + } else { + Breakdown_file << "Inviscid flow: Computing density based on free-stream" << "\n"; + Breakdown_file << "temperature and pressure using the ideal gas law." << "\n"; + } + } + + if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; + else Breakdown_file << "Force coefficients computed using free-stream values." << "\n"; + + if (incompressible) { + Breakdown_file << "Viscous and Inviscid flow: rho_ref, and vel_ref" << "\n"; + Breakdown_file << "are based on the free-stream values, p_ref = rho_ref*vel_ref^2." << "\n"; + Breakdown_file << "The free-stream value of the pressure is 0." << "\n"; + Breakdown_file << "Mach number: "<< config->GetMach() << ", computed using the Bulk modulus." << "\n"; + Breakdown_file << "Angle of attack (deg): "<< config->GetAoA() << ", computed using the the free-stream velocity." << "\n"; + Breakdown_file << "Side slip angle (deg): "<< config->GetAoS() << ", computed using the the free-stream velocity." << "\n"; + if (viscous) Breakdown_file << "Reynolds number: " << config->GetReynolds() << ", computed using free-stream values."<< "\n"; + Breakdown_file << "Only dimensional computation, the grid should be dimensional." << "\n"; + } + + Breakdown_file <<"-- Input conditions:"<< "\n"; + + if (compressible) { + switch (config->GetKind_FluidModel()) { + + case STANDARD_AIR: + Breakdown_file << "Fluid Model: STANDARD_AIR "<< "\n"; + Breakdown_file << "Specific gas constant: " << config->GetGas_Constant(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; + Breakdown_file << "Specific gas constant (non-dim): " << config->GetGas_ConstantND()<< "\n"; + Breakdown_file << "Specific Heat Ratio: 1.4000 "<< "\n"; + break; + + case IDEAL_GAS: + Breakdown_file << "Fluid Model: IDEAL_GAS "<< "\n"; + Breakdown_file << "Specific gas constant: " << config->GetGas_Constant() << " N.m/kg.K." << "\n"; + Breakdown_file << "Specific gas constant (non-dim): " << config->GetGas_ConstantND()<< "\n"; + Breakdown_file << "Specific Heat Ratio: "<< config->GetGamma() << "\n"; + break; + + case VW_GAS: + Breakdown_file << "Fluid Model: Van der Waals "<< "\n"; + Breakdown_file << "Specific gas constant: " << config->GetGas_Constant() << " N.m/kg.K." << "\n"; + Breakdown_file << "Specific gas constant (non-dim): " << config->GetGas_ConstantND()<< "\n"; + Breakdown_file << "Specific Heat Ratio: "<< config->GetGamma() << "\n"; + Breakdown_file << "Critical Pressure: " << config->GetPressure_Critical() << " Pa." << "\n"; + Breakdown_file << "Critical Temperature: " << config->GetTemperature_Critical() << " K." << "\n"; + Breakdown_file << "Critical Pressure (non-dim): " << config->GetPressure_Critical() /config->GetPressure_Ref() << "\n"; + Breakdown_file << "Critical Temperature (non-dim) : " << config->GetTemperature_Critical() /config->GetTemperature_Ref() << "\n"; + break; + + case PR_GAS: + Breakdown_file << "Fluid Model: Peng-Robinson "<< "\n"; + Breakdown_file << "Specific gas constant: " << config->GetGas_Constant() << " N.m/kg.K." << "\n"; + Breakdown_file << "Specific gas constant(non-dim): " << config->GetGas_ConstantND()<< "\n"; + Breakdown_file << "Specific Heat Ratio: "<< config->GetGamma() << "\n"; + Breakdown_file << "Critical Pressure: " << config->GetPressure_Critical() << " Pa." << "\n"; + Breakdown_file << "Critical Temperature: " << config->GetTemperature_Critical() << " K." << "\n"; + Breakdown_file << "Critical Pressure (non-dim): " << config->GetPressure_Critical() /config->GetPressure_Ref() << "\n"; + Breakdown_file << "Critical Temperature (non-dim) : " << config->GetTemperature_Critical() /config->GetTemperature_Ref() << "\n"; + break; + } + + if (viscous) { + + switch (config->GetKind_ViscosityModel()) { + + case CONSTANT_VISCOSITY: + Breakdown_file << "Viscosity Model: CONSTANT_VISCOSITY "<< "\n"; + Breakdown_file << "Laminar Viscosity: " << config->GetMu_Constant(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + Breakdown_file << "Laminar Viscosity (non-dim): " << config->GetMu_ConstantND()<< "\n"; + break; + + case SUTHERLAND: + Breakdown_file << "Viscosity Model: SUTHERLAND "<< "\n"; + Breakdown_file << "Ref. Laminar Viscosity: " << config->GetMu_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + Breakdown_file << "Ref. Temperature: " << config->GetMu_Temperature_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + Breakdown_file << "Sutherland Constant: "<< config->GetMu_S(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + Breakdown_file << "Laminar Viscosity (non-dim): " << config->GetMu_ConstantND()<< "\n"; + Breakdown_file << "Ref. Temperature (non-dim): " << config->GetMu_Temperature_RefND()<< "\n"; + Breakdown_file << "Sutherland constant (non-dim): "<< config->GetMu_SND()<< "\n"; + break; + + } + switch (config->GetKind_ConductivityModel()) { + + case CONSTANT_PRANDTL: + Breakdown_file << "Conductivity Model: CONSTANT_PRANDTL "<< "\n"; + Breakdown_file << "Prandtl: " << config->GetPrandtl_Lam()<< "\n"; + break; + + case CONSTANT_CONDUCTIVITY: + Breakdown_file << "Conductivity Model: CONSTANT_CONDUCTIVITY "<< "\n"; + Breakdown_file << "Molecular Conductivity: " << config->GetKt_Constant()<< " W/m^2.K." << "\n"; + Breakdown_file << "Molecular Conductivity (non-dim): " << config->GetKt_ConstantND()<< "\n"; + break; + + } + + if ((Kind_Solver == RANS) || (Kind_Solver == INC_RANS)) { + switch (config->GetKind_ConductivityModel_Turb()) { + case CONSTANT_PRANDTL_TURB: + Breakdown_file << "Turbulent Conductivity Model: CONSTANT_PRANDTL_TURB "<< "\n"; + Breakdown_file << "Turbulent Prandtl: " << config->GetPrandtl_Turb()<< "\n"; + break; + case NO_CONDUCTIVITY_TURB: + Breakdown_file << "Turbulent Conductivity Model: NO_CONDUCTIVITY_TURB "<< "\n"; + Breakdown_file << "No turbulent component in effective thermal conductivity." << "\n"; + break; + } + } + + } + } + + if (incompressible) { + Breakdown_file << "Bulk modulus: " << config->GetBulk_Modulus(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + Breakdown_file << "Epsilon^2 multiplier of Beta for incompressible preconditioner: " << config->GetBeta_Factor(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + } + + Breakdown_file << "Free-stream static pressure: " << config->GetPressure_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + + Breakdown_file << "Free-stream total pressure: " << config->GetPressure_FreeStream() * pow( 1.0+config->GetMach()*config->GetMach()*0.5*(config->GetGamma()-1.0), config->GetGamma()/(config->GetGamma()-1.0) ); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + + if (compressible) { + Breakdown_file << "Free-stream temperature: " << config->GetTemperature_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + + Breakdown_file << "Free-stream total temperature: " << config->GetTemperature_FreeStream() * (1.0 + config->GetMach() * config->GetMach() * 0.5 * (config->GetGamma() - 1.0)); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + } + + Breakdown_file << "Free-stream density: " << config->GetDensity_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; + + if (nDim == 2) { + Breakdown_file << "Free-stream velocity: (" << config->GetVelocity_FreeStream()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStream()[1] << ")"; + } + if (nDim == 3) { + Breakdown_file << "Free-stream velocity: (" << config->GetVelocity_FreeStream()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStream()[1] << ", " << config->GetVelocity_FreeStream()[2] << ")"; + } + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m/s. "; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft/s. "; + + Breakdown_file << "Magnitude: " << config->GetModVel_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; + + if (compressible) { + Breakdown_file << "Free-stream total energy per unit mass: " << config->GetEnergy_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; + } + + if (viscous) { + Breakdown_file << "Free-stream viscosity: " << config->GetViscosity_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + if (turbulent) { + Breakdown_file << "Free-stream turb. kinetic energy per unit mass: " << config->GetTke_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; + Breakdown_file << "Free-stream specific dissipation: " << config->GetOmega_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " 1/s." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " 1/s." << "\n"; + } + } + + if (unsteady) { Breakdown_file << "Total time: " << config->GetTotal_UnstTime() << " s. Time step: " << config->GetDelta_UnstTime() << " s." << "\n"; } + + /*--- Print out reference values. ---*/ + + Breakdown_file <<"-- Reference values:"<< "\n"; + + if (compressible) { + Breakdown_file << "Reference specific gas constant: " << config->GetGas_Constant_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; + } + + Breakdown_file << "Reference pressure: " << config->GetPressure_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + + if (compressible) { + Breakdown_file << "Reference temperature: " << config->GetTemperature_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + } + + Breakdown_file << "Reference density: " << config->GetDensity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; + + Breakdown_file << "Reference velocity: " << config->GetVelocity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; + + if (compressible) { + Breakdown_file << "Reference energy per unit mass: " << config->GetEnergy_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; + } + + if (incompressible) { + Breakdown_file << "Reference length: " << config->GetLength_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " in." << "\n"; + } + + if (viscous) { + Breakdown_file << "Reference viscosity: " << config->GetViscosity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + if (compressible){ + Breakdown_file << "Reference conductivity: " << config->GetConductivity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " W/m^2.K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf/ft.s.R." << "\n"; + } + } + + + if (unsteady) Breakdown_file << "Reference time: " << config->GetTime_Ref() <<" s." << "\n"; + + /*--- Print out resulting non-dim values here. ---*/ + + Breakdown_file << "-- Resulting non-dimensional state:" << "\n"; + Breakdown_file << "Mach number (non-dim): " << config->GetMach() << "\n"; + if (viscous) { + Breakdown_file << "Reynolds number (non-dim): " << config->GetReynolds() <<". Re length: " << config->GetLength_Reynolds(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft." << "\n"; + } + if (gravity) { + Breakdown_file << "Froude number (non-dim): " << config->GetFroude() << "\n"; + Breakdown_file << "Lenght of the baseline wave (non-dim): " << 2.0*PI_NUMBER*config->GetFroude()*config->GetFroude() << "\n"; + } + + if (compressible) { + Breakdown_file << "Specific gas constant (non-dim): " << config->GetGas_ConstantND() << "\n"; + Breakdown_file << "Free-stream temperature (non-dim): " << config->GetTemperature_FreeStreamND() << "\n"; + } + + Breakdown_file << "Free-stream pressure (non-dim): " << config->GetPressure_FreeStreamND() << "\n"; + + Breakdown_file << "Free-stream density (non-dim): " << config->GetDensity_FreeStreamND() << "\n"; + + if (nDim == 2) { + Breakdown_file << "Free-stream velocity (non-dim): (" << config->GetVelocity_FreeStreamND()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStreamND()[1] << "). "; + } else { + Breakdown_file << "Free-stream velocity (non-dim): (" << config->GetVelocity_FreeStreamND()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStreamND()[1] << ", " << config->GetVelocity_FreeStreamND()[2] << "). "; + } + Breakdown_file << "Magnitude: " << config->GetModVel_FreeStreamND() << "\n"; + + if (compressible) + Breakdown_file << "Free-stream total energy per unit mass (non-dim): " << config->GetEnergy_FreeStreamND() << "\n"; + + if (viscous) { + Breakdown_file << "Free-stream viscosity (non-dim): " << config->GetViscosity_FreeStreamND() << "\n"; + if (turbulent) { + Breakdown_file << "Free-stream turb. kinetic energy (non-dim): " << config->GetTke_FreeStreamND() << "\n"; + Breakdown_file << "Free-stream specific dissipation (non-dim): " << config->GetOmega_FreeStreamND() << "\n"; + } + } + + if (unsteady) { + Breakdown_file << "Total time (non-dim): " << config->GetTotal_UnstTimeND() << "\n"; + Breakdown_file << "Time step (non-dim): " << config->GetDelta_UnstTimeND() << "\n"; + } + + } else { + + /*--- Incompressible version of the console output ---*/ + + bool energy = config->GetEnergy_Equation(); + bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); + + if (config->GetRef_Inc_NonDim() == DIMENSIONAL) { + Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, temp_ref, p_ref" << "\n"; + Breakdown_file << "are set to 1.0 in order to perform a dimensional calculation." << "\n"; + if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; + else Breakdown_file << "Force coefficients computed using initial values." << "\n"; + } + else if (config->GetRef_Inc_NonDim() == INITIAL_VALUES) { + Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, and temp_ref" << "\n"; + Breakdown_file << "are based on the initial values, p_ref = rho_ref*vel_ref^2." << "\n"; + if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; + else Breakdown_file << "Force coefficients computed using initial values." << "\n"; + } + else if (config->GetRef_Inc_NonDim() == REFERENCE_VALUES) { + Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, and temp_ref" << "\n"; + Breakdown_file << "are user-provided reference values, p_ref = rho_ref*vel_ref^2." << "\n"; + if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; + else Breakdown_file << "Force coefficients computed using reference values." << "\n"; + } + Breakdown_file << "The reference area for force coeffs. is " << config->GetRefArea() << " m^2." << "\n"; + Breakdown_file << "The reference length for force coeffs. is " << config->GetRefLength() << " m." << "\n"; + + Breakdown_file << "The pressure is decomposed into thermodynamic and dynamic components." << "\n"; + Breakdown_file << "The initial value of the dynamic pressure is 0." << "\n"; + + Breakdown_file << "Mach number: "<< config->GetMach(); + if (config->GetKind_FluidModel() == CONSTANT_DENSITY) { + Breakdown_file << ", computed using the Bulk modulus." << "\n"; + } else { + Breakdown_file << ", computed using fluid speed of sound." << "\n"; + } + + Breakdown_file << "For external flows, the initial state is imposed at the far-field." << "\n"; + Breakdown_file << "Angle of attack (deg): "<< config->GetAoA() << ", computed using the initial velocity." << "\n"; + Breakdown_file << "Side slip angle (deg): "<< config->GetAoS() << ", computed using the initial velocity." << "\n"; + + if (viscous) { + Breakdown_file << "Reynolds number per meter: " << config->GetReynolds() << ", computed using initial values."<< "\n"; + Breakdown_file << "Reynolds number is a byproduct of inputs only (not used internally)." << "\n"; + } + Breakdown_file << "SI units only. The grid should be dimensional (meters)." << "\n"; + + switch (config->GetKind_DensityModel()) { + + case CONSTANT: + if (energy) Breakdown_file << "Energy equation is active and decoupled." << "\n"; + else Breakdown_file << "No energy equation." << "\n"; + break; + + case BOUSSINESQ: + if (energy) Breakdown_file << "Energy equation is active and coupled through Boussinesq approx." << "\n"; + break; + + case VARIABLE: + if (energy) Breakdown_file << "Energy equation is active and coupled for variable density." << "\n"; + break; + + } + + Breakdown_file <<"-- Input conditions:"<< "\n"; + + switch (config->GetKind_FluidModel()) { + + case CONSTANT_DENSITY: + Breakdown_file << "Fluid Model: CONSTANT_DENSITY "<< "\n"; + if (energy) { + Breakdown_file << "Specific heat at constant pressure (Cp): " << config->GetSpecific_Heat_Cp() << " N.m/kg.K." << "\n"; + } + if (boussinesq) Breakdown_file << "Thermal expansion coefficient: " << config->GetThermal_Expansion_Coeff() << " K^-1." << "\n"; + Breakdown_file << "Thermodynamic pressure not required." << "\n"; + break; + + case INC_IDEAL_GAS: + Breakdown_file << "Fluid Model: INC_IDEAL_GAS "<< endl; + Breakdown_file << "Variable density incompressible flow using ideal gas law." << endl; + Breakdown_file << "Density is a function of temperature (constant thermodynamic pressure)." << endl; + Breakdown_file << "Specific heat at constant pressure (Cp): " << config->GetSpecific_Heat_Cp() << " N.m/kg.K." << endl; + Breakdown_file << "Molecular weight : "<< config->GetMolecular_Weight() << " g/mol" << endl; + Breakdown_file << "Specific gas constant: " << config->GetGas_Constant() << " N.m/kg.K." << endl; + Breakdown_file << "Thermodynamic pressure: " << config->GetPressure_Thermodynamic(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << endl; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << endl; + break; + + case INC_IDEAL_GAS_POLY: + Breakdown_file << "Fluid Model: INC_IDEAL_GAS_POLY "<< endl; + Breakdown_file << "Variable density incompressible flow using ideal gas law." << endl; + Breakdown_file << "Density is a function of temperature (constant thermodynamic pressure)." << endl; + Breakdown_file << "Molecular weight: " << config->GetMolecular_Weight() << " g/mol." << endl; + Breakdown_file << "Specific gas constant: " << config->GetGas_Constant() << " N.m/kg.K." << endl; + Breakdown_file << "Specific gas constant (non-dim): " << config->GetGas_ConstantND() << endl; + Breakdown_file << "Thermodynamic pressure: " << config->GetPressure_Thermodynamic(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << endl; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << endl; + Breakdown_file << "Cp(T) polynomial coefficients: \n ("; + for (unsigned short iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) { + Breakdown_file << config->GetCp_PolyCoeff(iVar); + if (iVar < config->GetnPolyCoeffs()-1) Breakdown_file << ", "; + } + Breakdown_file << ")." << endl; + Breakdown_file << "Cp(T) polynomial coefficients (non-dim.): \n ("; + for (unsigned short iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) { + Breakdown_file << config->GetCp_PolyCoeffND(iVar); + if (iVar < config->GetnPolyCoeffs()-1) Breakdown_file << ", "; + } + Breakdown_file << ")." << endl; + break; + + } + if (viscous) { + switch (config->GetKind_ViscosityModel()) { + + case CONSTANT_VISCOSITY: + Breakdown_file << "Viscosity Model: CONSTANT_VISCOSITY "<< "\n"; + Breakdown_file << "Constant Laminar Viscosity: " << config->GetMu_Constant(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + Breakdown_file << "Laminar Viscosity (non-dim): " << config->GetMu_ConstantND()<< "\n"; + break; + + case SUTHERLAND: + Breakdown_file << "Viscosity Model: SUTHERLAND "<< "\n"; + Breakdown_file << "Ref. Laminar Viscosity: " << config->GetMu_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + Breakdown_file << "Ref. Temperature: " << config->GetMu_Temperature_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + Breakdown_file << "Sutherland Constant: "<< config->GetMu_S(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + Breakdown_file << "Laminar Viscosity (non-dim): " << config->GetMu_ConstantND()<< "\n"; + Breakdown_file << "Ref. Temperature (non-dim): " << config->GetMu_Temperature_RefND()<< "\n"; + Breakdown_file << "Sutherland constant (non-dim): "<< config->GetMu_SND()<< "\n"; + break; + + case POLYNOMIAL_VISCOSITY: + Breakdown_file << "Viscosity Model: POLYNOMIAL_VISCOSITY "<< endl; + Breakdown_file << "Mu(T) polynomial coefficients: \n ("; + for (unsigned short iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) { + Breakdown_file << config->GetMu_PolyCoeff(iVar); + if (iVar < config->GetnPolyCoeffs()-1) Breakdown_file << ", "; + } + Breakdown_file << ")." << endl; + Breakdown_file << "Mu(T) polynomial coefficients (non-dim.): \n ("; + for (unsigned short iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) { + Breakdown_file << config->GetMu_PolyCoeffND(iVar); + if (iVar < config->GetnPolyCoeffs()-1) Breakdown_file << ", "; + } + Breakdown_file << ")." << endl; + break; + + } + + if (energy) { + switch (config->GetKind_ConductivityModel()) { + + case CONSTANT_PRANDTL: + Breakdown_file << "Conductivity Model: CONSTANT_PRANDTL "<< "\n"; + Breakdown_file << "Prandtl (Laminar): " << config->GetPrandtl_Lam()<< "\n"; + break; + + case CONSTANT_CONDUCTIVITY: + Breakdown_file << "Conductivity Model: CONSTANT_CONDUCTIVITY "<< "\n"; + Breakdown_file << "Molecular Conductivity: " << config->GetKt_Constant()<< " W/m^2.K." << "\n"; + Breakdown_file << "Molecular Conductivity (non-dim): " << config->GetKt_ConstantND()<< "\n"; + break; + + case POLYNOMIAL_CONDUCTIVITY: + Breakdown_file << "Viscosity Model: POLYNOMIAL_CONDUCTIVITY "<< endl; + Breakdown_file << "Kt(T) polynomial coefficients: \n ("; + for (unsigned short iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) { + Breakdown_file << config->GetKt_PolyCoeff(iVar); + if (iVar < config->GetnPolyCoeffs()-1) Breakdown_file << ", "; + } + Breakdown_file << ")." << endl; + Breakdown_file << "Kt(T) polynomial coefficients (non-dim.): \n ("; + for (unsigned short iVar = 0; iVar < config->GetnPolyCoeffs(); iVar++) { + Breakdown_file << config->GetKt_PolyCoeffND(iVar); + if (iVar < config->GetnPolyCoeffs()-1) Breakdown_file << ", "; + } + Breakdown_file << ")." << endl; + break; + + } + + if ((Kind_Solver == RANS) || (Kind_Solver == ADJ_RANS) || (Kind_Solver == DISC_ADJ_RANS)) { + switch (config->GetKind_ConductivityModel_Turb()) { + case CONSTANT_PRANDTL_TURB: + Breakdown_file << "Turbulent Conductivity Model: CONSTANT_PRANDTL_TURB "<< "\n"; + Breakdown_file << "Turbulent Prandtl: " << config->GetPrandtl_Turb()<< "\n"; + break; + case NO_CONDUCTIVITY_TURB: + Breakdown_file << "Turbulent Conductivity Model: NO_CONDUCTIVITY_TURB "<< "\n"; + Breakdown_file << "No turbulent component in effective thermal conductivity." << "\n"; + break; + } + } + + } + + } + + if (config->GetKind_FluidModel() == CONSTANT_DENSITY) { + Breakdown_file << "Bulk modulus: " << config->GetBulk_Modulus(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + } + + Breakdown_file << "Initial dynamic pressure: " << config->GetPressure_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + + Breakdown_file << "Initial total pressure: " << config->GetPressure_FreeStream() + 0.5*config->GetDensity_FreeStream()*config->GetModVel_FreeStream()*config->GetModVel_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + + if (energy) { + Breakdown_file << "Initial temperature: " << config->GetTemperature_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + } + + Breakdown_file << "Initial density: " << config->GetDensity_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; + + if (nDim == 2) { + Breakdown_file << "Initial velocity: (" << config->GetVelocity_FreeStream()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStream()[1] << ")"; + } + if (nDim == 3) { + Breakdown_file << "Initial velocity: (" << config->GetVelocity_FreeStream()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStream()[1] << ", " << config->GetVelocity_FreeStream()[2] << ")"; + } + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m/s. "; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft/s. "; + + Breakdown_file << "Magnitude: " << config->GetModVel_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; + + if (viscous) { + Breakdown_file << "Initial laminar viscosity: " << config->GetViscosity_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + if (turbulent) { + Breakdown_file << "Initial turb. kinetic energy per unit mass: " << config->GetTke_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; + Breakdown_file << "Initial specific dissipation: " << config->GetOmega_FreeStream(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " 1/s." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " 1/s." << "\n"; + } + } + + if (unsteady) { Breakdown_file << "Total time: " << config->GetTotal_UnstTime() << " s. Time step: " << config->GetDelta_UnstTime() << " s." << "\n"; } + + /*--- Print out reference values. ---*/ + + Breakdown_file <<"-- Reference values:"<< "\n"; + + if (config->GetKind_FluidModel() != CONSTANT_DENSITY) { + Breakdown_file << "Reference specific gas constant: " << config->GetGas_Constant_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; + } else { + if (energy) { + Breakdown_file << "Reference specific heat: " << config->GetGas_Constant_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; + } + } + + Breakdown_file << "Reference pressure: " << config->GetPressure_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; + + if (energy) { + Breakdown_file << "Reference temperature: " << config->GetTemperature_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; + } + + Breakdown_file << "Reference density: " << config->GetDensity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; + + Breakdown_file << "Reference velocity: " << config->GetVelocity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; + + Breakdown_file << "Reference length: " << config->GetLength_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " in." << "\n"; + + if (viscous) { + Breakdown_file << "Reference viscosity: " << config->GetViscosity_Ref(); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; + else if (config->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; + } + + if (unsteady) Breakdown_file << "Reference time: " << config->GetTime_Ref() <<" s." << "\n"; + + /*--- Print out resulting non-dim values here. ---*/ + + Breakdown_file << "-- Resulting non-dimensional state:" << "\n"; + Breakdown_file << "Mach number (non-dim): " << config->GetMach() << "\n"; + if (viscous) { + Breakdown_file << "Reynolds number (per m): " << config->GetReynolds() << "\n"; + } + + if (config->GetKind_FluidModel() != CONSTANT_DENSITY) { + Breakdown_file << "Specific gas constant (non-dim): " << config->GetGas_ConstantND() << "\n"; + Breakdown_file << "Initial thermodynamic pressure (non-dim): " << config->GetPressure_ThermodynamicND() << "\n"; + } else { + if (energy) { + Breakdown_file << "Specific heat at constant pressure (non-dim): " << config->GetSpecific_Heat_CpND() << "\n"; + if (boussinesq) Breakdown_file << "Thermal expansion coefficient (non-dim.): " << config->GetThermal_Expansion_CoeffND() << " K^-1." << "\n"; + } + } + + if (energy) Breakdown_file << "Initial temperature (non-dim): " << config->GetTemperature_FreeStreamND() << "\n"; + Breakdown_file << "Initial pressure (non-dim): " << config->GetPressure_FreeStreamND() << "\n"; + Breakdown_file << "Initial density (non-dim): " << config->GetDensity_FreeStreamND() << "\n"; + + if (nDim == 2) { + Breakdown_file << "Initial velocity (non-dim): (" << config->GetVelocity_FreeStreamND()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStreamND()[1] << "). "; + } else { + Breakdown_file << "Initial velocity (non-dim): (" << config->GetVelocity_FreeStreamND()[0] << ", "; + Breakdown_file << config->GetVelocity_FreeStreamND()[1] << ", " << config->GetVelocity_FreeStreamND()[2] << "). "; + } + Breakdown_file << "Magnitude: " << config->GetModVel_FreeStreamND() << "\n"; + + if (viscous) { + Breakdown_file << "Initial viscosity (non-dim): " << config->GetViscosity_FreeStreamND() << "\n"; + if (turbulent) { + Breakdown_file << "Initial turb. kinetic energy (non-dim): " << config->GetTke_FreeStreamND() << "\n"; + Breakdown_file << "Initial specific dissipation (non-dim): " << config->GetOmega_FreeStreamND() << "\n"; + } + } + + if (unsteady) { + Breakdown_file << "Total time (non-dim): " << config->GetTotal_UnstTimeND() << "\n"; + Breakdown_file << "Time step (non-dim): " << config->GetDelta_UnstTimeND() << "\n"; + } + + } + + /*--- Begin forces breakdown info. ---*/ + + Breakdown_file << fixed; + Breakdown_file << "\n" << "\n" <<"Forces breakdown:" << "\n" << "\n"; + + if (nDim == 3) { + su2double m = solver_container[FLOW_SOL]->GetTotal_CFz()/solver_container[FLOW_SOL]->GetTotal_CFx(); + su2double term = (Total_CoPz/m)-Total_CoPx; + + if (term > 0) Breakdown_file << "Center of Pressure: X=" << 1/m <<"Z-"<< term << "." << "\n\n"; + else Breakdown_file << "Center of Pressure: X=" << 1/m <<"Z+"<< fabs(term); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n\n"; + else Breakdown_file << " in." << "\n\n"; + } + else { + su2double m = solver_container[FLOW_SOL]->GetTotal_CFy()/solver_container[FLOW_SOL]->GetTotal_CFx(); + su2double term = (Total_CoPy/m)-Total_CoPx; + if (term > 0) Breakdown_file << "Center of Pressure: X=" << 1/m <<"Y-"<< term << "." << "\n\n"; + else Breakdown_file << "Center of Pressure: X=" << 1/m <<"Y+"<< fabs(term); + if (config->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n\n"; + else Breakdown_file << " in." << "\n\n"; + } + + /*--- Reference area and force factors. ---*/ + + su2double RefDensity, RefArea, RefVel, Factor, Ref; + RefArea = config->GetRefArea(); + if (compressible) { + RefDensity = solver_container[FLOW_SOL]->GetDensity_Inf(); + RefVel = solver_container[FLOW_SOL]->GetModVelocity_Inf(); + } else { + if ((config->GetRef_Inc_NonDim() == DIMENSIONAL) || + (config->GetRef_Inc_NonDim() == INITIAL_VALUES)) { + RefDensity = solver_container[FLOW_SOL]->GetDensity_Inf(); + RefVel = 0.0; + for (iDim = 0; iDim < nDim; iDim++) + RefVel += solver_container[FLOW_SOL]->GetVelocity_Inf(iDim)*solver_container[FLOW_SOL]->GetVelocity_Inf(iDim); + RefVel = sqrt(RefVel); + } else { + RefDensity = config->GetInc_Density_Ref(); + RefVel = config->GetInc_Velocity_Ref(); + } + } + Factor = (0.5*RefDensity*RefArea*RefVel*RefVel); + Ref = config->GetDensity_Ref() * config->GetVelocity_Ref() * config->GetVelocity_Ref() * 1.0 * 1.0; + + Breakdown_file << "NOTE: Multiply forces by the non-dimensional factor: " << Factor << ", and the reference factor: " << Ref << "\n"; + Breakdown_file << "to obtain the dimensional force." << "\n" << "\n"; + + Breakdown_file << "Total CL: "; + Breakdown_file.width(11); + Breakdown_file << Total_CL; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CL * 100.0) / (Total_CL + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CL; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CL * 100.0) / (Total_CL + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CL; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CL * 100.0) / (Total_CL + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CL << "\n"; + + Breakdown_file << "Total CD: "; + Breakdown_file.width(11); + Breakdown_file << Total_CD; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CD * 100.0) / (Total_CD + EPS)) << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CD; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CD * 100.0) / (Total_CD + EPS)) << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CD; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CD * 100.0) / (Total_CD + EPS)) << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CD << "\n"; + + if (nDim == 3) { + Breakdown_file << "Total CSF: "; + Breakdown_file.width(11); + Breakdown_file << Total_CSF; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CSF * 100.0) / (Total_CSF + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CSF; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CSF * 100.0) / (Total_CSF + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CSF; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CSF * 100.0) / (Total_CSF + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CSF << "\n"; + } + + Breakdown_file << "Total CL/CD: "; + Breakdown_file.width(11); + Breakdown_file << Total_CEff; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CEff * 100.0) / (Total_CEff + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CEff; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CEff * 100.0) / (Total_CEff + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CEff; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CEff * 100.0) / (Total_CEff + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CEff << "\n"; + + if (nDim == 3) { + Breakdown_file << "Total CMx: "; + Breakdown_file.width(11); + Breakdown_file << Total_CMx; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CMx * 100.0) / (Total_CMx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CMx; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CMx * 100.0) / (Total_CMx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CMx; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CMx * 100.0) / (Total_CMx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CMx << "\n"; + + Breakdown_file << "Total CMy: "; + Breakdown_file.width(11); + Breakdown_file << Total_CMy; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CMy * 100.0) / (Total_CMy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CMy; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CMy * 100.0) / (Total_CMy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CMy; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CMz * 100.0) / (Total_CMz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CMy << "\n"; + } + + Breakdown_file << "Total CMz: "; + Breakdown_file.width(11); + Breakdown_file << Total_CMz; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CMz * 100.0) / (Total_CMz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CMz; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CMz * 100.0) / (Total_CMz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CMz; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CMz * 100.0) / (Total_CMz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CMz << "\n"; + + Breakdown_file << "Total CFx: "; + Breakdown_file.width(11); + Breakdown_file << Total_CFx; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CFx * 100.0) / (Total_CFx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CFx; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CFx * 100.0) / (Total_CFx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CFx; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CFx * 100.0) / (Total_CFx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CFx << "\n"; + + Breakdown_file << "Total CFy: "; + Breakdown_file.width(11); + Breakdown_file << Total_CFy; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CFy * 100.0) / (Total_CFy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CFy; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CFy * 100.0) / (Total_CFy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CFy; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CFy * 100.0) / (Total_CFy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CFy << "\n"; + + if (nDim == 3) { + Breakdown_file << "Total CFz: "; + Breakdown_file.width(11); + Breakdown_file << Total_CFz; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Inv_CFz * 100.0) / (Total_CFz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Inv_CFz; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Visc_CFz * 100.0) / (Total_CFz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Visc_CFz; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file << SU2_TYPE::Int((Mnt_CFz * 100.0) / (Total_CFz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Mnt_CFz << "\n"; + } + + Breakdown_file << "\n" << "\n"; + + for (iMarker_Monitoring = 0; + iMarker_Monitoring < config->GetnMarker_Monitoring(); + iMarker_Monitoring++) { + + Breakdown_file << "Surface name: " + << config->GetMarker_Monitoring_TagBound( + iMarker_Monitoring) << "\n" << "\n"; + + Breakdown_file << "Total CL ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CL[iMarker_Monitoring] * 100.0) + / (Total_CL + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CL[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CL_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CL[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CL_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CL_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CL[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CL_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CL_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CL[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CL_Mnt[iMarker_Monitoring] << "\n"; + + Breakdown_file << "Total CD ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CD[iMarker_Monitoring] * 100.0) + / (Total_CD + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CD[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CD_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CD[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CD_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CD_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CD[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CD_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CD_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CD[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CD_Mnt[iMarker_Monitoring] << "\n"; + + if (nDim == 3) { + Breakdown_file << "Total CSF ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CSF[iMarker_Monitoring] * 100.0) + / (Total_CSF + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CSF[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CSF_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CSF[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CSF_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CSF_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CSF[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CSF_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CSF_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CSF[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CSF_Mnt[iMarker_Monitoring] << "\n"; + } + + Breakdown_file << "Total CL/CD ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CEff[iMarker_Monitoring] * 100.0) / (Total_CEff + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CEff[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CEff_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CEff[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CEff_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CEff_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CEff[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CEff_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CEff_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CEff[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CEff_Mnt[iMarker_Monitoring] << "\n"; + + if (nDim == 3) { + + Breakdown_file << "Total CMx ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMx[iMarker_Monitoring] * 100.0) / (Total_CMx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CMx[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMx_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CMx[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CMx_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMx_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CMx[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CMx_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMx_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CMx[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CMx_Mnt[iMarker_Monitoring] << "\n"; + + Breakdown_file << "Total CMy ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMy[iMarker_Monitoring] * 100.0) / (Total_CMy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CMy[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMy_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CMy[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CMy_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMy_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CMy[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CMy_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMy_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CMy[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CMy_Mnt[iMarker_Monitoring] << "\n"; + } + + Breakdown_file << "Total CMz ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int((Surface_CMz[iMarker_Monitoring] * 100.0) / (Total_CMz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CMz[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMz_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CMz[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CMz_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMz_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CMz[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CMz_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CMz_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CMz[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CMz_Mnt[iMarker_Monitoring] << "\n"; + + Breakdown_file << "Total CFx ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int((Surface_CFx[iMarker_Monitoring] * 100.0) / (Total_CFx + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CFx[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFx_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CFx[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CFx_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFx_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CFx[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CFx_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFx_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CFx[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CFx_Mnt[iMarker_Monitoring] << "\n"; + + Breakdown_file << "Total CFy ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int((Surface_CFy[iMarker_Monitoring] * 100.0) / (Total_CFy + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CFy[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFy_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CFy[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CFy_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFy_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CFy[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CFy_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFy_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CFy[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CFy_Mnt[iMarker_Monitoring] << "\n"; + + if (nDim == 3) { + Breakdown_file << "Total CFz ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFz[iMarker_Monitoring] * 100.0) / (Total_CFz + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CFz[iMarker_Monitoring]; + Breakdown_file << " | Pressure ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFz_Inv[iMarker_Monitoring] * 100.0) + / (Surface_CFz[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file << Surface_CFz_Inv[iMarker_Monitoring]; + Breakdown_file << " | Friction ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFz_Visc[iMarker_Monitoring] * 100.0) + / (Surface_CFz[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CFz_Visc[iMarker_Monitoring]; + Breakdown_file << " | Momentum ("; + Breakdown_file.width(5); + Breakdown_file + << SU2_TYPE::Int( + (Surface_CFz_Mnt[iMarker_Monitoring] * 100.0) + / (Surface_CFz[iMarker_Monitoring] + EPS)); + Breakdown_file << "%): "; + Breakdown_file.width(11); + Breakdown_file + << Surface_CFz_Mnt[iMarker_Monitoring] << "\n"; + + } + + Breakdown_file << "\n"; + + + } + + delete [] Surface_CL; + delete [] Surface_CD; + delete [] Surface_CSF; + delete [] Surface_CEff; + delete [] Surface_CFx; + delete [] Surface_CFy; + delete [] Surface_CFz; + delete [] Surface_CMx; + delete [] Surface_CMy; + delete [] Surface_CMz; + + delete [] Surface_CL_Inv; + delete [] Surface_CD_Inv; + delete [] Surface_CSF_Inv; + delete [] Surface_CEff_Inv; + delete [] Surface_CFx_Inv; + delete [] Surface_CFy_Inv; + delete [] Surface_CFz_Inv; + delete [] Surface_CMx_Inv; + delete [] Surface_CMy_Inv; + delete [] Surface_CMz_Inv; + + delete [] Surface_CL_Visc; + delete [] Surface_CD_Visc; + delete [] Surface_CSF_Visc; + delete [] Surface_CEff_Visc; + delete [] Surface_CFx_Visc; + delete [] Surface_CFy_Visc; + delete [] Surface_CFz_Visc; + delete [] Surface_CMx_Visc; + delete [] Surface_CMy_Visc; + delete [] Surface_CMz_Visc; + + delete [] Surface_CL_Mnt; + delete [] Surface_CD_Mnt; + delete [] Surface_CSF_Mnt; + delete [] Surface_CEff_Mnt; + delete [] Surface_CFx_Mnt; + delete [] Surface_CFy_Mnt; + delete [] Surface_CFz_Mnt; + delete [] Surface_CMx_Mnt; + delete [] Surface_CMy_Mnt; + delete [] Surface_CMz_Mnt; + + Breakdown_file.close(); + + } + +} + + +bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter){ + + if (config->GetTime_Domain()){ + if (((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_STEPPING)) && + ((Iter == 0) || (Iter % config->GetVolume_Wrt_Freq() == 0))){ + return true; + } + + if ((config->GetTime_Marching() == DT_STEPPING_2ND) && + ((Iter == 0) || (Iter % config->GetVolume_Wrt_Freq() == 0) || + ((Iter+1) % config->GetVolume_Wrt_Freq() == 0) || + ((Iter+2 == config->GetnTime_Iter())))){ + return true; + } + } else { + return ((Iter > 0) && Iter % config->GetVolume_Wrt_Freq() == 0); + } + + return false; +} + +void CFlowOutput::SetTimeAveragedFields(){ + AddVolumeOutput("MEAN_DENSITY", "MeanDensity", "TIME_AVERAGE", "Mean density"); + AddVolumeOutput("MEAN_VELOCITY-X", "MeanVelocity_x", "TIME_AVERAGE", "Mean velocity x-component"); + AddVolumeOutput("MEAN_VELOCITY-Y", "MeanVelocity_y", "TIME_AVERAGE", "Mean velocity y-component"); + if (nDim == 3) + AddVolumeOutput("MEAN_VELOCITY-Z", "MeanVelocity_z", "TIME_AVERAGE", "Mean velocity z-component"); + + AddVolumeOutput("MEAN_PRESSURE", "MeanPressure", "TIME_AVERAGE", "Mean pressure"); + AddVolumeOutput("RMS_U", "RMS[u]", "TIME_AVERAGE", "RMS u"); + AddVolumeOutput("RMS_V", "RMS[v]", "TIME_AVERAGE", "RMS v"); + AddVolumeOutput("RMS_UV", "RMS[uv]", "TIME_AVERAGE", "RMS uv"); + AddVolumeOutput("RMS_P", "RMS[Pressure]", "TIME_AVERAGE", "RMS Pressure"); + AddVolumeOutput("UUPRIME", "u'u'", "TIME_AVERAGE", "Mean Reynolds-stress component u'u'"); + AddVolumeOutput("VVPRIME", "v'v'", "TIME_AVERAGE", "Mean Reynolds-stress component v'v'"); + AddVolumeOutput("UVPRIME", "u'v'", "TIME_AVERAGE", "Mean Reynolds-stress component u'v'"); + AddVolumeOutput("PPRIME", "p'p'", "TIME_AVERAGE", "Mean pressure fluctuation p'p'"); + if (nDim == 3){ + AddVolumeOutput("RMS_W", "RMS[w]", "TIME_AVERAGE", "RMS u"); + AddVolumeOutput("RMS_UW", "RMS[uw]", "TIME_AVERAGE", "RMS uw"); + AddVolumeOutput("RMS_VW", "RMS[vw]", "TIME_AVERAGE", "RMS vw"); + AddVolumeOutput("WWPRIME", "w'w'", "TIME_AVERAGE", "Mean Reynolds-stress component w'w'"); + AddVolumeOutput("UWPRIME", "w'u'", "TIME_AVERAGE", "Mean Reynolds-stress component w'u'"); + AddVolumeOutput("VWPRIME", "w'v'", "TIME_AVERAGE", "Mean Reynolds-stress component w'v'"); + } +} + +void CFlowOutput::LoadTimeAveragedData(unsigned long iPoint, CVariable *Node_Flow){ + SetAvgVolumeOutputValue("MEAN_DENSITY", iPoint, Node_Flow->GetDensity()); + SetAvgVolumeOutputValue("MEAN_VELOCITY-X", iPoint, Node_Flow->GetVelocity(0)); + SetAvgVolumeOutputValue("MEAN_VELOCITY-Y", iPoint, Node_Flow->GetVelocity(1)); + if (nDim == 3) + SetAvgVolumeOutputValue("MEAN_VELOCITY-Z", iPoint, Node_Flow->GetVelocity(2)); + + SetAvgVolumeOutputValue("MEAN_PRESSURE", iPoint, Node_Flow->GetPressure()); + + SetAvgVolumeOutputValue("RMS_U", iPoint, pow(Node_Flow->GetVelocity(0),2)); + SetAvgVolumeOutputValue("RMS_V", iPoint, pow(Node_Flow->GetVelocity(1),2)); + SetAvgVolumeOutputValue("RMS_UV", iPoint, Node_Flow->GetVelocity(0) * Node_Flow->GetVelocity(1)); + SetAvgVolumeOutputValue("RMS_P", iPoint, pow(Node_Flow->GetPressure(),2)); + if (nDim == 3){ + SetAvgVolumeOutputValue("RMS_W", iPoint, pow(Node_Flow->GetVelocity(2),2)); + SetAvgVolumeOutputValue("RMS_VW", iPoint, Node_Flow->GetVelocity(2) * Node_Flow->GetVelocity(1)); + SetAvgVolumeOutputValue("RMS_UW", iPoint, Node_Flow->GetVelocity(2) * Node_Flow->GetVelocity(0)); + } + + const su2double umean = GetVolumeOutputValue("MEAN_VELOCITY-X", iPoint); + const su2double uumean = GetVolumeOutputValue("RMS_U", iPoint); + const su2double vmean = GetVolumeOutputValue("MEAN_VELOCITY-Y", iPoint); + const su2double vvmean = GetVolumeOutputValue("RMS_V", iPoint); + const su2double uvmean = GetVolumeOutputValue("RMS_UV", iPoint); + const su2double pmean = GetVolumeOutputValue("MEAN_PRESSURE", iPoint); + const su2double ppmean = GetVolumeOutputValue("RMS_P", iPoint); + + SetVolumeOutputValue("UUPRIME", iPoint, -(umean*umean - uumean)); + SetVolumeOutputValue("VVPRIME", iPoint, -(vmean*vmean - vvmean)); + SetVolumeOutputValue("UVPRIME", iPoint, -(umean*vmean - uvmean)); + SetVolumeOutputValue("PPRIME", iPoint, -(pmean*pmean - ppmean)); + if (nDim == 3){ + const su2double wmean = GetVolumeOutputValue("MEAN_VELOCITY-Z", iPoint); + const su2double wwmean = GetVolumeOutputValue("RMS_W", iPoint); + const su2double uwmean = GetVolumeOutputValue("RMS_UW", iPoint); + const su2double vwmean = GetVolumeOutputValue("RMS_VW", iPoint); + SetVolumeOutputValue("WWPRIME", iPoint, -(wmean*wmean - wwmean)); + SetVolumeOutputValue("UWPRIME", iPoint, -(umean*wmean - uwmean)); + SetVolumeOutputValue("VWPRIME", iPoint, -(vmean*wmean - vwmean)); + } +} diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp new file mode 100644 index 000000000000..2e51d7387403 --- /dev/null +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -0,0 +1,160 @@ +/*! + * \file output_heat.cpp + * \brief Main subroutines for the heat solver output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CHeatOutput.hpp" +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +CHeatOutput::CHeatOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + multiZone = config->GetMultizone_Problem(); + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + requestedHistoryFields.emplace_back("RMS_RES"); + nRequestedHistoryFields = requestedHistoryFields.size(); + } + if (nRequestedScreenFields == 0){ + requestedScreenFields.emplace_back("OUTER_ITER"); + requestedScreenFields.emplace_back("INNER_ITER"); + requestedScreenFields.emplace_back("RMS_TEMPERATURE"); + nRequestedScreenFields = requestedScreenFields.size(); + } + if (nRequestedVolumeFields == 0){ + requestedVolumeFields.emplace_back("COORDINATES"); + requestedVolumeFields.emplace_back("SOLUTION"); + nRequestedVolumeFields = requestedVolumeFields.size(); + } + + stringstream ss; + ss << "Zone " << config->GetiZone() << " (Solid Heat)"; + multiZoneHeaderString = ss.str(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetVolume_FileName(); + + /*--- Set the surface filename --- */ + + surfaceFilename = config->GetSurfCoeff_FileName(); + + /*--- Set the restart filename --- */ + + restartFilename = config->GetRestart_FileName(); + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("RMS_TEMPERATURE"); + + +} + +CHeatOutput::~CHeatOutput(void) {} + +void CHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { + + CSolver* heat_solver = solver[HEAT_SOL]; + + SetHistoryOutputValue("HEATFLUX", heat_solver->GetTotal_HeatFlux()); + SetHistoryOutputValue("HEATFLUX_MAX", heat_solver->GetTotal_MaxHeatFlux()); + SetHistoryOutputValue("AVG_TEMPERATURE", heat_solver->GetTotal_AvgTemperature()); + SetHistoryOutputValue("RMS_TEMPERATURE", log10(heat_solver->GetRes_RMS(0))); + SetHistoryOutputValue("MAX_TEMPERATURE", log10(heat_solver->GetRes_Max(0))); + if (multiZone) + SetHistoryOutputValue("BGS_TEMPERATURE", log10(heat_solver->GetRes_BGS(0))); + + SetHistoryOutputValue("LINSOL_ITER", heat_solver->GetIterLinSolver()); + SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + +} + + +void CHeatOutput::SetHistoryOutputFields(CConfig *config){ + + AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL_ITER", "Linear solver iterations"); + + AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root mean square residual of the temperature", HistoryFieldType::RESIDUAL); + AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature", HistoryFieldType::RESIDUAL); + AddHistoryOutput("BGS_TEMPERATURE", "bgs[T]", ScreenOutputFormat::FIXED, "BGS_RES", "Block-Gauss seidel residual of the temperature", HistoryFieldType::RESIDUAL); + + AddHistoryOutput("HEATFLUX", "HF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total heatflux on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + AddHistoryOutput("HEATFLUX_MAX", "MaxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total maximal heatflux on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + AddHistoryOutput("AVG_TEMPERATURE", "AvgTemp", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Total average temperature on all surfaces defined in MARKER_MONITORING", HistoryFieldType::COEFFICIENT); + AddHistoryOutput("CFL_NUMBER", "CFL number", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current value of the CFL number"); + +} + + +void CHeatOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES","z-component of the coordinate vector"); + + // SOLUTION + AddVolumeOutput("TEMPERATURE", "Temperature", "SOLUTION", "Temperature"); + + // Residuals + AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "RMS residual of the temperature"); + +} + + +void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CVariable* Node_Heat = solver[HEAT_SOL]->node[iPoint]; + + CPoint* Node_Geo = geometry->node[iPoint]; + + // Grid coordinates + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + + // SOLUTION + SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(0)); + + // Residuals + SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[HEAT_SOL]->LinSysRes.GetBlock(iPoint, 0)); + +} + diff --git a/SU2_CFD/src/output/CMeshOutput.cpp b/SU2_CFD/src/output/CMeshOutput.cpp new file mode 100644 index 000000000000..4d160a244148 --- /dev/null +++ b/SU2_CFD/src/output/CMeshOutput.cpp @@ -0,0 +1,80 @@ +/*! + * \file output_mesh.cpp + * \brief Main subroutines for the heat solver output + * \author R. Sanchez + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CMeshOutput.hpp" +#include "../../../Common/include/geometry_structure.hpp" + +CMeshOutput::CMeshOutput(CConfig *config, unsigned short nDim) : COutput(config, nDim, false) { + + /*--- Set the default history fields if nothing is set in the config file ---*/ + + requestedVolumeFields.emplace_back("COORDINATES"); + nRequestedVolumeFields = requestedVolumeFields.size(); + + /*--- Set the volume filename --- */ + + volumeFilename = config->GetMesh_Out_FileName(); + + /*--- Set the surface filename ---*/ + + surfaceFilename = "surface_mesh"; + +} + +CMeshOutput::~CMeshOutput(void) {} + +void CMeshOutput::SetVolumeOutputFields(CConfig *config){ + + // Grid coordinates + AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); + AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); + if (nDim == 3) + AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); + + +} + +void CMeshOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ + + CPoint* Node_Geo = geometry->node[iPoint]; + + SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(0)); + SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(1)); + if (nDim == 3) + SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(2)); + +} diff --git a/SU2_CFD/src/output/CMultizoneOutput.cpp b/SU2_CFD/src/output/CMultizoneOutput.cpp new file mode 100644 index 000000000000..167e22451e9f --- /dev/null +++ b/SU2_CFD/src/output/CMultizoneOutput.cpp @@ -0,0 +1,219 @@ +/*! + * \file CMultizoneOutput.cpp + * \brief Main subroutines for multizone output + * \author R. Sanchez, T. Albring + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/CMultizoneOutput.hpp" + +CMultizoneOutput::CMultizoneOutput(CConfig* driver_config, CConfig** config, unsigned short nDim) : COutput(driver_config, nDim, false) { + + unsigned short iZone = 0; + rank = SU2_MPI::GetRank(); + size = SU2_MPI::GetSize(); + + nZone = driver_config->GetnZone(); + + fieldWidth = 12; + + bgs_res_name = "BGS_RES"; + + write_zone = false; + + /*--- If the zone output is disabled for every zone ---*/ + for (iZone = 0; iZone < nZone; iZone++){ + write_zone = config[iZone]->GetWrt_ZoneConv(); + } + + if (nRequestedHistoryFields == 0){ + requestedHistoryFields.emplace_back("ITER"); + for (iZone = 0; iZone < nZone; iZone++){ + requestedHistoryFields.emplace_back(bgs_res_name + "[" + PrintingToolbox::to_string(iZone) + "]"); + requestedHistoryFields.emplace_back("AVG_RES[" + PrintingToolbox::to_string(iZone) + "]"); + } + nRequestedHistoryFields = requestedHistoryFields.size(); + } + + if (nRequestedScreenFields == 0){ + if (config[ZONE_0]->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); + requestedScreenFields.emplace_back("OUTER_ITER"); + for (iZone = 0; iZone < nZone; iZone++){ + requestedScreenFields.emplace_back("AVG_" + bgs_res_name + "[" + PrintingToolbox::to_string(iZone) + "]"); + } + nRequestedScreenFields = requestedScreenFields.size(); + } + + multiZoneHeaderString = "Multizone Summary"; + + historyFilename = "multizone_history"; + + /*--- Add the correct file extension depending on the file format ---*/ + + string hist_ext = ".csv"; + if (driver_config->GetTabular_FileFormat() == TAB_TECPLOT) hist_ext = ".dat"; + + historyFilename += hist_ext; + + /*--- Set the default convergence field --- */ + + if (convFields.empty() ) convFields.emplace_back("AVG_BGS_RES[0]"); + +} + +CMultizoneOutput::~CMultizoneOutput() {} + + +void CMultizoneOutput::LoadMultizoneHistoryData(COutput **output, CConfig **config) { + + unsigned short iZone, iField, nField; + string name, header; + + for (iZone = 0; iZone < nZone; iZone++){ + + map ZoneHistoryFields = output[iZone]->GetHistoryFields(); + vector ZoneHistoryNames = output[iZone]->GetHistoryOutput_List(); + + nField = ZoneHistoryNames.size(); + + + /*-- For all the variables per solver --*/ + for (iField = 0; iField < nField; iField++){ + + if (ZoneHistoryNames[iField] != "TIME_ITER" && ZoneHistoryNames[iField] != "OUTER_ITER"){ + + name = ZoneHistoryNames[iField]+ "[" + PrintingToolbox::to_string(iZone) + "]"; + + SetHistoryOutputValue(name, ZoneHistoryFields[ZoneHistoryNames[iField]].value); + + } + } + } +} + +void CMultizoneOutput::SetMultizoneHistoryOutputFields(COutput **output, CConfig **config) { + + unsigned short iZone, iField, nField; + string name, header, group; + + /*--- Set the fields ---*/ + for (iZone = 0; iZone < nZone; iZone++){ + + map ZoneHistoryFields = output[iZone]->GetHistoryFields(); + vector ZoneHistoryNames = output[iZone]->GetHistoryOutput_List(); + + nField = ZoneHistoryNames.size(); + + + /*-- For all the variables per solver --*/ + for (iField = 0; iField < nField; iField++){ + + if (ZoneHistoryNames[iField] != "TIME_ITER" && ZoneHistoryNames[iField] != "OUTER_ITER"){ + + name = ZoneHistoryNames[iField]+ "[" + PrintingToolbox::to_string(iZone) + "]"; + header = ZoneHistoryFields[ZoneHistoryNames[iField]].fieldName + "[" + PrintingToolbox::to_string(iZone) + "]"; + group = ZoneHistoryFields[ZoneHistoryNames[iField]].outputGroup + "[" + PrintingToolbox::to_string(iZone) + "]"; + + AddHistoryOutput(name, header, ZoneHistoryFields[ZoneHistoryNames[iField]].screenFormat, group, "", ZoneHistoryFields[ZoneHistoryNames[iField]].fieldType ); + } + } + } +} + +bool CMultizoneOutput::WriteScreen_Header(CConfig *config) { + + /*--- Print header if the outer iteration is zero or zonal convergence is printed ---*/ + + return curOuterIter == 0 || write_zone; + + /*--- Always print header if it is forced ---*/ + + if (headerNeeded){ + headerNeeded = false; + return true; + } + + return false; +} + +bool CMultizoneOutput::WriteScreen_Output(CConfig *config) { + + unsigned long ScreenWrt_Freq_Outer = config->GetScreen_Wrt_Freq(1); + unsigned long ScreenWrt_Freq_Time = config->GetScreen_Wrt_Freq(0); + + /*--- Check if screen output should be written --- */ + + if (!PrintOutput(curTimeIter, ScreenWrt_Freq_Time)&& + !(curTimeIter == config->GetnTime_Iter() - 1)){ + + return false; + + } + + if (convergence) {return true;} + + if (!PrintOutput(curOuterIter, ScreenWrt_Freq_Outer) && + !(curOuterIter == config->GetnOuter_Iter() - 1)){ + + return false; + + } + + return true; +} + +bool CMultizoneOutput::WriteHistoryFile_Output(CConfig *config){ + + unsigned long HistoryWrt_Freq_Outer = config->GetHistory_Wrt_Freq(1); + unsigned long HistoryWrt_Freq_Time = config->GetHistory_Wrt_Freq(0); + + /*--- Check if screen output should be written --- */ + + if (!PrintOutput(curTimeIter, HistoryWrt_Freq_Time)&& + !(curTimeIter == config->GetnTime_Iter() - 1)){ + + return false; + + } + + if (convergence) {return true;} + + if (!PrintOutput(curOuterIter, HistoryWrt_Freq_Outer) && + !(curOuterIter == config->GetnOuter_Iter() - 1)){ + + return false; + + } + + return true; +} diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp new file mode 100644 index 000000000000..df756497af54 --- /dev/null +++ b/SU2_CFD/src/output/COutput.cpp @@ -0,0 +1,1989 @@ +/*! + * \file output_structure.cpp + * \brief Main subroutines for output solver information + * \author F. Palacios, T. Economon + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/output/COutput.hpp" +#include "../../include/output/filewriter/CFVMDataSorter.hpp" +#include "../../include/output/filewriter/CFEMDataSorter.hpp" +#include "../../include/output/filewriter/CSurfaceFVMDataSorter.hpp" +#include "../../include/output/filewriter/CSurfaceFEMDataSorter.hpp" +#include "../../include/output/filewriter/CParaviewFileWriter.hpp" +#include "../../include/output/filewriter/CParaviewBinaryFileWriter.hpp" +#include "../../include/output/filewriter/CTecplotFileWriter.hpp" +#include "../../include/output/filewriter/CTecplotBinaryFileWriter.hpp" +#include "../../include/output/filewriter/CCSVFileWriter.hpp" +#include "../../include/output/filewriter/CSU2FileWriter.hpp" +#include "../../include/output/filewriter/CSU2BinaryFileWriter.hpp" +#include "../../include/output/filewriter/CSU2MeshFileWriter.hpp" + + +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +COutput::COutput(CConfig *config, unsigned short nDim, bool fem_output): femOutput(fem_output) { + + this->nDim = nDim; + + rank = SU2_MPI::GetRank(); + size = SU2_MPI::GetSize(); + + fieldWidth = 12; + + convergenceTable = new PrintingToolbox::CTablePrinter(&std::cout); + multiZoneHeaderTable = new PrintingToolbox::CTablePrinter(&std::cout); + fileWritingTable = new PrintingToolbox::CTablePrinter(&std::cout); + historyFileTable = new PrintingToolbox::CTablePrinter(&histFile, ""); + + /*--- Set default filenames ---*/ + + surfaceFilename = "surface"; + volumeFilename = "volume"; + restartFilename = "restart"; + + /*--- Retrieve the history filename ---*/ + + historyFilename = config->GetConv_FileName(); + + /*--- Add the correct file extension depending on the file format ---*/ + + string hist_ext = ".csv"; + if (config->GetTabular_FileFormat() == TAB_TECPLOT) hist_ext = ".dat"; + + /*--- Append the zone ID ---*/ + + historyFilename = config->GetMultizone_HistoryFileName(historyFilename, config->GetiZone(), hist_ext); + + /*--- Append the restart iteration ---*/ + + if (config->GetTime_Domain() && config->GetRestart()) { + historyFilename = config->GetUnsteady_FileName(historyFilename, config->GetRestart_Iter(), hist_ext); + } + + historySep = ","; + + /*--- Initialize residual ---*/ + + rhoResNew = EPS; + rhoResOld = EPS; + + nRequestedHistoryFields = config->GetnHistoryOutput(); + for (unsigned short iField = 0; iField < nRequestedHistoryFields; iField++){ + requestedHistoryFields.push_back(config->GetHistoryOutput_Field(iField)); + } + + nRequestedScreenFields = config->GetnScreenOutput(); + for (unsigned short iField = 0; iField < nRequestedScreenFields; iField++){ + requestedScreenFields.push_back(config->GetScreenOutput_Field(iField)); + } + + nRequestedVolumeFields = config->GetnVolumeOutput(); + for (unsigned short iField = 0; iField < nRequestedVolumeFields; iField++){ + requestedVolumeFields.push_back(config->GetVolumeOutput_Field(iField)); + } + + gridMovement = config->GetGrid_Movement(); + + multiZone = config->GetMultizone_Problem(); + + /*--- Default is to write history to file and screen --- */ + + noWriting = false; + + /*--- Initialize convergence monitoring structure ---*/ + + nCauchy_Elems = config->GetCauchy_Elems(); + cauchyEps = config->GetCauchy_Eps(); + minLogResidual = config->GetMinLogResidual(); + + for (unsigned short iField = 0; iField < config->GetnConv_Field(); iField++){ + convFields.emplace_back(config->GetConv_Field(iField)); + } + + newFunc = vector(convFields.size()); + oldFunc = vector(convFields.size()); + cauchySerie = vector>(convFields.size(), vector(nCauchy_Elems, 0.0)); + cauchyValue = 0.0; + convergence = false; + + + /*--- Check that the number of cauchy elems is not too large ---*/ + + if (nCauchy_Elems > 1000){ + SU2_MPI::Error("Number of Cauchy Elems must be smaller than 1000", CURRENT_FUNCTION); + } + + /*--- Initialize all convergence flags to false. ---*/ + + convergence = false; + + buildFieldIndexCache = false; + + curInnerIter = 0; + curOuterIter = 0; + curTimeIter = 0; + + volumeDataSorter = nullptr; + surfaceDataSorter = nullptr; + + headerNeeded = false; + +} + +COutput::~COutput(void) { + + delete convergenceTable; + delete multiZoneHeaderTable; + delete fileWritingTable; + delete historyFileTable; + + if (volumeDataSorter != nullptr) + delete volumeDataSorter; + + volumeDataSorter = nullptr; + + if (surfaceDataSorter != nullptr) + delete surfaceDataSorter; + + surfaceDataSorter = nullptr; + + +} + + + +void COutput::SetHistory_Output(CGeometry *geometry, + CSolver **solver_container, + CConfig *config, + unsigned long TimeIter, + unsigned long OuterIter, + unsigned long InnerIter) { + + curTimeIter = TimeIter; + curAbsTimeIter = TimeIter - config->GetRestart_Iter(); + curOuterIter = OuterIter; + curInnerIter = InnerIter; + + bool write_header, write_history, write_screen; + + /*--- Retrieve residual and extra data -----------------------------------------------------------------*/ + + LoadCommonHistoryData(config); + + LoadHistoryData(config, geometry, solver_container); + + Convergence_Monitoring(config, curInnerIter); + + Postprocess_HistoryData(config); + + /*--- Output using only the master node ---*/ + + if (rank == MASTER_NODE && !noWriting) { + + /*--- Write the history file ---------------------------------------------------------------------------*/ + write_history = WriteHistoryFile_Output(config); + if (write_history) SetHistoryFile_Output(config); + + /*--- Write the screen header---------------------------------------------------------------------------*/ + write_header = WriteScreen_Header(config); + if (write_header) SetScreen_Header(config); + + /*--- Write the screen output---------------------------------------------------------------------------*/ + write_screen = WriteScreen_Output(config); + if (write_screen) SetScreen_Output(config); + + } + +} + +void COutput::SetHistory_Output(CGeometry *geometry, + CSolver **solver_container, + CConfig *config) { + + /*--- Retrieve residual and extra data -----------------------------------------------------------------*/ + + LoadCommonHistoryData(config); + + LoadHistoryData(config, geometry, solver_container); + + Convergence_Monitoring(config, curInnerIter); + + Postprocess_HistoryData(config); + +} +void COutput::SetMultizoneHistory_Output(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){ + + curTimeIter = TimeIter; + curAbsTimeIter = TimeIter - driver_config->GetRestart_Iter(); + curOuterIter = OuterIter; + + bool write_header, write_screen, write_history; + + /*--- Retrieve residual and extra data -----------------------------------------------------------------*/ + + LoadCommonHistoryData(driver_config); + + LoadMultizoneHistoryData(output, config); + + Convergence_Monitoring(driver_config, curOuterIter); + + Postprocess_HistoryData(driver_config); + + /*--- Output using only the master node ---*/ + + if (rank == MASTER_NODE && !noWriting) { + + /*--- Write the history file ---------------------------------------------------------------------------*/ + write_history = WriteHistoryFile_Output(driver_config); + if (write_history) SetHistoryFile_Output(driver_config); + + /*--- Write the screen header---------------------------------------------------------------------------*/ + write_header = WriteScreen_Header(driver_config); + if (write_header) SetScreen_Header(driver_config); + + /*--- Write the screen output---------------------------------------------------------------------------*/ + write_screen = WriteScreen_Output(driver_config); + if (write_screen) SetScreen_Output(driver_config); + + } + +} +void COutput::SetCFL_Number(CSolver ****solver_container, CConfig *config) { + + su2double CFLFactor = 1.0, power = 1.0, CFL = 0.0, CFLMin = 0.0, CFLMax = 0.0, Div = 1.0, Diff = 0.0, MGFactor[100]; + unsigned short iMesh; + + unsigned short FinestMesh = config->GetFinestMesh(); + unsigned short nVar = 1; + + bool energy = config->GetEnergy_Equation(); + bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + + switch( config->GetKind_Solver()) { + case EULER : case NAVIER_STOKES : case RANS: + case INC_EULER : case INC_NAVIER_STOKES : case INC_RANS: + if (energy) { + nVar = solver_container[INST_0][FinestMesh][FLOW_SOL]->GetnVar(); + rhoResNew = solver_container[INST_0][FinestMesh][FLOW_SOL]->GetRes_RMS(nVar-1); + } + else if (weakly_coupled_heat) { + rhoResNew = solver_container[INST_0][FinestMesh][HEAT_SOL]->GetRes_RMS(0); + } + else { + rhoResNew = solver_container[INST_0][FinestMesh][FLOW_SOL]->GetRes_RMS(0); + } + break; + case ADJ_EULER : case ADJ_NAVIER_STOKES: case ADJ_RANS: + rhoResNew = solver_container[INST_0][FinestMesh][ADJFLOW_SOL]->GetRes_RMS(0); + break; + case HEAT_EQUATION_FVM: + rhoResNew = solver_container[INST_0][FinestMesh][HEAT_SOL]->GetRes_RMS(0); + break; + } + + if (rhoResNew < EPS) rhoResNew = EPS; + if (rhoResOld < EPS) rhoResOld = rhoResNew; + + Div = rhoResOld/rhoResNew; + Diff = rhoResNew-rhoResOld; + + /*--- Compute MG factor ---*/ + + for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + if (iMesh == MESH_0) MGFactor[iMesh] = 1.0; + else MGFactor[iMesh] = MGFactor[iMesh-1] * config->GetCFL(iMesh)/config->GetCFL(iMesh-1); + } + + if (Div < 1.0) power = config->GetCFL_AdaptParam(0); + else power = config->GetCFL_AdaptParam(1); + + /*--- Detect a stall in the residual ---*/ + + if ((fabs(Diff) <= rhoResNew*1E-8) && (curInnerIter != 0)) { Div = 0.1; power = config->GetCFL_AdaptParam(1); } + + CFLMin = config->GetCFL_AdaptParam(2); + CFLMax = config->GetCFL_AdaptParam(3); + + CFLFactor = pow(Div, power); + + for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + CFL = config->GetCFL(iMesh); + CFL *= CFLFactor; + + if ((iMesh == MESH_0) && (CFL <= CFLMin)) { + for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { + config->SetCFL(iMesh, 1.001*CFLMin*MGFactor[iMesh]); + } + break; + } + if ((iMesh == MESH_0) && (CFL >= CFLMax)) { + for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) + config->SetCFL(iMesh, 0.999*CFLMax*MGFactor[iMesh]); + break; + } + + config->SetCFL(iMesh, CFL); + } + + switch( config->GetKind_Solver()) { + case EULER : case NAVIER_STOKES : case RANS: + case INC_EULER : case INC_NAVIER_STOKES : case INC_RANS: + nVar = solver_container[INST_0][FinestMesh][FLOW_SOL]->GetnVar(); + if (energy) rhoResOld = solver_container[INST_0][FinestMesh][FLOW_SOL]->GetRes_RMS(nVar-1); + else if (weakly_coupled_heat) rhoResOld = solver_container[INST_0][FinestMesh][HEAT_SOL]->GetRes_RMS(0); + else rhoResOld = solver_container[INST_0][FinestMesh][FLOW_SOL]->GetRes_RMS(0); + break; + case ADJ_EULER : case ADJ_NAVIER_STOKES: case ADJ_RANS: + rhoResOld = solver_container[INST_0][FinestMesh][ADJFLOW_SOL]->GetRes_RMS(0); + break; + case HEAT_EQUATION_FVM: + rhoResOld = solver_container[INST_0][FinestMesh][HEAT_SOL]->GetRes_RMS(0); + break; + } + +} + +void COutput::AllocateDataSorters(CConfig *config, CGeometry *geometry){ + + /*---- Construct a data sorter object to partition and distribute + * the local data into linear chunks across the processors ---*/ + + if (femOutput){ + + if (volumeDataSorter == nullptr) + volumeDataSorter = new CFEMDataSorter(config, geometry, nVolumeFields); + + if (surfaceDataSorter == nullptr) + surfaceDataSorter = new CSurfaceFEMDataSorter(config, geometry, nVolumeFields, + dynamic_cast(volumeDataSorter)); + + } else { + + if (volumeDataSorter == nullptr) + volumeDataSorter = new CFVMDataSorter(config, geometry, nVolumeFields); + + if (surfaceDataSorter == nullptr) + surfaceDataSorter = new CSurfaceFVMDataSorter(config, geometry, nVolumeFields, + dynamic_cast(volumeDataSorter)); + + } + +} + +void COutput::Load_Data(CGeometry *geometry, CConfig *config, CSolver** solver_container){ + + /*--- Check if the data sorters are allocated, if not, allocate them. --- */ + + AllocateDataSorters(config, geometry); + + /*--- Loop over all points and store the requested volume output data into the data sorter objects ---*/ + + LoadDataIntoSorter(config, geometry, solver_container); + + /*--- Partition and sort the volume output data -- */ + + volumeDataSorter->SortOutputData(); + +} + +void COutput::WriteToFile(CConfig *config, CGeometry *geometry, unsigned short format, string fileName){ + + CFileWriter *fileWriter = NULL; + + unsigned short lastindex = fileName.find_last_of("."); + fileName = fileName.substr(0, lastindex); + + /*--- Write files depending on the format --- */ + + switch (format) { + + case SURFACE_CSV: + + if (fileName.empty()) + fileName = config->GetFilename(surfaceFilename, "", curTimeIter); + + surfaceDataSorter->SortConnectivity(config, geometry); + surfaceDataSorter->SortOutputData(); + + if (rank == MASTER_NODE) { + (*fileWritingTable) << "CSV file" << fileName + CSU2FileWriter::fileExt; + } + + fileWriter = new CSU2FileWriter(volumeFieldNames, nDim, fileName, surfaceDataSorter); + + break; + + case RESTART_ASCII: case CSV: + + if (fileName.empty()) + fileName = config->GetFilename(restartFilename, "", curTimeIter); + + if (rank == MASTER_NODE) { + (*fileWritingTable) << "SU2 ASCII restart" << fileName + CSU2FileWriter::fileExt; + } + + fileWriter = new CSU2FileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter); + + break; + + case RESTART_BINARY: + + if (fileName.empty()) + fileName = config->GetFilename(restartFilename, "", curTimeIter); + + if (rank == MASTER_NODE) { + (*fileWritingTable) << "SU2 restart" << fileName + CSU2BinaryFileWriter::fileExt; + } + + fileWriter = new CSU2BinaryFileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter); + + break; + + case MESH: + + if (fileName.empty()) + fileName = volumeFilename; + + /*--- Load and sort the output data and connectivity. ---*/ + + volumeDataSorter->SortConnectivity(config, geometry, true); + + /*--- Set the mesh ASCII format ---*/ + + if (rank == MASTER_NODE) { + (*fileWritingTable) << "SU2 mesh" << fileName + CSU2MeshFileWriter::fileExt; + } + + fileWriter = new CSU2MeshFileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter, + config->GetiZone(), config->GetnZone()); + + + break; + + case TECPLOT_BINARY: + + if (fileName.empty()) + fileName = config->GetFilename(volumeFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + volumeDataSorter->SortConnectivity(config, geometry, true); + + /*--- Write tecplot binary ---*/ + + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Tecplot" << fileName + CTecplotBinaryFileWriter::fileExt; + } + + fileWriter = new CTecplotBinaryFileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter, + curTimeIter, GetHistoryFieldValue("TIME_STEP")); + + break; + + case TECPLOT: + + if (fileName.empty()) + fileName = config->GetFilename(volumeFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + volumeDataSorter->SortConnectivity(config, geometry, true); + + /*--- Write tecplot binary ---*/ + + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Tecplot ASCII" << fileName + CTecplotFileWriter::fileExt; + } + + fileWriter = new CTecplotFileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter, + curTimeIter, GetHistoryFieldValue("TIME_STEP")); + + break; + + case PARAVIEW_BINARY: + + if (fileName.empty()) + fileName = config->GetFilename(volumeFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + volumeDataSorter->SortConnectivity(config, geometry, true); + + /*--- Write paraview binary ---*/ + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Paraview" << fileName + CParaviewBinaryFileWriter::fileExt; + } + + fileWriter = new CParaviewBinaryFileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter); + + break; + + case PARAVIEW: + + if (fileName.empty()) + fileName = config->GetFilename(volumeFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + volumeDataSorter->SortConnectivity(config, geometry, true); + + /*--- Write paraview binary ---*/ + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Paraview ASCII" << fileName + CParaviewFileWriter::fileExt; + } + + fileWriter = new CParaviewFileWriter(volumeFieldNames, nDim, fileName, volumeDataSorter); + + break; + + case SURFACE_PARAVIEW: + + if (fileName.empty()) + fileName = config->GetFilename(surfaceFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + surfaceDataSorter->SortConnectivity(config, geometry); + surfaceDataSorter->SortOutputData(); + + /*--- Write paraview binary ---*/ + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Paraview ASCII surface" << fileName + CParaviewFileWriter::fileExt; + } + + fileWriter = new CParaviewFileWriter(volumeFieldNames, nDim, fileName, surfaceDataSorter); + + break; + + case SURFACE_PARAVIEW_BINARY: + + if (fileName.empty()) + fileName = config->GetFilename(surfaceFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + surfaceDataSorter->SortConnectivity(config, geometry); + surfaceDataSorter->SortOutputData(); + + /*--- Write paraview binary ---*/ + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Paraview surface" << fileName + CParaviewBinaryFileWriter::fileExt; + } + + fileWriter = new CParaviewBinaryFileWriter(volumeFieldNames, nDim, fileName, surfaceDataSorter); + + break; + + case SURFACE_TECPLOT: + + if (fileName.empty()) + fileName = config->GetFilename(surfaceFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + surfaceDataSorter->SortConnectivity(config, geometry); + surfaceDataSorter->SortOutputData(); + + /*--- Write paraview binary ---*/ + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Tecplot ASCII surface" << fileName + CTecplotFileWriter::fileExt; + } + + fileWriter = new CTecplotFileWriter(volumeFieldNames, nDim, fileName, surfaceDataSorter, + curTimeIter, GetHistoryFieldValue("TIME_STEP")); + + break; + + case SURFACE_TECPLOT_BINARY: + + if (fileName.empty()) + fileName = config->GetFilename(surfaceFilename, "", curTimeIter); + + /*--- Load and sort the output data and connectivity. ---*/ + + surfaceDataSorter->SortConnectivity(config, geometry); + surfaceDataSorter->SortOutputData(); + + /*--- Write paraview binary ---*/ + if (rank == MASTER_NODE) { + (*fileWritingTable) << "Tecplot surface" << fileName + CTecplotBinaryFileWriter::fileExt; + } + + fileWriter = new CTecplotBinaryFileWriter(volumeFieldNames, nDim, fileName, surfaceDataSorter, + curTimeIter, GetHistoryFieldValue("TIME_STEP")); + + break; + + default: + fileWriter = NULL; + break; + } + + if (fileWriter != NULL){ + + /*--- Write data to file ---*/ + + fileWriter->Write_Data(); + + /*--- Compute and store the bandwidth ---*/ + + if (format == RESTART_BINARY){ + su2double BandWidth = fileWriter->Get_Bandwidth(); + config->SetRestart_Bandwidth_Agg(config->GetRestart_Bandwidth_Agg()+BandWidth); + } + + delete fileWriter; + + } +} + + + +bool COutput::SetResult_Files(CGeometry *geometry, CConfig *config, CSolver** solver_container, + unsigned long iter, bool force_writing){ + + bool writeFiles = WriteVolume_Output(config, iter) || force_writing; + + /*--- Check if the data sorters are allocated, if not, allocate them. --- */ + + AllocateDataSorters(config, geometry); + + /*--- Collect the volume data from the solvers. + * If time-domain is enabled, we also load the data although we don't output it, + * since we might want to do time-averaging. ---*/ + + if (writeFiles || config->GetTime_Domain()) + LoadDataIntoSorter(config, geometry, solver_container); + + if (writeFiles){ + + /*--- Partition and sort the data --- */ + + volumeDataSorter->SortOutputData(); + + unsigned short nVolumeFiles = config->GetnVolumeOutputFiles(); + unsigned short *VolumeFiles = config->GetVolumeOutputFiles(); + + if (rank == MASTER_NODE && nVolumeFiles != 0){ + fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); + fileWritingTable->PrintHeader(); + fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT); + } + + /*--- Loop through all requested output files and write + * the partitioned and sorted data stored in the data sorters. ---*/ + + for (unsigned short iFile = 0; iFile < nVolumeFiles; iFile++){ + + WriteToFile(config, geometry, VolumeFiles[iFile]); + + } + + if (rank == MASTER_NODE && nVolumeFiles != 0){ + fileWritingTable->PrintFooter(); + headerNeeded = true; + } + + /*--- Write any additonal files defined in the child class ----*/ + + WriteAdditionalFiles(config, geometry, solver_container); + + return true; + } + + return false; +} + +void COutput::PrintConvergenceSummary(){ + + PrintingToolbox::CTablePrinter ConvSummary(&cout); + + ConvSummary.AddColumn("Convergence Field", 28); + ConvSummary.AddColumn("Value", 14); + ConvSummary.AddColumn("Criterion", 14); + ConvSummary.AddColumn("Converged",12); + ConvSummary.SetAlign(PrintingToolbox::CTablePrinter::CENTER); + ConvSummary.PrintHeader(); + for (unsigned short iField_Conv = 0; iField_Conv < convFields.size(); iField_Conv++){ + const string &convField = convFields[iField_Conv]; + if (historyOutput_Map[convField].fieldType == HistoryFieldType::COEFFICIENT) { + string convMark = "No"; + if ( historyOutput_Map["CAUCHY_" + convField].value < cauchyEps) convMark = "Yes"; + ConvSummary << historyOutput_Map["CAUCHY_" + convField].fieldName + << historyOutput_Map["CAUCHY_" + convField].value + << " < " + PrintingToolbox::to_string(cauchyEps) << convMark; + } + else if (historyOutput_Map[convField].fieldType == HistoryFieldType::RESIDUAL || + historyOutput_Map[convField].fieldType == HistoryFieldType::AUTO_RESIDUAL) { + string convMark = "No"; + if (historyOutput_Map[convField].value < minLogResidual) convMark = "Yes"; + ConvSummary << historyOutput_Map[convField].fieldName + << historyOutput_Map[convField].value + << " < " + PrintingToolbox::to_string(minLogResidual) << convMark; + } + } + ConvSummary.PrintFooter(); +} + +bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) { + + unsigned short iCounter; + + convergence = true; + + for (unsigned short iField_Conv = 0; iField_Conv < convFields.size(); iField_Conv++){ + + bool fieldConverged = false; + + const string &convField = convFields[iField_Conv]; + if (historyOutput_Map.count(convField) > 0){ + su2double monitor = historyOutput_Map[convField].value; + + /*--- Cauchy based convergence criteria ---*/ + + if (historyOutput_Map[convField].fieldType == HistoryFieldType::COEFFICIENT) { + + if (Iteration == 0){ + for (iCounter = 0; iCounter < nCauchy_Elems; iCounter++){ + cauchySerie[iField_Conv][iCounter] = 0.0; + } + newFunc[iField_Conv] = monitor; + } + + oldFunc[iField_Conv] = newFunc[iField_Conv]; + newFunc[iField_Conv] = monitor; + cauchyFunc = fabs(newFunc[iField_Conv] - oldFunc[iField_Conv])/fabs(monitor); + + cauchySerie[iField_Conv][Iteration % nCauchy_Elems] = cauchyFunc; + cauchyValue = 0.0; + for (iCounter = 0; iCounter < nCauchy_Elems; iCounter++) + cauchyValue += cauchySerie[iField_Conv][iCounter]; + + cauchyValue /= nCauchy_Elems; + + if (cauchyValue >= cauchyEps) { fieldConverged = false;} + else { fieldConverged = true;} + + /*--- Start monitoring only if the current iteration + * is larger than the number of cauchy elements and + * the number of start-up iterations --- */ + + if (Iteration < max(config->GetStartConv_Iter(), nCauchy_Elems)){ + fieldConverged = false; + } + + SetHistoryOutputValue("CAUCHY_" + convField, cauchyValue); + + } + + + /*--- Residual based convergence criteria ---*/ + + if (historyOutput_Map[convField].fieldType == HistoryFieldType::RESIDUAL || + historyOutput_Map[convField].fieldType == HistoryFieldType::AUTO_RESIDUAL) { + + /*--- Check the convergence ---*/ + + if (Iteration != 0 && (monitor <= minLogResidual)) { fieldConverged = true; } + else { fieldConverged = false; } + + } + + /*--- Do not apply any convergence criteria of the number + of iterations is less than a particular value ---*/ + + if (Iteration < config->GetStartConv_Iter()) { + fieldConverged = false; + } + + convergence = fieldConverged && convergence; + } + } + if (convFields.empty()) convergence = false; + + /*--- Apply the same convergence criteria to all the processors ---*/ + +#ifdef HAVE_MPI + + unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL; + sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0; + rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0; + + /*--- Convergence criteria ---*/ + + sbuf_conv[0] = convergence; + SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + + /*-- Compute global convergence criteria in the master node --*/ + + sbuf_conv[0] = 0; + if (rank == MASTER_NODE) { + if (rbuf_conv[0] == size) sbuf_conv[0] = 1; + else sbuf_conv[0] = 0; + } + + SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, MPI_COMM_WORLD); + + if (sbuf_conv[0] == 1) { convergence = true; } + else { convergence = false; } + + delete [] sbuf_conv; + delete [] rbuf_conv; + +#endif + + + + return convergence; +} + +void COutput::SetHistoryFile_Header(CConfig *config) { + + unsigned short iField_Output = 0, + iReqField = 0, + iMarker = 0; + stringstream out; + int width = 20; + + for (iField_Output = 0; iField_Output < historyOutput_List.size(); iField_Output++){ + const string &fieldIdentifier = historyOutput_List[iField_Output]; + const HistoryOutputField &field = historyOutput_Map[fieldIdentifier]; + for (iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + const string & requestedField = requestedHistoryFields[iReqField]; + if (requestedField == field.outputGroup || (requestedField == fieldIdentifier)){ + if (field.screenFormat == ScreenOutputFormat::INTEGER) width = std::max((int)field.fieldName.size()+2, 10); + else{ width = std::max((int)field.fieldName.size()+2, 18);} + historyFileTable->AddColumn("\"" + field.fieldName + "\"", width); + } + } + } + + for (iField_Output = 0; iField_Output < historyOutputPerSurface_List.size(); iField_Output++){ + const string &fieldIdentifier = historyOutputPerSurface_List[iField_Output]; + for (iMarker = 0; iMarker < historyOutputPerSurface_Map[fieldIdentifier].size(); iMarker++){ + const HistoryOutputField &field = historyOutputPerSurface_Map[fieldIdentifier][iMarker]; + for (iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + const string &requestedField = requestedHistoryFields[iReqField]; + if (requestedField == field.outputGroup || (requestedField == fieldIdentifier)){ + if (field.screenFormat == ScreenOutputFormat::INTEGER) width = std::max((int)field.fieldName.size()+2, 10); + else{ width = std::max((int)field.fieldName.size()+2, 18);} + historyFileTable->AddColumn("\"" + field.fieldName + "\"", width); + } + } + } + } + + if (config->GetTabular_FileFormat() == TAB_TECPLOT) { + histFile << "VARIABLES = \\" << endl; + } + historyFileTable->PrintHeader(); + histFile.flush(); +} + + +void COutput::SetHistoryFile_Output(CConfig *config) { + + unsigned short iField_Output = 0, + iReqField = 0, + iMarker = 0; + stringstream out; + + for (iField_Output = 0; iField_Output < historyOutput_List.size(); iField_Output++){ + const string &fieldIdentifier = historyOutput_List[iField_Output]; + const HistoryOutputField &field = historyOutput_Map[fieldIdentifier]; + for (iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + const string &RequestedField = requestedHistoryFields[iReqField]; + if (RequestedField == field.outputGroup){ + (*historyFileTable) << field.value; + } + } + } + + for (iField_Output = 0; iField_Output < historyOutputPerSurface_List.size(); iField_Output++){ + const string &fieldIdentifier = historyOutputPerSurface_List[iField_Output]; + for (iMarker = 0; iMarker < historyOutputPerSurface_Map[fieldIdentifier].size(); iMarker++){ + const HistoryOutputField &field = historyOutputPerSurface_Map[fieldIdentifier][iMarker]; + for (iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + const string &RequestedField = requestedHistoryFields[iReqField]; + if (RequestedField == field.outputGroup){ + (*historyFileTable) << field.value; + } + } + } + } + + /*--- Print the string to file and remove the last two characters (a separator and a space) ---*/ + + histFile.flush(); +} + +void COutput::SetScreen_Header(CConfig *config) { + if (config->GetMultizone_Problem()) + multiZoneHeaderTable->PrintHeader(); + convergenceTable->PrintHeader(); +} + + +void COutput::SetScreen_Output(CConfig *config) { + + string RequestedField; + + for (unsigned short iReqField = 0; iReqField < nRequestedScreenFields; iReqField++){ + stringstream out; + RequestedField = requestedScreenFields[iReqField]; + if (historyOutput_Map.count(RequestedField) > 0){ + switch (historyOutput_Map[RequestedField].screenFormat) { + case ScreenOutputFormat::INTEGER: + PrintingToolbox::PrintScreenInteger(out, SU2_TYPE::Int(historyOutput_Map[RequestedField].value), fieldWidth); + break; + case ScreenOutputFormat::FIXED: + PrintingToolbox::PrintScreenFixed(out, historyOutput_Map[RequestedField].value, fieldWidth); + break; + case ScreenOutputFormat::SCIENTIFIC: + PrintingToolbox::PrintScreenScientific(out, historyOutput_Map[RequestedField].value, fieldWidth); + break; + } + } + if (historyOutputPerSurface_Map.count(RequestedField) > 0){ + switch (historyOutputPerSurface_Map[RequestedField][0].screenFormat) { + case ScreenOutputFormat::INTEGER: + PrintingToolbox::PrintScreenInteger(out, SU2_TYPE::Int(historyOutputPerSurface_Map[RequestedField][0].value), fieldWidth); + break; + case ScreenOutputFormat::FIXED: + PrintingToolbox::PrintScreenFixed(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); + break; + case ScreenOutputFormat::SCIENTIFIC: + PrintingToolbox::PrintScreenScientific(out, historyOutputPerSurface_Map[RequestedField][0].value, fieldWidth); + break; + } + } + (*convergenceTable) << out.str(); + } +} + +void COutput::PreprocessHistoryOutput(CConfig *config, bool wrt){ + + noWriting = !wrt; + + /*--- Set the common output fields ---*/ + + SetCommonHistoryFields(config); + + /*--- Set the History output fields using a virtual function call to the child implementation ---*/ + + SetHistoryOutputFields(config); + + /*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/ + + Postprocess_HistoryFields(config); + + /*--- We use a fixed size of the file output summary table ---*/ + + int total_width = 72; + fileWritingTable->AddColumn("File Writing Summary", (total_width)/2-1); + fileWritingTable->AddColumn("Filename", total_width/2-1); + fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT); + + if (rank == MASTER_NODE && !noWriting){ + + /*--- Check for consistency and remove fields that are requested but not available --- */ + + CheckHistoryOutput(); + + /*--- Open history file and print the header ---*/ + + PrepareHistoryFile(config); + + total_width = nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1); + + /*--- Set the multizone screen header ---*/ + + if (config->GetMultizone_Problem()){ + multiZoneHeaderTable->AddColumn(multiZoneHeaderString, total_width); + multiZoneHeaderTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); + multiZoneHeaderTable->SetPrintHeaderBottomLine(false); + } + + } + +} + +void COutput::PreprocessMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig* driver_config, bool wrt){ + + noWriting = !wrt; + + /*--- Set the common history fields for all solvers ---*/ + + SetCommonHistoryFields(driver_config); + + /*--- Set the History output fields using a virtual function call to the child implementation ---*/ + + SetMultizoneHistoryOutputFields(output, config); + + /*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/ + + Postprocess_HistoryFields(driver_config); + + /*--- We use a fixed size of the file output summary table ---*/ + + int total_width = 72; + fileWritingTable->AddColumn("File Writing Summary", (total_width-1)/2); + fileWritingTable->AddColumn("Filename", total_width/2); + fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT); + + if (rank == MASTER_NODE && !noWriting){ + + + /*--- Check for consistency and remove fields that are requested but not available --- */ + + CheckHistoryOutput(); + + /*--- Open history file and print the header ---*/ + + PrepareHistoryFile(driver_config); + + total_width = nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1); + + /*--- Set the multizone screen header ---*/ + + if (config[ZONE_0]->GetMultizone_Problem()){ + multiZoneHeaderTable->AddColumn(multiZoneHeaderString, nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1)); + multiZoneHeaderTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); + multiZoneHeaderTable->SetPrintHeaderBottomLine(false); + } + + } + +} + +void COutput::PrepareHistoryFile(CConfig *config){ + + /*--- Open the history file ---*/ + + histFile.open(historyFilename.c_str(), ios::out); + + /*--- Create and format the history file table ---*/ + + historyFileTable->SetInnerSeparator(historySep); + historyFileTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER); + historyFileTable->SetPrintHeaderTopLine(false); + historyFileTable->SetPrintHeaderBottomLine(false); + historyFileTable->SetPrecision(10); + + /*--- Add the header to the history file. ---*/ + + SetHistoryFile_Header(config); + +} + +void COutput::CheckHistoryOutput(){ + + + /*--- Set screen convergence output header and remove unavailable fields ---*/ + + string requestedField; + vector FieldsToRemove; + vector FoundField(nRequestedHistoryFields, false); + + for (unsigned short iReqField = 0; iReqField < nRequestedScreenFields; iReqField++){ + requestedField = requestedScreenFields[iReqField]; + if (historyOutput_Map.count(requestedField) > 0){ + convergenceTable->AddColumn(historyOutput_Map[requestedField].fieldName, fieldWidth); + } + else if (historyOutputPerSurface_Map.count(requestedField) > 0){ + convergenceTable->AddColumn(historyOutputPerSurface_Map[requestedField][0].fieldName, fieldWidth); + }else { + FieldsToRemove.push_back(requestedField); + } + } + + /*--- Remove fields which are not defined --- */ + + for (unsigned short iReqField = 0; iReqField < FieldsToRemove.size(); iReqField++){ + if (rank == MASTER_NODE) { + if (iReqField == 0){ + cout << " Info: Ignoring the following screen output fields:" << endl; + cout << " "; + } cout << FieldsToRemove[iReqField]; + if (iReqField != FieldsToRemove.size()-1){ + cout << ", "; + } else { + cout << endl; + } + } + requestedScreenFields.erase(std::find(requestedScreenFields.begin(), + requestedScreenFields.end(), FieldsToRemove[iReqField])); + } + + nRequestedScreenFields = requestedScreenFields.size(); + + if (rank == MASTER_NODE){ + cout <<"Screen output fields: "; + for (unsigned short iReqField = 0; iReqField < nRequestedScreenFields; iReqField++){ + requestedField = requestedScreenFields[iReqField]; + cout << requestedScreenFields[iReqField]; + if (iReqField != nRequestedScreenFields - 1) cout << ", "; + } + cout << endl; + } + + /*--- Remove unavailable fields from the history file output ---*/ + + FieldsToRemove.clear(); + FoundField = vector(nRequestedHistoryFields, false); + + for (unsigned short iField_Output = 0; iField_Output < historyOutput_List.size(); iField_Output++){ + const string &fieldReference = historyOutput_List[iField_Output]; + if (historyOutput_Map.count(fieldReference) > 0){ + const HistoryOutputField &field = historyOutput_Map[fieldReference]; + for (unsigned short iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + requestedField = requestedHistoryFields[iReqField]; + if (requestedField == field.outputGroup){ + FoundField[iReqField] = true; + } + } + } + } + + for (unsigned short iField_Output = 0; iField_Output < historyOutputPerSurface_List.size(); iField_Output++){ + const string &fieldReference = historyOutputPerSurface_List[iField_Output]; + if (historyOutputPerSurface_Map.count(fieldReference) > 0){ + for (unsigned short iMarker = 0; iMarker < historyOutputPerSurface_Map[fieldReference].size(); iMarker++){ + const HistoryOutputField &Field = historyOutputPerSurface_Map[fieldReference][iMarker]; + for (unsigned short iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + requestedField = requestedHistoryFields[iReqField]; + if (requestedField == Field.outputGroup){ + FoundField[iReqField] = true; + } + } + } + } + } + + for (unsigned short iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + if (!FoundField[iReqField]){ + FieldsToRemove.push_back(requestedHistoryFields[iReqField]); + } + } + + /*--- Remove fields which are not defined --- */ + + for (unsigned short iReqField = 0; iReqField < FieldsToRemove.size(); iReqField++){ + if (rank == MASTER_NODE) { + if (iReqField == 0){ + cout << " Info: Ignoring the following history output groups:" << endl; + cout << " "; + } cout << FieldsToRemove[iReqField]; + if (iReqField != FieldsToRemove.size()-1){ + cout << ", "; + } else { + cout << endl; + } + } + requestedHistoryFields.erase(std::find(requestedHistoryFields.begin(), + requestedHistoryFields.end(), FieldsToRemove[iReqField])); + } + + nRequestedHistoryFields = requestedHistoryFields.size(); + + if (rank == MASTER_NODE){ + cout <<"History output groups: "; + for (unsigned short iReqField = 0; iReqField < nRequestedHistoryFields; iReqField++){ + requestedField = requestedHistoryFields[iReqField]; + cout << requestedHistoryFields[iReqField]; + if (iReqField != nRequestedHistoryFields - 1) cout << ", "; + } + cout << endl; + } + + /*--- Check that the requested convergence monitoring field is available ---*/ + bool removedField = false; + for (unsigned short iField_Conv = 0; iField_Conv < convFields.size(); iField_Conv++){ + if (historyOutput_Map.count(convFields[iField_Conv]) == 0){ + if (!removedField) { + cout << "Ignoring Convergence Fields: "; + removedField = true; + } + cout << convFields[iField_Conv] << " "; + convFields.erase(std::find(convFields.begin(), + convFields.end(), convFields[iField_Conv])); + } + } + if (removedField) cout << endl; +} + +void COutput::PreprocessVolumeOutput(CConfig *config){ + + /*--- Set the volume output fields using a virtual function call to the child implementation ---*/ + + SetVolumeOutputFields(config); + + /*---Coordinates and solution groups must be always in the output. + * If they are not requested, add them here. ---*/ + + vector::iterator itCoord = std::find(requestedVolumeFields.begin(), + requestedVolumeFields.end(), "COORDINATES"); + if (itCoord == requestedVolumeFields.end()){ + requestedVolumeFields.emplace_back("COORDINATES"); + nRequestedVolumeFields++; + } + vector::iterator itSol = std::find(requestedVolumeFields.begin(), + requestedVolumeFields.end(), "SOLUTION"); + if (itSol == requestedVolumeFields.end()){ + requestedVolumeFields.emplace_back("SOLUTION"); + nRequestedVolumeFields++; + } + + nVolumeFields = 0; + + string RequestedField; + std::vector FoundField(nRequestedVolumeFields, false); + vector FieldsToRemove; + + + /*--- Loop through all fields defined in the corresponding SetVolumeOutputFields(). + * If it is also defined in the config (either as part of a group or a single field), the field + * object gets an offset so that we know where to find the data in the Local_Data() array. + * Note that the default offset is -1. An index !=-1 defines this field as part of the output. ---*/ + + for (unsigned short iField_Output = 0; iField_Output < volumeOutput_List.size(); iField_Output++){ + + const string &fieldReference = volumeOutput_List[iField_Output]; + if (volumeOutput_Map.count(fieldReference) > 0){ + VolumeOutputField &Field = volumeOutput_Map[fieldReference]; + + /*--- Loop through all fields specified in the config ---*/ + + for (unsigned short iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++){ + + RequestedField = requestedVolumeFields[iReqField]; + + if (((RequestedField == Field.outputGroup) || (RequestedField == fieldReference)) && (Field.offset == -1)){ + Field.offset = nVolumeFields; + volumeFieldNames.push_back(Field.fieldName); + nVolumeFields++; + + FoundField[iReqField] = true; + } + } + } + } + + for (unsigned short iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++){ + if (!FoundField[iReqField]){ + FieldsToRemove.push_back(requestedVolumeFields[iReqField]); + } + } + + /*--- Remove fields which are not defined --- */ + + for (unsigned short iReqField = 0; iReqField < FieldsToRemove.size(); iReqField++){ + if (rank == MASTER_NODE) { + if (iReqField == 0){ + cout << " Info: Ignoring the following volume output fields/groups:" << endl; + cout << " "; + } + cout << FieldsToRemove[iReqField]; + if (iReqField != FieldsToRemove.size()-1){ + cout << ", "; + } else { + cout << endl; + } + } + requestedVolumeFields.erase(std::find(requestedVolumeFields.begin(), + requestedVolumeFields.end(), FieldsToRemove[iReqField])); + } + + nRequestedVolumeFields = requestedVolumeFields.size(); + + if (rank == MASTER_NODE){ + cout <<"Volume output fields: "; + for (unsigned short iReqField = 0; iReqField < nRequestedVolumeFields; iReqField++){ + RequestedField = requestedVolumeFields[iReqField]; + cout << requestedVolumeFields[iReqField]; + if (iReqField != nRequestedVolumeFields - 1) cout << ", "; + } + cout << endl; + } +} + +void COutput::LoadDataIntoSorter(CConfig* config, CGeometry* geometry, CSolver** solver){ + + unsigned short iMarker = 0; + unsigned long iPoint = 0, jPoint = 0; + unsigned long iVertex = 0; + + /*--- Reset the offset cache and index --- */ + cachePosition = 0; + fieldIndexCache.clear(); + curGetFieldIndex = 0; + fieldGetIndexCache.clear(); + + if (femOutput){ + + /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary + geometrical information for the FEM DG solver. ---*/ + + CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + + unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); + + CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); + + /*--- Access the solution by looping over the owned volume elements. ---*/ + + for(unsigned long l=0; lGetnPointDomain(); iPoint++) { + + /*--- Load the volume data into the data sorter. --- */ + + buildFieldIndexCache = fieldIndexCache.empty(); + + LoadVolumeData(config, geometry, solver, iPoint); + + } + + /*--- Reset the offset cache and index --- */ + cachePosition = 0; + fieldIndexCache.clear(); + curGetFieldIndex = 0; + fieldGetIndexCache.clear(); + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + + /*--- We only want to have surface values on solid walls ---*/ + + if (config->GetSolid_Wall(iMarker)){ + for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++){ + + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + /*--- Load the surface data into the data sorter. --- */ + + if(geometry->node[iPoint]->GetDomain()){ + + buildFieldIndexCache = fieldIndexCache.empty(); + + LoadSurfaceData(config, geometry, solver, iPoint, iMarker, iVertex); + + } + } + } + } + } +} + +void COutput::SetVolumeOutputValue(string name, unsigned long iPoint, su2double value){ + + if (buildFieldIndexCache){ + + /*--- Build up the offset cache to speed up subsequent + * calls of this routine since the order of calls is + * the same for every value of iPoint --- */ + + if (volumeOutput_Map.count(name) > 0){ + const short Offset = volumeOutput_Map[name].offset; + fieldIndexCache.push_back(Offset); + if (Offset != -1){ + volumeDataSorter->SetUnsorted_Data(iPoint, Offset, value); + } + } else { + SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); + } + } else { + + /*--- Use the offset cache for the access ---*/ + + const short Offset = fieldIndexCache[cachePosition++]; + if (Offset != -1){ + volumeDataSorter->SetUnsorted_Data(iPoint, Offset, value); + } + if (cachePosition == fieldIndexCache.size()){ + cachePosition = 0; + } + } + +} + +su2double COutput::GetVolumeOutputValue(string name, unsigned long iPoint){ + + if (buildFieldIndexCache){ + + /*--- Build up the offset cache to speed up subsequent + * calls of this routine since the order of calls is + * the same for every value of iPoint --- */ + + if (volumeOutput_Map.count(name) > 0){ + const short Offset = volumeOutput_Map[name].offset; + fieldGetIndexCache.push_back(Offset); + if (Offset != -1){ + return volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + } + } else { + SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); + } + } else { + + /*--- Use the offset cache for the access ---*/ + + const short Offset = fieldGetIndexCache[curGetFieldIndex++]; + + if (curGetFieldIndex == fieldGetIndexCache.size()){ + curGetFieldIndex = 0; + } + if (Offset != -1){ + return volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + } + } + + return 0.0; +} + +void COutput::SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2double value){ + + const su2double scaling = 1.0 / su2double(curAbsTimeIter + 1); + + if (buildFieldIndexCache){ + + /*--- Build up the offset cache to speed up subsequent + * calls of this routine since the order of calls is + * the same for every value of iPoint --- */ + + if (volumeOutput_Map.count(name) > 0){ + const short Offset = volumeOutput_Map[name].offset; + fieldIndexCache.push_back(Offset); + if (Offset != -1){ + + const su2double old_value = volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + const su2double new_value = value * scaling + old_value *( 1.0 - scaling); + + volumeDataSorter->SetUnsorted_Data(iPoint, Offset, new_value); + } + } else { + SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); + } + } else { + + /*--- Use the offset cache for the access ---*/ + + const short Offset = fieldIndexCache[cachePosition++]; + if (Offset != -1){ + + const su2double old_value = volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + const su2double new_value = value * scaling + old_value *( 1.0 - scaling); + + volumeDataSorter->SetUnsorted_Data(iPoint, Offset, new_value); + } + if (cachePosition == fieldIndexCache.size()){ + cachePosition = 0; + } + } + +} + + + + + +void COutput::Postprocess_HistoryData(CConfig *config){ + + map > Average; + map Count; + + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + const string &fieldIdentifier = historyOutput_List[iField]; + const HistoryOutputField ¤tField = historyOutput_Map[fieldIdentifier]; + if (currentField.fieldType == HistoryFieldType::RESIDUAL){ + if ( SetInit_Residuals(config) || (currentField.value > initialResiduals[fieldIdentifier]) ) { + initialResiduals[fieldIdentifier] = currentField.value; + } + SetHistoryOutputValue("REL_" + fieldIdentifier, + currentField.value - initialResiduals[fieldIdentifier]); + + Average[currentField.outputGroup].first += currentField.value; + Average[currentField.outputGroup].second++; + + } + if (currentField.fieldType == HistoryFieldType::COEFFICIENT){ + if(SetUpdate_Averages(config)){ + if (config->GetTime_Domain()){ + SetHistoryOutputValue("TAVG_" + fieldIdentifier, + runningAverages[fieldIdentifier].Update(currentField.value)); + if (config->GetDirectDiff() != NO_DERIVATIVE) { + SetHistoryOutputValue("D_TAVG_" + fieldIdentifier, + SU2_TYPE::GetDerivative(runningAverages[fieldIdentifier].Get())); + } + } + } + if (config->GetDirectDiff() != NO_DERIVATIVE){ + SetHistoryOutputValue("D_" + fieldIdentifier, SU2_TYPE::GetDerivative(currentField.value)); + } + } + } + + map >::iterator it = Average.begin(); + for (it = Average.begin(); it != Average.end(); it++){ + const su2double& value = it->second.first; + const int& count = it->second.second; + const su2double average = value/count; + if (historyOutput_Map.count("AVG_" + it->first) > 0 ) + SetHistoryOutputValue("AVG_" + it->first, average); + } + +} + +void COutput::Postprocess_HistoryFields(CConfig *config){ + + map Average; + map AverageGroupName = CCreateMap("BGS_RES", "bgs")("RMS_RES","rms")("MAX_RES", "max"); + + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + const string &fieldIdentifier = historyOutput_List[iField]; + const HistoryOutputField ¤tField = historyOutput_Map[fieldIdentifier]; + if (currentField.fieldType == HistoryFieldType::RESIDUAL){ + AddHistoryOutput("REL_" + fieldIdentifier, "rel" + currentField.fieldName, currentField.screenFormat, + "REL_" + currentField.outputGroup, "Relative residual.", HistoryFieldType::AUTO_RESIDUAL); + Average[currentField.outputGroup] = true; + } + } + + map::iterator it = Average.begin(); + for (it = Average.begin(); it != Average.end(); it++){ + if (AverageGroupName.count(it->first) > 0) { + AddHistoryOutput("AVG_" + it->first, "avg[" + AverageGroupName[it->first] + "]", ScreenOutputFormat::FIXED, + "AVG_" + it->first , "Average residual over all solution variables.", HistoryFieldType::AUTO_RESIDUAL); + } + } + + if (config->GetTime_Domain()){ + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + const string &fieldIdentifier = historyOutput_List[iField]; + const HistoryOutputField ¤tField = historyOutput_Map[fieldIdentifier]; + if (currentField.fieldType == HistoryFieldType::COEFFICIENT){ + AddHistoryOutput("TAVG_" + fieldIdentifier, "tavg[" + currentField.fieldName + "]", + currentField.screenFormat, "TAVG_" + currentField.outputGroup, "Time averaged values.", + HistoryFieldType::AUTO_COEFFICIENT); + } + } + } + + if (config->GetDirectDiff()){ + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + const string &fieldIdentifier = historyOutput_List[iField]; + const HistoryOutputField ¤tField = historyOutput_Map[fieldIdentifier]; + if (currentField.fieldType == HistoryFieldType::COEFFICIENT){ + AddHistoryOutput("D_" + fieldIdentifier, "d[" + currentField.fieldName + "]", + currentField.screenFormat, "D_" + currentField.outputGroup, + "Derivative value (DIRECT_DIFF=YES)", HistoryFieldType::AUTO_COEFFICIENT); + } + } + } + + if (config->GetTime_Domain() && config->GetDirectDiff()){ + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + const string &fieldIdentifier = historyOutput_List[iField]; + const HistoryOutputField ¤tField = historyOutput_Map[fieldIdentifier]; + if (currentField.fieldType == HistoryFieldType::COEFFICIENT){ + AddHistoryOutput("D_TAVG_" + fieldIdentifier, "dtavg[" + currentField.fieldName + "]", + currentField.screenFormat, "D_TAVG_" + currentField.outputGroup, + "Derivative of the time averaged value (DIRECT_DIFF=YES)", HistoryFieldType::AUTO_COEFFICIENT); + } + } + } + + for (unsigned short iFieldConv = 0; iFieldConv < convFields.size(); iFieldConv++){ + const string &convField = convFields[iFieldConv]; + if (historyOutput_Map.count(convField) > 0){ + if (historyOutput_Map[convField].fieldType == HistoryFieldType::COEFFICIENT){ + AddHistoryOutput("CAUCHY_" + convField, "Cauchy[" + historyOutput_Map[convField].fieldName + "]", ScreenOutputFormat::SCIENTIFIC, "CAUCHY", + "Cauchy residual value of field set with CONV_FIELD." ,HistoryFieldType::AUTO_COEFFICIENT); + } + } + } + +} + +bool COutput::WriteScreen_Header(CConfig *config) { + + unsigned long RestartIter = 0; + + if (config->GetRestart() && config->GetTime_Domain()){ + RestartIter = config->GetRestart_Iter(); + } + + unsigned long ScreenWrt_Freq_Inner = config->GetScreen_Wrt_Freq(2); + unsigned long ScreenWrt_Freq_Outer = config->GetScreen_Wrt_Freq(1); + unsigned long ScreenWrt_Freq_Time = config->GetScreen_Wrt_Freq(0); + + /*--- Header is always disabled for multizone problems unless explicitely requested --- */ + + if (config->GetMultizone_Problem() && !config->GetWrt_ZoneConv()){ + return false; + } + + /*--- Always print header if it is forced ---*/ + + if (headerNeeded){ + headerNeeded = false; + return true; + } + + /* --- Always print header in the first iteration --- */ + + if ((curInnerIter == 0) && + (curOuterIter == 0) && + (curTimeIter == RestartIter)){ + return true; + } + + if (!PrintOutput(curTimeIter, ScreenWrt_Freq_Time)&& + !(curTimeIter == config->GetnTime_Iter() - 1)){ + return false; + } + + /*--- If there is no inner or outer iteration, don't print header ---*/ + if (ScreenWrt_Freq_Outer == 0 && ScreenWrt_Freq_Inner == 0){ + return false; + } + + /*--- Print header if we are at the first inner iteration ---*/ + + if (curInnerIter == 0){ + return true; + } + + return false; +} + +bool COutput::WriteScreen_Output(CConfig *config) { + + unsigned long ScreenWrt_Freq_Inner = config->GetScreen_Wrt_Freq(2); + unsigned long ScreenWrt_Freq_Outer = config->GetScreen_Wrt_Freq(1); + unsigned long ScreenWrt_Freq_Time = config->GetScreen_Wrt_Freq(0); + + if (config->GetMultizone_Problem() && !config->GetWrt_ZoneConv()){ + + return false; + + } + + /*--- Check if screen output should be written --- */ + + if (!PrintOutput(curTimeIter, ScreenWrt_Freq_Time)&& + !(curTimeIter == config->GetnTime_Iter() - 1)){ + + return false; + + } + + if (convergence) {return true;} + + if (!PrintOutput(curOuterIter, ScreenWrt_Freq_Outer) && + !(curOuterIter == config->GetnOuter_Iter() - 1)){ + + return false; + + } + + if (!PrintOutput(curInnerIter, ScreenWrt_Freq_Inner) && + !(curInnerIter == config->GetnInner_Iter() - 1)){ + + return false; + + } + + return true; + +} + +bool COutput::WriteHistoryFile_Output(CConfig *config) { + + unsigned long HistoryWrt_Freq_Inner = config->GetHistory_Wrt_Freq(2); + unsigned long HistoryWrt_Freq_Outer = config->GetHistory_Wrt_Freq(1); + unsigned long HistoryWrt_Freq_Time = config->GetHistory_Wrt_Freq(0); + + /*--- Check if screen output should be written --- */ + + if (!PrintOutput(curTimeIter, HistoryWrt_Freq_Time)&& + !(curTimeIter == config->GetnTime_Iter() - 1)){ + + return false; + + } + + if (convergence) {return true;} + + if (!PrintOutput(curOuterIter,HistoryWrt_Freq_Outer) && + !(curOuterIter == config->GetnOuter_Iter() - 1)){ + + return false; + + } + + if (!PrintOutput(curInnerIter, HistoryWrt_Freq_Inner) && + !(curInnerIter == config->GetnInner_Iter() - 1)){ + + return false; + + } + + return true; + +} + +bool COutput::WriteVolume_Output(CConfig *config, unsigned long Iter){ + if (config->GetTime_Domain()) return ((Iter % config->GetVolume_Wrt_Freq() == 0)); + else { + return ((Iter > 0) && (Iter % config->GetVolume_Wrt_Freq() == 0)); + } +} + +void COutput::SetCommonHistoryFields(CConfig *config){ + + /// BEGIN_GROUP: ITERATION, DESCRIPTION: Iteration identifier. + /// DESCRIPTION: The time iteration index. + AddHistoryOutput("TIME_ITER", "Time_Iter", ScreenOutputFormat::INTEGER, "ITER", "Time iteration index"); + /// DESCRIPTION: The outer iteration index. + AddHistoryOutput("OUTER_ITER", "Outer_Iter", ScreenOutputFormat::INTEGER, "ITER", "Outer iteration index"); + /// DESCRIPTION: The inner iteration index. + AddHistoryOutput("INNER_ITER", "Inner_Iter", ScreenOutputFormat::INTEGER, "ITER", "Inner iteration index"); + /// END_GROUP + + /// BEGIN_GROUP: TIME_DOMAIN, DESCRIPTION: Time integration information + /// Description: The current time + AddHistoryOutput("CUR_TIME", "Cur_Time", ScreenOutputFormat::SCIENTIFIC, "TIME_DOMAIN", "Current physical time (s)"); + /// Description: The current time step + AddHistoryOutput("TIME_STEP", "Time_Step", ScreenOutputFormat::SCIENTIFIC, "TIME_DOMAIN", "Current time step (s)"); + + /// DESCRIPTION: Currently used wall-clock time. + AddHistoryOutput("WALL_TIME", "Time(sec)", ScreenOutputFormat::SCIENTIFIC, "WALL_TIME", "Average wall-clock time"); + +} + +void COutput::LoadCommonHistoryData(CConfig *config){ + + SetHistoryOutputValue("TIME_ITER", curTimeIter); + SetHistoryOutputValue("INNER_ITER", curInnerIter); + SetHistoryOutputValue("OUTER_ITER", curOuterIter); + + if (config->GetTime_Domain()){ + SetHistoryOutputValue("TIME_STEP", config->GetDelta_UnstTimeND()*config->GetTime_Ref()); + if (curInnerIter == 0){ + SetHistoryOutputValue("CUR_TIME", GetHistoryFieldValue("CUR_TIME") + GetHistoryFieldValue("TIME_STEP")); + } + } + + su2double StopTime, UsedTime; +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + + UsedTime = (StopTime - config->Get_StartTime())/((curOuterIter + 1) * (curInnerIter+1)); + + SetHistoryOutputValue("WALL_TIME", UsedTime); + +} + + +void COutput::PrintHistoryFields(){ + + if (rank == MASTER_NODE){ + + PrintingToolbox::CTablePrinter HistoryFieldTable(&std::cout); + + unsigned short NameSize = 0, GroupSize = 0, DescrSize = 0; + + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + + HistoryOutputField &Field = historyOutput_Map[historyOutput_List[iField]]; + + if (Field.description != ""){ + if (historyOutput_List[iField].size() > NameSize){ + NameSize = historyOutput_List[iField].size(); + } + if (Field.outputGroup.size() > GroupSize){ + GroupSize = Field.outputGroup.size(); + } + if (Field.description.size() > DescrSize){ + DescrSize = Field.description.size(); + } + } + } + + cout << "Available screen/history output fields for the current configuration in " << multiZoneHeaderString << ":" << endl; + + HistoryFieldTable.AddColumn("Name", NameSize); + HistoryFieldTable.AddColumn("Group Name", GroupSize); + HistoryFieldTable.AddColumn("Type",5); + HistoryFieldTable.AddColumn("Description", DescrSize); + HistoryFieldTable.SetAlign(PrintingToolbox::CTablePrinter::LEFT); + + HistoryFieldTable.PrintHeader(); + + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + + HistoryOutputField &Field = historyOutput_Map[historyOutput_List[iField]]; + + if (Field.fieldType == HistoryFieldType::DEFAULT + || Field.fieldType == HistoryFieldType::COEFFICIENT + || Field.fieldType == HistoryFieldType::RESIDUAL){ + string type; + switch (Field.fieldType) { + case HistoryFieldType::COEFFICIENT: + type = "C"; + break; + case HistoryFieldType::RESIDUAL: + type = "R"; + break; + default: + type = "D"; + break; + } + + if (Field.description != "") + HistoryFieldTable << historyOutput_List[iField] << Field.outputGroup << type << Field.description; + + } + } + + HistoryFieldTable.PrintFooter(); + + cout << "Type legend: Default (D), Residual (R), Coefficient (C)" << endl; + + cout << "Generated screen/history fields (only first field of every group is shown):" << endl; + + PrintingToolbox::CTablePrinter ModifierTable(&std::cout); + + ModifierTable.AddColumn("Name", NameSize); + ModifierTable.AddColumn("Group Name", GroupSize); + ModifierTable.AddColumn("Type",5); + ModifierTable.AddColumn("Description", DescrSize); + ModifierTable.SetAlign(PrintingToolbox::CTablePrinter::LEFT); + ModifierTable.PrintHeader(); + + std::map GroupVisited; + + for (unsigned short iField = 0; iField < historyOutput_List.size(); iField++){ + + HistoryOutputField &Field = historyOutput_Map[historyOutput_List[iField]]; + + if ((Field.fieldType == HistoryFieldType::AUTO_COEFFICIENT || + Field.fieldType == HistoryFieldType::AUTO_RESIDUAL) && (GroupVisited.count(Field.outputGroup) == 0)){ + string type; + switch (Field.fieldType) { + case HistoryFieldType::AUTO_COEFFICIENT: + type = "AC"; + break; + case HistoryFieldType::AUTO_RESIDUAL: + type = "AR"; + break; + default: + type = "AD"; + break; + } + + if (Field.description != "") + ModifierTable << historyOutput_List[iField] << Field.outputGroup << type << Field.description; + + GroupVisited[Field.outputGroup] = true; + } + } + ModifierTable.PrintFooter(); + + } +} + +void COutput::PrintVolumeFields(){ + + if (rank == MASTER_NODE){ + + PrintingToolbox::CTablePrinter VolumeFieldTable(&std::cout); + + unsigned short NameSize = 0, GroupSize = 0, DescrSize = 0; + + for (unsigned short iField = 0; iField < volumeOutput_List.size(); iField++){ + + VolumeOutputField &Field = volumeOutput_Map[volumeOutput_List[iField]]; + + if (Field.description != ""){ + if (volumeOutput_List[iField].size() > NameSize){ + NameSize = volumeOutput_List[iField].size(); + } + if (Field.outputGroup.size() > GroupSize){ + GroupSize = Field.outputGroup.size(); + } + if (Field.description.size() > DescrSize){ + DescrSize = Field.description.size(); + } + } + } + + cout << "Available volume output fields for the current configuration in " << multiZoneHeaderString << ":" << endl; + cout << "Note: COORDINATES and SOLUTION groups are always in the volume output." << endl; + VolumeFieldTable.AddColumn("Name", NameSize); + VolumeFieldTable.AddColumn("Group Name", GroupSize); + VolumeFieldTable.AddColumn("Description", DescrSize); + VolumeFieldTable.SetAlign(PrintingToolbox::CTablePrinter::LEFT); + + VolumeFieldTable.PrintHeader(); + + for (unsigned short iField = 0; iField < volumeOutput_List.size(); iField++){ + + VolumeOutputField &Field = volumeOutput_Map[volumeOutput_List[iField]]; + + if (Field.description != "") + VolumeFieldTable << volumeOutput_List[iField] << Field.outputGroup << Field.description; + + } + + VolumeFieldTable.PrintFooter(); + } +} diff --git a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp new file mode 100644 index 000000000000..0ca04a32bde9 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp @@ -0,0 +1,150 @@ +#include "../../../include/output/filewriter/CCSVFileWriter.hpp" +#include "../../../include/output/filewriter/CParallelDataSorter.hpp" + +CCSVFileWriter::CCSVFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, std::move(".csv"), nDim){} + + +CCSVFileWriter::~CCSVFileWriter(){ + +} + +void CCSVFileWriter::Write_Data(){ + + /*--- Routine to write the surface CSV files (ASCII). We + assume here that, as an ASCII file, it is safer to merge the + surface data onto the master rank for writing for 2 reasons: + (a) as a surface file, the amount of data should be much less + than the volume solution, and (b) writing ASCII files in parallel + requires serializing the IO calls with barriers, which ruins + the performance at moderate to high rank counts. ---*/ + + unsigned short iVar; + + int iProcessor, nProcessor = size; + + unsigned long iPoint, index; + unsigned long Buffer_Send_nVertex[1], *Buffer_Recv_nVertex = NULL; + unsigned long nLocalVertex_Surface = 0, MaxLocalVertex_Surface = 0; + + ofstream Surf_file; + Surf_file.precision(15); + + /*--- Find the max number of surface vertices among all + partitions so we can set up buffers. The master node will handle + the writing of the CSV file after gathering all of the data. ---*/ + + nLocalVertex_Surface = dataSorter->GetnPoints(); + Buffer_Send_nVertex[0] = nLocalVertex_Surface; + if (rank == MASTER_NODE) Buffer_Recv_nVertex = new unsigned long[nProcessor]; + + /*--- Communicate the number of local vertices on each partition + to the master node with collective calls. ---*/ + + SU2_MPI::Allreduce(&nLocalVertex_Surface, &MaxLocalVertex_Surface, 1, + MPI_UNSIGNED_LONG, MPI_MAX, MPI_COMM_WORLD); + + SU2_MPI::Gather(&Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, + Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, + MASTER_NODE, MPI_COMM_WORLD); + + /*--- Allocate buffers for send/recv of the data and global IDs. ---*/ + + su2double *bufD_Send = new su2double[MaxLocalVertex_Surface*fieldnames.size()](); + su2double *bufD_Recv = NULL; + + unsigned long *bufL_Send = new unsigned long [MaxLocalVertex_Surface](); + unsigned long *bufL_Recv = NULL; + + /*--- Load send buffers with the local data on this rank. ---*/ + + index = 0; + for (iPoint = 0; iPoint < nLocalVertex_Surface; iPoint++) { + + /*--- Global index values. ---*/ + + bufL_Send[iPoint] = dataSorter->GetGlobalIndex(iPoint); + + /*--- Solution data. ---*/ + + for (iVar = 0; iVar < fieldnames.size(); iVar++){ + bufD_Send[index] = dataSorter->GetData(iVar, iPoint); + index++; + } + + } + + /*--- Only the master rank allocates buffers for the recv. ---*/ + + if (rank == MASTER_NODE) { + bufD_Recv = new su2double[nProcessor*MaxLocalVertex_Surface*fieldnames.size()](); + bufL_Recv = new unsigned long[nProcessor*MaxLocalVertex_Surface]; + } + + /*--- Collective comms of the solution data and global IDs. ---*/ + + SU2_MPI::Gather(bufD_Send, (int)MaxLocalVertex_Surface*fieldnames.size(), MPI_DOUBLE, + bufD_Recv, (int)MaxLocalVertex_Surface*fieldnames.size(), MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + + SU2_MPI::Gather(bufL_Send, (int)MaxLocalVertex_Surface, MPI_UNSIGNED_LONG, + bufL_Recv, (int)MaxLocalVertex_Surface, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + + /*--- The master rank alone writes the surface CSV file. ---*/ + + if (rank == MASTER_NODE) { + + /*--- Open the CSV file and write the header with variable names. ---*/ + + Surf_file.open(fileName.c_str(), ios::out); + Surf_file << "\"Point\","; + for (iVar = 0; iVar < fieldnames.size()-1; iVar++) { + Surf_file << "\"" << fieldnames[iVar] << "\","; + } + Surf_file << "\"" << fieldnames[fieldnames.size()-1] << "\"" << endl; + + /*--- Loop through all of the collected data and write each node's values ---*/ + + for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { + for (iPoint = 0; iPoint < Buffer_Recv_nVertex[iProcessor]; iPoint++) { + + /*--- Current index position for global index access. ---*/ + + index = iProcessor*MaxLocalVertex_Surface + iPoint; + + /*--- Write global index values. ---*/ + + Surf_file << bufL_Recv[index] << ", "; + + /*--- Reset index for solution data access. ---*/ + + index = (iProcessor*MaxLocalVertex_Surface*fieldnames.size() + + iPoint*fieldnames.size()); + + /*--- Write the solution data for each field variable. ---*/ + + for (iVar = 0; iVar < fieldnames.size(); iVar++){ + Surf_file << scientific << bufD_Recv[index + iVar]; + if (iVar != fieldnames.size() -1) Surf_file << ", "; + } + Surf_file << endl; + + } + } + + /*--- Close the file. ---*/ + + Surf_file.close(); + + } + + /*--- Free temporary memory. ---*/ + + if (rank == MASTER_NODE) { + delete [] bufL_Recv; + delete [] bufD_Recv; + delete [] Buffer_Recv_nVertex; + } + delete [] bufL_Send; + delete [] bufD_Send; +} diff --git a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp new file mode 100644 index 000000000000..2dd7a2bd1170 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp @@ -0,0 +1,224 @@ +#include "../../../include/output/filewriter/CFEMDataSorter.hpp" +#include "../../../Common/include/fem_geometry_structure.hpp" + +CFEMDataSorter::CFEMDataSorter(CConfig *config, CGeometry *geometry, unsigned short nFields) : CParallelDataSorter(config, nFields){ + + /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary + geometrical information for the FEM DG solver. ---*/ + + CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + + unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); + CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); + + /*--- Create the map from the global DOF ID to the local index. ---*/ + + vector globalID; + + /*--- Update the solution by looping over the owned volume elements. ---*/ + + for(unsigned long l=0; l(geometry); + + unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); + CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); + + const CFEMStandardElement *standardElementsSol = DGGeometry->GetStandardElementsSol(); + + /*--- Determine the number of sub-elements on this rank. ---*/ + unsigned long nSubElem_Local = 0; + for(unsigned long i=0; i 0) Conn_SubElem = new int[nSubElem_Local*NODES_PER_ELEMENT]; + + /*--- Loop again over the local volume elements and store the global + connectivities of the sub-elements. Note one is added to the + index value, because visualization softwares typically use + 1-based indexing. ---*/ + unsigned long kNode = 0; + for(unsigned long i=0; i globalID; + + nGlobalPoint_Sort = geometry->GetGlobal_nPointDomain(); + nLocalPoint_Sort = geometry->GetnPointDomain(); + + Local_Halo = new int[geometry->GetnPoint()](); + + for (unsigned long iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++){ + + /*--- Store the global IDs ---*/ + + globalID.push_back(geometry->node[iPoint]->GetGlobalIndex()); + + Local_Halo[iPoint] = !geometry->node[iPoint]->GetDomain(); + } + + + /*--- Search all send/recv boundaries on this partition for halo cells. In + particular, consider only the recv conditions (these are the true halo + nodes). Check the ranks of the processors that are communicating and + choose to keep only the halo cells from the higher rank processor. ---*/ + + SetHaloPoints(geometry, config); + + /*--- Create the linear partitioner --- */ + + linearPartitioner = new CLinearPartitioner(nGlobalPoint_Sort, 0); + + /*--- Prepare the send buffers ---*/ + + PrepareSendBuffers(globalID); + +} + +CFVMDataSorter::~CFVMDataSorter(){ + + delete [] Local_Halo; + + if (Index != NULL) delete [] Index; + if (idSend != NULL) delete [] idSend; + if (linearPartitioner != NULL) delete linearPartitioner; + +} + +void CFVMDataSorter::SetHaloPoints(CGeometry *geometry, CConfig *config){ + + unsigned long iPoint, iVertex; + unsigned short iMarker; + int SendRecv, RecvFrom; + bool notHalo; + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) { + SendRecv = config->GetMarker_All_SendRecv(iMarker); + RecvFrom = abs(SendRecv)-1; + + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + + /*--- We need to keep one copy of overlapping halo cells. ---*/ + + notHalo = ((SendRecv < 0) && (rank > RecvFrom)); + + /*--- If we found either of these types of nodes, flag them to be kept. ---*/ + + if (notHalo) { + Local_Halo[iPoint] = false; + } + } + } + } +} + + + + +void CFVMDataSorter::SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) { + + /*--- Sort connectivity for each type of element (excluding halos). Note + In these routines, we sort the connectivity into a linear partitioning + across all processors based on the global index of the grid nodes. ---*/ + + SortVolumetricConnectivity(config, geometry, TRIANGLE, val_sort); + SortVolumetricConnectivity(config, geometry, QUADRILATERAL, val_sort); + SortVolumetricConnectivity(config, geometry, TETRAHEDRON, val_sort); + SortVolumetricConnectivity(config, geometry, HEXAHEDRON, val_sort); + SortVolumetricConnectivity(config, geometry, PRISM, val_sort); + SortVolumetricConnectivity(config, geometry, PYRAMID, val_sort); + + + /*--- Reduce the total number of cells we will be writing in the output files. ---*/ + + unsigned long nTotal_Elem = nParallel_Tria + nParallel_Quad + nParallel_Tetr + nParallel_Hexa + nParallel_Pris + nParallel_Pyra; +#ifndef HAVE_MPI + nGlobal_Elem_Par = nTotal_Elem; +#else + SU2_MPI::Allreduce(&nTotal_Elem, &nGlobal_Elem_Par, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#endif + + connectivity_sorted = true; + +} + +void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, + CGeometry *geometry, + unsigned short Elem_Type, + bool val_sort) { + + unsigned long iProcessor; + unsigned short NODES_PER_ELEMENT = 0; + unsigned long iPoint, jPoint; + unsigned long nElem_Total = 0, Global_Index; + + int *Conn_Elem = NULL; + +#ifdef HAVE_MPI + SU2_MPI::Request *send_req, *recv_req; + SU2_MPI::Status status; + int ind; +#endif + + /*--- Store the local number of this element type and the number of nodes + per this element type. In serial, this will be the total number of this + element type in the entire mesh. In parallel, it is the number on only + the current partition. ---*/ + + switch (Elem_Type) { + case TRIANGLE: + NODES_PER_ELEMENT = N_POINTS_TRIANGLE; + break; + case QUADRILATERAL: + NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; + break; + case TETRAHEDRON: + NODES_PER_ELEMENT = N_POINTS_TETRAHEDRON; + break; + case HEXAHEDRON: + NODES_PER_ELEMENT = N_POINTS_HEXAHEDRON; + break; + case PRISM: + NODES_PER_ELEMENT = N_POINTS_PRISM; + break; + case PYRAMID: + NODES_PER_ELEMENT = N_POINTS_PYRAMID; + break; + default: + SU2_MPI::Error("Unrecognized element type", CURRENT_FUNCTION); + } + + /*--- We start with the connectivity distributed across all procs with + no particular ordering assumed. We need to loop through our local partition + and decide how many elements we must send to each other rank in order to + have all elements sorted according to a linear partitioning of the grid + nodes, i.e., rank 0 holds the first nPoint()/nProcessors nodes. + First, initialize a counter and flag. ---*/ + + int *nElem_Send = new int[size+1](); nElem_Send[0] = 0; + int *nElem_Recv = new int[size+1](); nElem_Recv[0] = 0; + int *nElem_Flag = new int[size](); + + for (int ii=0; ii < size; ii++) { + nElem_Send[ii] = 0; + nElem_Recv[ii] = 0; + nElem_Flag[ii]= -1; + } + nElem_Send[size] = 0; nElem_Recv[size] = 0; + + for (int ii = 0; ii < (int)geometry->GetnElem(); ii++ ) { + if (geometry->elem[ii]->GetVTK_Type() == Elem_Type) { + for ( int jj = 0; jj < NODES_PER_ELEMENT; jj++ ) { + + /*--- Get the index of the current point. ---*/ + + iPoint = geometry->elem[ii]->GetNode(jj); + Global_Index = geometry->node[iPoint]->GetGlobalIndex(); + + /*--- Search for the lowest global index in this element. We + send the element to the processor owning the range that includes + the lowest global index value. ---*/ + + for (int kk = 0; kk < NODES_PER_ELEMENT; kk++) { + jPoint = geometry->elem[ii]->GetNode(kk); + unsigned long newID = geometry->node[jPoint]->GetGlobalIndex(); + if (newID < Global_Index) Global_Index = newID; + } + + /*--- Search for the processor that owns this point. If we are + sorting the elements, we use the linear partitioning to find + the rank, otherwise, we simply have the current rank load its + own elements into the connectivity data structure. ---*/ + + if (val_sort) { + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + } else { + iProcessor = rank; + } + + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != ii)) { + nElem_Flag[iProcessor] = ii; + nElem_Send[iProcessor+1]++; + } + + } + } + } + + /*--- Communicate the number of cells to be sent/recv'd amongst + all processors. After this communication, each proc knows how + many cells it will receive from each other processor. ---*/ + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, + &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nElem_Recv[1] = nElem_Send[1]; +#endif + + /*--- Prepare to send connectivities. First check how many + messages we will be sending and receiving. Here we also put + the counters into cumulative storage format to make the + communications simpler. ---*/ + + int nSends = 0, nRecvs = 0; + for (int ii=0; ii < size; ii++) nElem_Flag[ii] = -1; + + for (int ii = 0; ii < size; ii++) { + if ((ii != rank) && (nElem_Send[ii+1] > 0)) nSends++; + if ((ii != rank) && (nElem_Recv[ii+1] > 0)) nRecvs++; + + nElem_Send[ii+1] += nElem_Send[ii]; + nElem_Recv[ii+1] += nElem_Recv[ii]; + } + + /*--- Allocate memory to hold the connectivity that we are + sending. ---*/ + + unsigned long *connSend = NULL; + connSend = new unsigned long[NODES_PER_ELEMENT*nElem_Send[size]](); + + /*--- Allocate arrays for storing halo flags. ---*/ + + unsigned short *haloSend = new unsigned short[nElem_Send[size]](); + for (int ii = 0; ii < nElem_Send[size]; ii++) + haloSend[ii] = false; + + /*--- Create an index variable to keep track of our index + position as we load up the send buffer. ---*/ + + unsigned long *index = new unsigned long[size](); + for (int ii=0; ii < size; ii++) index[ii] = NODES_PER_ELEMENT*nElem_Send[ii]; + + unsigned long *haloIndex = new unsigned long[size](); + for (int ii=0; ii < size; ii++) haloIndex[ii] = nElem_Send[ii]; + + /*--- Loop through our elements and load the elems and their + additional data that we will send to the other procs. ---*/ + + for (int ii = 0; ii < (int)geometry->GetnElem(); ii++) { + if (geometry->elem[ii]->GetVTK_Type() == Elem_Type) { + for ( int jj = 0; jj < NODES_PER_ELEMENT; jj++ ) { + + /*--- Get the index of the current point. ---*/ + + iPoint = geometry->elem[ii]->GetNode(jj); + Global_Index = geometry->node[iPoint]->GetGlobalIndex(); + + /*--- Search for the lowest global index in this element. We + send the element to the processor owning the range that includes + the lowest global index value. ---*/ + + for (int kk = 0; kk < NODES_PER_ELEMENT; kk++) { + jPoint = geometry->elem[ii]->GetNode(kk); + unsigned long newID = geometry->node[jPoint]->GetGlobalIndex(); + if (newID < Global_Index) Global_Index = newID; + } + + /*--- Search for the processor that owns this point. If we are + sorting the elements, we use the linear partitioning to find + the rank, otherwise, we simply have the current rank load its + own elements into the connectivity data structure. ---*/ + + if (val_sort) { + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + } else { + iProcessor = rank; + } + + /*--- Load connectivity into the buffer for sending ---*/ + + if (nElem_Flag[iProcessor] != ii) { + + nElem_Flag[iProcessor] = ii; + unsigned long nn = index[iProcessor]; + unsigned long mm = haloIndex[iProcessor]; + + /*--- Load the connectivity values. ---*/ + + for (int kk = 0; kk < NODES_PER_ELEMENT; kk++) { + iPoint = geometry->elem[ii]->GetNode(kk); + connSend[nn] = geometry->node[iPoint]->GetGlobalIndex(); nn++; + + /*--- Check if this is a halo node. If so, flag this element + as a halo cell. We will use this later to sort and remove + any duplicates from the connectivity list. Note that just checking + whether the point is a halo point is not enough, since we want to keep + elements on one side of the send receive boundary. ---*/ + + if (Local_Halo[iPoint]) haloSend[mm] = true; + } + + /*--- Increment the index by the message length ---*/ + + index[iProcessor] += NODES_PER_ELEMENT; + haloIndex[iProcessor]++; + + } + } + } + } + + /*--- Free memory after loading up the send buffer. ---*/ + + delete [] index; + delete [] haloIndex; + + /*--- Allocate the memory that we need for receiving the conn + values and then cue up the non-blocking receives. Note that + we do not include our own rank in the communications. We will + directly copy our own data later. ---*/ + + unsigned long *connRecv = NULL; + connRecv = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]](); + + unsigned short *haloRecv = new unsigned short[nElem_Recv[size]](); + +#ifdef HAVE_MPI + + send_req = new SU2_MPI::Request[2*nSends]; + recv_req = new SU2_MPI::Request[2*nRecvs]; + + /*--- Launch the non-blocking recv's for the connectivity. ---*/ + + unsigned long iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = NODES_PER_ELEMENT*nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = NODES_PER_ELEMENT*kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(connRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the connectivity. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = NODES_PER_ELEMENT*nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = NODES_PER_ELEMENT*kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(connSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } + + /*--- Repeat the process to communicate the halo flags. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(haloRecv[ll]), count, MPI_UNSIGNED_SHORT, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage+nRecvs])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the halo flags. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(haloSend[ll]), count, MPI_UNSIGNED_SHORT, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage+nSends])); + iMessage++; + } + } +#endif + + /*--- Copy my own rank's data into the recv buffer directly. ---*/ + + int mm = NODES_PER_ELEMENT*nElem_Recv[rank]; + int ll = NODES_PER_ELEMENT*nElem_Send[rank]; + int kk = NODES_PER_ELEMENT*nElem_Send[rank+1]; + + for (int nn=ll; nn 0) Conn_Elem = new int[NODES_PER_ELEMENT*nElem_Recv[size]](); + int count = 0; nElem_Total = 0; + for (int ii = 0; ii < nElem_Recv[size]; ii++) { + if (!haloRecv[ii]) { + nElem_Total++; + for (int jj = 0; jj < NODES_PER_ELEMENT; jj++) { + Conn_Elem[count] = (int)connRecv[ii*NODES_PER_ELEMENT+jj] + 1; + count++; + } + } + } + + /*--- Store the particular global element count in the class data, + and set the class data pointer to the connectivity array. ---*/ + + switch (Elem_Type) { + case TRIANGLE: + nParallel_Tria = nElem_Total; + if (Conn_Tria_Par != NULL) delete [] Conn_Tria_Par; + if (nParallel_Tria > 0) Conn_Tria_Par = Conn_Elem; + break; + case QUADRILATERAL: + nParallel_Quad = nElem_Total; + if (Conn_Quad_Par != NULL) delete [] Conn_Quad_Par; + if (nParallel_Quad > 0) Conn_Quad_Par = Conn_Elem; + break; + case TETRAHEDRON: + nParallel_Tetr = nElem_Total; + if (Conn_Tetr_Par != NULL) delete [] Conn_Tetr_Par; + if (nParallel_Tetr > 0) Conn_Tetr_Par = Conn_Elem; + break; + case HEXAHEDRON: + nParallel_Hexa = nElem_Total; + if (Conn_Hexa_Par != NULL) delete [] Conn_Hexa_Par; + if (nParallel_Hexa > 0) Conn_Hexa_Par = Conn_Elem; + break; + case PRISM: + nParallel_Pris = nElem_Total; + if (Conn_Pris_Par != NULL) delete [] Conn_Pris_Par; + if (nParallel_Pris > 0) Conn_Pris_Par = Conn_Elem; + break; + case PYRAMID: + nParallel_Pyra = nElem_Total; + if (Conn_Pyra_Par != NULL) delete [] Conn_Pyra_Par; + if (nParallel_Pyra > 0) Conn_Pyra_Par = Conn_Elem; + break; + default: + SU2_MPI::Error("Unrecognized element type", CURRENT_FUNCTION); + break; + } + + /*--- Free temporary memory from communications ---*/ + + delete [] connSend; + delete [] connRecv; + delete [] haloSend; + delete [] haloRecv; + delete [] nElem_Recv; + delete [] nElem_Send; + delete [] nElem_Flag; + +} diff --git a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp new file mode 100644 index 000000000000..b0c7b1aa2c99 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp @@ -0,0 +1,411 @@ +#include "../../../include/output/filewriter/CParallelDataSorter.hpp" +#include + +CParallelDataSorter::CParallelDataSorter(CConfig *config, unsigned short nFields){ + + rank = SU2_MPI::GetRank(); + size = SU2_MPI::GetSize(); + + GlobalField_Counter = nFields; + + nParallel_Hexa = 0; + nParallel_Line = 0; + nParallel_Quad = 0; + nParallel_Tetr = 0; + nParallel_Pris = 0; + nParallel_Pyra = 0; + nParallel_Tria = 0; + + Conn_Line_Par = NULL; + Conn_Hexa_Par = NULL; + Conn_Pris_Par = NULL; + Conn_Quad_Par = NULL; + Conn_Tetr_Par = NULL; + Conn_Tria_Par = NULL; + Conn_Pyra_Par = NULL; + + nPoint_Send = NULL; + nPoint_Recv = NULL; + Index = NULL; + connSend = NULL; + dataBuffer = NULL; + passiveDoubleBuffer = NULL; + doubleBuffer = NULL; + idSend = NULL; + nSends = 0; + nRecvs = 0; + + nLocalPoint_Sort = 0; + nGlobalPoint_Sort = 0; + + nPoint_Send = new int[size+1](); + nPoint_Recv = new int[size+1](); + + linearPartitioner = NULL; + +} + +CParallelDataSorter::~CParallelDataSorter(){ + + if (nPoint_Send != NULL) delete [] nPoint_Send; + if (nPoint_Recv != NULL) delete [] nPoint_Recv; + + /*--- Deallocate memory for connectivity data on each processor. ---*/ + + if (nParallel_Line > 0 && Conn_Line_Par != NULL) delete [] Conn_Line_Par; + if (nParallel_Tria > 0 && Conn_Tria_Par != NULL) delete [] Conn_Tria_Par; + if (nParallel_Quad > 0 && Conn_Quad_Par != NULL) delete [] Conn_Quad_Par; + if (nParallel_Tetr > 0 && Conn_Tetr_Par != NULL) delete [] Conn_Tetr_Par; + if (nParallel_Hexa > 0 && Conn_Hexa_Par != NULL) delete [] Conn_Hexa_Par; + if (nParallel_Pris > 0 && Conn_Pris_Par != NULL) delete [] Conn_Pris_Par; + if (nParallel_Pyra > 0 && Conn_Pyra_Par != NULL) delete [] Conn_Pyra_Par; + + if (connSend != NULL) delete [] connSend; + + if (dataBuffer != NULL) delete [] dataBuffer; +} + + +unsigned long CParallelDataSorter::GetnElem(GEO_TYPE type){ + + switch (type) { + case LINE: + return nParallel_Line; + break; + case TRIANGLE: + return nParallel_Tria; + break; + case QUADRILATERAL: + return nParallel_Quad; + break; + case TETRAHEDRON: + return nParallel_Tetr; + break; + case HEXAHEDRON: + return nParallel_Hexa; + break; + case PRISM: + return nParallel_Pris; + break; + case PYRAMID: + return nParallel_Pyra; + break; + default: + break; + } + + SU2_MPI::Error("GEO_TYPE not found", CURRENT_FUNCTION); + + return 0; +} + +void CParallelDataSorter::SortOutputData() { + + int VARS_PER_POINT = GlobalField_Counter; + +#ifdef HAVE_MPI + SU2_MPI::Request *send_req, *recv_req; + SU2_MPI::Status status; + int ind; +#endif + + /*--- Allocate the memory that we need for receiving the conn + values and then cue up the non-blocking receives. Note that + we do not include our own rank in the communications. We will + directly copy our own data later. ---*/ + + + unsigned long *idRecv = new unsigned long[nPoint_Recv[size]](); + +#ifdef HAVE_MPI + /*--- We need double the number of messages to send both the conn. + and the global IDs. ---*/ + + send_req = new SU2_MPI::Request[2*nSends]; + recv_req = new SU2_MPI::Request[2*nRecvs]; + + unsigned long iMessage = 0; + for (int ii=0; ii nPoint_Recv[ii])) { + int ll = VARS_PER_POINT*nPoint_Recv[ii]; + int kk = nPoint_Recv[ii+1] - nPoint_Recv[ii]; + int count = VARS_PER_POINT*kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(doubleBuffer[ll]), count, MPI_DOUBLE, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the connectivity. ---*/ + + iMessage = 0; + for (int ii=0; ii nPoint_Send[ii])) { + int ll = VARS_PER_POINT*nPoint_Send[ii]; + int kk = nPoint_Send[ii+1] - nPoint_Send[ii]; + int count = VARS_PER_POINT*kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(connSend[ll]), count, MPI_DOUBLE, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } + + /*--- Repeat the process to communicate the global IDs. ---*/ + + iMessage = 0; + for (int ii=0; ii nPoint_Recv[ii])) { + int ll = nPoint_Recv[ii]; + int kk = nPoint_Recv[ii+1] - nPoint_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(idRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage+nRecvs])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the global IDs. ---*/ + + iMessage = 0; + for (int ii=0; ii nPoint_Send[ii])) { + int ll = nPoint_Send[ii]; + int kk = nPoint_Send[ii+1] - nPoint_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(idSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage+nSends])); + iMessage++; + } + } +#endif + + /*--- Copy my own rank's data into the recv buffer directly. ---*/ + + int mm = VARS_PER_POINT*nPoint_Recv[rank]; + int ll = VARS_PER_POINT*nPoint_Send[rank]; + int kk = VARS_PER_POINT*nPoint_Send[rank+1]; + + for (int nn=ll; nn::value){ + for (int jj = 0; jj < VARS_PER_POINT*nPoint_Recv[size]; jj++){ + const passivedouble tmpVal = SU2_TYPE::GetValue(doubleBuffer[jj]); + passiveDoubleBuffer[jj] = tmpVal; + /*--- For some AD datatypes a call of the destructor is + * necessary to properly delete the AD type ---*/ + doubleBuffer[jj].~su2double(); + } + } + + /*--- Step 2: Reorder the data in the buffer --- */ + + passivedouble *tmpBuffer = new passivedouble[nPoint_Recv[size]]; + for (int jj = 0; jj < VARS_PER_POINT; jj++){ + for (int ii = 0; ii < nPoint_Recv[size]; ii++){ + tmpBuffer[idRecv[ii]] = passiveDoubleBuffer[ii*VARS_PER_POINT+jj]; + } + for (int ii = 0; ii < nPoint_Recv[size]; ii++){ + passiveDoubleBuffer[ii*VARS_PER_POINT+jj] = tmpBuffer[ii]; + } + } + + delete [] tmpBuffer; + + /*--- Store the total number of local points my rank has for + the current section after completing the communications. ---*/ + + nParallel_Poin = nPoint_Recv[size]; + + /*--- Reduce the total number of points we will write in the output files. ---*/ + +#ifndef HAVE_MPI + nGlobal_Poin_Par = nParallel_Poin; +#else + SU2_MPI::Allreduce(&nParallel_Poin, &nGlobal_Poin_Par, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#endif + + /*--- Free temporary memory from communications ---*/ + + delete [] idRecv; +} + +void CParallelDataSorter::PrepareSendBuffers(std::vector& globalID){ + + unsigned long iPoint; + unsigned short iProcessor; + + int VARS_PER_POINT = GlobalField_Counter; + + /*--- We start with the grid nodes distributed across all procs with + no particular ordering assumed. We need to loop through our local partition + and decide how many nodes we must send to each other rank in order to + have all nodes sorted according to a linear partitioning of the grid + nodes, i.e., rank 0 holds the first ~ nGlobalPoint()/nProcessors nodes. + First, initialize a counter and flag. ---*/ + + for (iPoint = 0; iPoint < nLocalPoint_Sort; iPoint++ ) { + + iProcessor = linearPartitioner->GetRankContainingIndex(globalID[iPoint]); + + /*--- If we have not visited this node yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + nPoint_Send[iProcessor+1]++; + } + + /*--- Communicate the number of nodes to be sent/recv'd amongst + all processors. After this communication, each proc knows how + many cells it will receive from each other processor. ---*/ + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, + &(nPoint_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nPoint_Recv[1] = nPoint_Send[1]; +#endif + + /*--- Prepare to send coordinates. First check how many + messages we will be sending and receiving. Here we also put + the counters into cumulative storage format to make the + communications simpler. ---*/ + + nSends = 0; nRecvs = 0; + + for (int ii = 0; ii < size; ii++) { + if ((ii != rank) && (nPoint_Send[ii+1] > 0)) nSends++; + if ((ii != rank) && (nPoint_Recv[ii+1] > 0)) nRecvs++; + + nPoint_Send[ii+1] += nPoint_Send[ii]; + nPoint_Recv[ii+1] += nPoint_Recv[ii]; + } + + /*--- Allocate memory to hold the connectivity that we are + sending. ---*/ + + connSend = NULL; + connSend = new su2double[VARS_PER_POINT*nPoint_Send[size]](); + + /*--- Allocate the data buffer to hold the sorted data. We have to make it large enough + * to hold passivedoubles and su2doubles ---*/ + unsigned short maxSize = max(sizeof(passivedouble), sizeof(su2double)); + dataBuffer = new char[VARS_PER_POINT*nPoint_Recv[size]*maxSize]; + + /*--- doubleBuffer and passiveDouble buffer use the same memory allocated above using the dataBuffer. ---*/ + + doubleBuffer = reinterpret_cast(dataBuffer); + passiveDoubleBuffer = reinterpret_cast(dataBuffer); + + /*--- Allocate arrays for sending the global ID. ---*/ + + idSend = new unsigned long[nPoint_Send[size]](); + + /*--- Create an index variable to keep track of our index + positions as we load up the send buffer. ---*/ + + unsigned long *index = new unsigned long[size](); + for (int ii=0; ii < size; ii++) index[ii] = VARS_PER_POINT*nPoint_Send[ii]; + + unsigned long *idIndex = new unsigned long[size](); + for (int ii=0; ii < size; ii++) idIndex[ii] = nPoint_Send[ii]; + + Index = new unsigned long[nLocalPoint_Sort](); + + /*--- Loop through our elements and load the elems and their + additional data that we will send to the other procs. ---*/ + + for (iPoint = 0; iPoint < nLocalPoint_Sort; iPoint++) { + + iProcessor = linearPartitioner->GetRankContainingIndex(globalID[iPoint]); + + /*--- Load the global ID (minus offset) for sorting the + points once they all reach the correct processor. ---*/ + + unsigned long nn = idIndex[iProcessor]; + idSend[nn] = globalID[iPoint] - linearPartitioner->GetFirstIndexOnRank(iProcessor); + + /*--- Store the index this point has in the send buffer ---*/ + + Index[iPoint] = index[iProcessor]; + + /*--- Increment the index by the message length ---*/ + + index[iProcessor] += VARS_PER_POINT; + idIndex[iProcessor]++; + + + } + + /*--- Free memory after loading up the send buffer. ---*/ + + delete [] index; + delete [] idIndex; +} + +unsigned long CParallelDataSorter::GetElem_Connectivity(GEO_TYPE type, unsigned long iElem, unsigned long iNode) { + + switch (type) { + case LINE: + return Conn_Line_Par[iElem*N_POINTS_LINE + iNode]; + break; + case TRIANGLE: + return Conn_Tria_Par[iElem*N_POINTS_TRIANGLE + iNode]; + break; + case QUADRILATERAL: + return Conn_Quad_Par[iElem*N_POINTS_QUADRILATERAL + iNode]; + break; + case TETRAHEDRON: + return Conn_Tetr_Par[iElem*N_POINTS_TETRAHEDRON + iNode]; + break; + case HEXAHEDRON: + return Conn_Hexa_Par[iElem*N_POINTS_HEXAHEDRON + iNode]; + break; + case PRISM: + return Conn_Pris_Par[iElem*N_POINTS_PRISM + iNode]; + break; + case PYRAMID: + return Conn_Pyra_Par[iElem*N_POINTS_PYRAMID + iNode]; + break; + default: + break; + } + + SU2_MPI::Error("GEO_TYPE not found", CURRENT_FUNCTION); + + return 0; +} + diff --git a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp new file mode 100644 index 000000000000..296af1426644 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp @@ -0,0 +1,24 @@ +#include "../../../include/output/filewriter/CFileWriter.hpp" + + +CFileWriter::CFileWriter(vector fields, string fileName, + CParallelDataSorter *dataSorter, string file_ext, unsigned short nDim): + fieldnames(std::move(fields)), + nDim(nDim), + file_ext(file_ext), + fileName(std::move(fileName)), + dataSorter(dataSorter){ + + rank = SU2_MPI::GetRank(); + size = SU2_MPI::GetSize(); + + this->fileName += file_ext; + + file_size = 0.0; + +} + + +CFileWriter::~CFileWriter(){ + +} diff --git a/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp new file mode 100644 index 000000000000..c16340a75e87 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp @@ -0,0 +1,1123 @@ +#include "../../../include/output/filewriter/CParaviewBinaryFileWriter.hpp" + +const string CParaviewBinaryFileWriter::fileExt = ".vtk"; + +CParaviewBinaryFileWriter::CParaviewBinaryFileWriter(vector fields, unsigned short nDim, string fileName, + CParallelDataSorter *dataSorter) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim){} + + +CParaviewBinaryFileWriter::~CParaviewBinaryFileWriter(){ + +} + +void CParaviewBinaryFileWriter::Write_Data(){ + + if (!dataSorter->GetConnectivitySorted()){ + SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); + } + + unsigned short iDim; + + unsigned long iPoint, iElem; + + ofstream Paraview_File; + + const int MAX_STRING_LENGTH = 255; + char str_buf[MAX_STRING_LENGTH], fname[100]; + + const int NCOORDS = 3; + + strcpy(fname, fileName.c_str()); + + /* Check for big endian. We have to swap bytes otherwise. + * Since size of character is 1 byte when the character pointer + * is de-referenced it will contain only first byte of integer. ---*/ + + bool BigEndian = false; + unsigned int i = 1; + char *c = (char*)&i; + if (*c) BigEndian = false; + else BigEndian = true; + + file_size = 0.0; + + /*--- Set a timer for the file writing. ---*/ + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + + /*--- Serial implementation in case we have not compiled with MPI. ---*/ + +#ifndef HAVE_MPI + + FILE* fhw; + fhw = fopen(fname, "wb"); + + unsigned long iNode2; + unsigned long nGlobal_Elem_Storage; + + /*--- Error check for opening the file. ---*/ + + if (!fhw) { + SU2_MPI::Error(string("Unable to open VTK binary legacy file ") + + fileName, CURRENT_FUNCTION); + } + + /*--- File header written in ASCII. ---*/ + + strcpy(str_buf, "# vtk DataFile Version 3.0\n"); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + strcpy(str_buf, "vtk output\n"); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + strcpy(str_buf, "BINARY\n"); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + strcpy(str_buf, "DATASET UNSTRUCTURED_GRID\n"); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Write the point coordinates. ---*/ + + unsigned long GlobalPoint = dataSorter->GetnPointsGlobal(); + + SPRINTF(str_buf, "POINTS %i float\n", (int)GlobalPoint); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Load/write the 1D buffer of point coordinates. ---*/ + + float *coord_buf = new float[GlobalPoint*NCOORDS]; + for (iPoint = 0; iPoint < GlobalPoint; iPoint++) { + for (iDim = 0; iDim < NCOORDS; iDim++) { + if (nDim == 2 && iDim == 2) { + coord_buf[iPoint*NCOORDS + iDim] = 0.0; + } else { + float val = (float)dataSorter->GetData(iDim,iPoint); + coord_buf[iPoint*NCOORDS + iDim] = val; + } + } + } + if (!BigEndian) SwapBytes((char *)coord_buf, sizeof(float), 3*GlobalPoint); + + fwrite(coord_buf, sizeof(float), 3*GlobalPoint, fhw); + file_size += sizeof(char)*3*GlobalPoint; + + delete [] coord_buf; + + /*--- Write the connectivity data. ---*/ + + unsigned long nTot_Line; + unsigned long nTot_Tria, nTot_Quad; + unsigned long nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; + nTot_Line = dataSorter->GetnElem(LINE); + nTot_Tria = dataSorter->GetnElem(TRIANGLE); + nTot_Quad = dataSorter->GetnElem(QUADRILATERAL); + nTot_Tetr = dataSorter->GetnElem(TETRAHEDRON); + nTot_Hexa = dataSorter->GetnElem(HEXAHEDRON); + nTot_Pris = dataSorter->GetnElem(PRISM); + nTot_Pyra = dataSorter->GetnElem(PYRAMID); + nGlobal_Elem_Storage = (nTot_Line*3 + nTot_Tria*4 + nTot_Quad*5 + nTot_Tetr*5 + + nTot_Hexa*9 + nTot_Pris*7 + nTot_Pyra*6); + + int *conn_buf = NULL; + + SPRINTF (str_buf, "\nCELLS %i %i\n", (int)dataSorter->GetnElem(), + (int)nGlobal_Elem_Storage); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + conn_buf = new int[dataSorter->GetnElem()*(N_POINTS_HEXAHEDRON+1)]; + + + /*--- Load/write 1D buffers for the connectivity of each element type. ---*/ + + + for (iElem = 0; iElem < nTot_Line; iElem++) { + iNode2 = iElem*(N_POINTS_LINE+1); + conn_buf[iNode2+0] = N_POINTS_LINE; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(LINE, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(LINE, iElem, 1)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Line*(N_POINTS_LINE+1)); + fwrite(conn_buf, sizeof(int), + nTot_Line*(N_POINTS_LINE+1), fhw); + + file_size += sizeof(int)*nTot_Line*(N_POINTS_LINE+1); + + for (iElem = 0; iElem < nTot_Tria; iElem++) { + iNode2 = iElem*(N_POINTS_TRIANGLE+1); + conn_buf[iNode2+0] = N_POINTS_TRIANGLE; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1)-1; + conn_buf[iNode2+3] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Tria*(N_POINTS_TRIANGLE+1)); + fwrite(conn_buf, sizeof(int), + nTot_Tria*(N_POINTS_TRIANGLE+1), fhw); + file_size += sizeof(int)*nTot_Tria*(N_POINTS_TRIANGLE+1); + + for (iElem = 0; iElem < nTot_Quad; iElem++) { + iNode2 = iElem*(N_POINTS_QUADRILATERAL+1); + conn_buf[iNode2+0] = N_POINTS_QUADRILATERAL; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1)-1; + conn_buf[iNode2+3] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2)-1; + conn_buf[iNode2+4] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Quad*(N_POINTS_QUADRILATERAL+1)); + fwrite(conn_buf, sizeof(int), + nTot_Quad*(N_POINTS_QUADRILATERAL+1), fhw); + file_size += sizeof(int)*nTot_Quad*(N_POINTS_QUADRILATERAL+1); + + for (iElem = 0; iElem < nTot_Tetr; iElem++) { + iNode2 = iElem*(N_POINTS_TETRAHEDRON+1); + conn_buf[iNode2+0] = N_POINTS_TETRAHEDRON; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1)-1; + conn_buf[iNode2+3] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2)-1; + conn_buf[iNode2+4] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Tetr*(N_POINTS_TETRAHEDRON+1)); + fwrite(conn_buf, sizeof(int), + nTot_Tetr*(N_POINTS_TETRAHEDRON+1), fhw); + file_size += sizeof(int)*nTot_Tetr*(N_POINTS_TETRAHEDRON+1); + + for (iElem = 0; iElem < nTot_Hexa; iElem++) { + iNode2 = iElem*(N_POINTS_HEXAHEDRON+1); + conn_buf[iNode2+0] = N_POINTS_HEXAHEDRON; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1)-1; + conn_buf[iNode2+3] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2)-1; + conn_buf[iNode2+4] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3)-1; + conn_buf[iNode2+5] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4)-1; + conn_buf[iNode2+6] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5)-1; + conn_buf[iNode2+7] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6)-1; + conn_buf[iNode2+8] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Hexa*(N_POINTS_HEXAHEDRON+1)); + fwrite(conn_buf, sizeof(int), + nTot_Hexa*(N_POINTS_HEXAHEDRON+1), fhw); + file_size += sizeof(int)*nTot_Hexa*(N_POINTS_HEXAHEDRON+1); + + for (iElem = 0; iElem < nTot_Pris; iElem++) { + iNode2 = iElem*(N_POINTS_PRISM+1); + conn_buf[iNode2+0] = N_POINTS_PRISM; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(PRISM, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(PRISM, iElem, 1)-1; + conn_buf[iNode2+3] = dataSorter->GetElem_Connectivity(PRISM, iElem, 2)-1; + conn_buf[iNode2+4] = dataSorter->GetElem_Connectivity(PRISM, iElem, 3)-1; + conn_buf[iNode2+5] = dataSorter->GetElem_Connectivity(PRISM, iElem, 4)-1; + conn_buf[iNode2+6] = dataSorter->GetElem_Connectivity(PRISM, iElem, 5)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Pris*(N_POINTS_PRISM+1)); + fwrite(conn_buf, sizeof(int), + nTot_Pris*(N_POINTS_PRISM+1), fhw); + file_size += sizeof(int)*nTot_Pris*(N_POINTS_PRISM+1); + + for (iElem = 0; iElem < nTot_Pyra; iElem++) { + iNode2 = iElem*(N_POINTS_PYRAMID+1); + conn_buf[iNode2+0] = N_POINTS_PYRAMID; + conn_buf[iNode2+1] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0)-1; + conn_buf[iNode2+2] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1)-1; + conn_buf[iNode2+3] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2)-1; + conn_buf[iNode2+4] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3)-1; + conn_buf[iNode2+5] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4)-1; + } + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), + nTot_Pyra*(N_POINTS_PYRAMID+1)); + fwrite(conn_buf, sizeof(int), + nTot_Pyra*(N_POINTS_PYRAMID+1), fhw); + file_size += sizeof(int)*nTot_Pyra*(N_POINTS_PYRAMID+1); + + + if (conn_buf != NULL) delete [] conn_buf; + + /*--- Load/write the cell type for all elements in the file. ---*/ + + + SPRINTF (str_buf, "\nCELL_TYPES %i\n", SU2_TYPE::Int(dataSorter->GetnElem())); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)*strlen(str_buf); + + int *type_buf = NULL; + + type_buf = new int[dataSorter->GetnElem()]; + + for (iElem = 0; iElem < nTot_Line; iElem++) { + type_buf[iElem] = LINE; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Line); + fwrite(type_buf, sizeof(int), nTot_Line, fhw); + file_size += sizeof(int)*nTot_Line; + + for (iElem = 0; iElem < nTot_Tria; iElem++) { + type_buf[iElem] = TRIANGLE; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Tria); + fwrite(type_buf, sizeof(int), nTot_Tria, fhw); + file_size += sizeof(int)*nTot_Tria; + + for (iElem = 0; iElem < nTot_Quad; iElem++) { + type_buf[iElem] = QUADRILATERAL; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Quad); + fwrite(type_buf, sizeof(int), nTot_Quad, fhw); + file_size += sizeof(int)*nTot_Quad; + + for (iElem = 0; iElem < nTot_Tetr; iElem++) { + type_buf[iElem] = TETRAHEDRON; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Tetr); + fwrite(type_buf, sizeof(int), nTot_Tetr, fhw); + file_size += sizeof(int)*nTot_Tetr; + + for (iElem = 0; iElem < nTot_Hexa; iElem++) { + type_buf[iElem] = HEXAHEDRON; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Hexa); + fwrite(type_buf, sizeof(int), nTot_Hexa, fhw); + file_size += sizeof(int)*nTot_Hexa; + + for (iElem = 0; iElem < nTot_Pris; iElem++) { + type_buf[iElem] = PRISM; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Pris); + fwrite(type_buf, sizeof(int), nTot_Pris, fhw); + file_size += sizeof(int)*nTot_Pris; + + for (iElem = 0; iElem < nTot_Pyra; iElem++) { + type_buf[iElem] = PYRAMID; + } + if (!BigEndian) + SwapBytes((char *)type_buf, sizeof(int), nTot_Pyra); + fwrite(type_buf, sizeof(int), nTot_Pyra, fhw); + file_size += sizeof(int)*nTot_Pyra; + + + if (type_buf != NULL) delete [] type_buf; + + /*--- Now write the scalar and vector data (reuse the counts above). ---*/ + + SPRINTF (str_buf, "\nPOINT_DATA %i\n", (int)GlobalPoint); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)* strlen(str_buf); + + unsigned short varStart = 2; + if (nDim == 3) varStart++; + + /*--- Need to adjust container location to avoid PointID tag and coords. ---*/ + + unsigned short iField, VarCounter = varStart; + for (iField = varStart; iField < fieldnames.size(); iField++) { + + string fieldname = fieldnames[iField]; + fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), + fieldname.end()); + + bool output_variable = true, isVector = false; + size_t found = fieldnames[iField].find("_x"); + if (found!=string::npos) { + output_variable = true; + isVector = true; + } + found = fieldnames[iField].find("_y"); + if (found!=string::npos) { + //skip + output_variable = false; + VarCounter++; + } + found = fieldnames[iField].find("_z"); + if (found!=string::npos) { + //skip + output_variable = false; + VarCounter++; + } + + if (output_variable && isVector) { + + fieldname.erase(fieldname.end()-2,fieldname.end()); + SPRINTF (str_buf, "\nVECTORS %s float\n", fieldname.c_str()); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)* strlen(str_buf); + + /*--- Prepare the 1D data buffer on this rank. ---*/ + + float *vec_buf = new float[GlobalPoint*NCOORDS]; + + /*--- For now, create a temp 1D buffer to load up the data for writing. + This will be replaced with a derived data type most likely. ---*/ + + float val = 0.0; + for (iPoint = 0; iPoint < GlobalPoint; iPoint++) + for (iDim = 0; iDim < NCOORDS; iDim++) { + if (nDim == 2 && iDim == 2) { + vec_buf[iPoint*NCOORDS + iDim] = 0.0; + } else { + val = (float)dataSorter->GetData(VarCounter+iDim,iPoint); + vec_buf[iPoint*NCOORDS + iDim] = val; + } + } + if (!BigEndian) + SwapBytes((char *)vec_buf, sizeof(float), NCOORDS*GlobalPoint); + fwrite(vec_buf, sizeof(float), NCOORDS*GlobalPoint, fhw); + file_size += sizeof(float)*NCOORDS*GlobalPoint; + + delete [] vec_buf; + + VarCounter++; + + } else if (output_variable) { + + SPRINTF (str_buf, "\nSCALARS %s float 1\n", fieldname.c_str()); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)* strlen(str_buf); + + SPRINTF (str_buf, "LOOKUP_TABLE default\n"); + fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); + file_size += sizeof(char)* strlen(str_buf); + + /*--- Prepare the 1D data buffer on this rank. ---*/ + + float *scalar_buf = new float[GlobalPoint]; + + /*--- For now, create a temp 1D buffer to load up the data for writing. + This will be replaced with a derived data type most likely. ---*/ + + for (iPoint = 0; iPoint < GlobalPoint; iPoint++) { + float val = (float)dataSorter->GetData(VarCounter,iPoint); + scalar_buf[iPoint] = val; + } + if (!BigEndian) + SwapBytes((char *)scalar_buf, sizeof(float), GlobalPoint); + fwrite(scalar_buf, sizeof(float), GlobalPoint, fhw); + file_size += sizeof(float)*GlobalPoint; + + delete [] scalar_buf; + + VarCounter++; + } + + } + + /*--- Close the file. ---*/ + + fclose(fhw); + +#else + + /*--- Parallel binary output using MPI I/O. ---*/ + + MPI_File fhw; + SU2_MPI::Status status; + MPI_Datatype etype, filetype; + MPI_Offset disp, disp2; + int ierr; + + /*--- All ranks open the file using MPI. Here, we try to open the file with + exclusive so that an error is generated if the file exists. We always want + to write a fresh output file, so we delete any existing files and create + a new one. ---*/ + + ierr = MPI_File_open(MPI_COMM_WORLD, fname, + MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, + MPI_INFO_NULL, &fhw); + if (ierr != MPI_SUCCESS) { + MPI_File_close(&fhw); + if (rank == 0) + MPI_File_delete(fname, MPI_INFO_NULL); + ierr = MPI_File_open(MPI_COMM_WORLD, fname, + MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, + MPI_INFO_NULL, &fhw); + } + + /*--- Error check opening the file. ---*/ + + if (ierr) { + SU2_MPI::Error(string("Unable to open VTK binary legacy file ") + + string(fname), CURRENT_FUNCTION); + } + + /*--- Write the initial strings to the file. Only the master will + write the header lines, but all ranks will store the offsets. ---*/ + + disp = 0; + strcpy(str_buf, "# vtk DataFile Version 3.0\n"); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + + strcpy(str_buf, "vtk output\n"); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + strcpy(str_buf, "BINARY\n"); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + strcpy(str_buf, "DATASET UNSTRUCTURED_GRID\n"); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Communicate the number of total points that will be + written by each rank. After this communication, each proc knows how + many poinnts will be written before its location in the file and the + offsets can be correctly set. ---*/ + + unsigned long myPoint, GlobalPoint; + + GlobalPoint = dataSorter->GetnPointsGlobal(); + myPoint = dataSorter->GetnPoints(); + + + int *nPoint_Snd = new int[size+1]; + int *nPoint_Cum = new int[size+1]; + + nPoint_Snd[0] = 0; nPoint_Cum[0] = 0; + for (int ii=1; ii < size; ii++) { + nPoint_Snd[ii] = myPoint; nPoint_Cum[ii] = 0; + } + nPoint_Snd[size] = myPoint; nPoint_Cum[size] = 0; + + /*--- Communicate the local counts to all ranks for building offsets. ---*/ + + SU2_MPI::Alltoall(&(nPoint_Snd[1]), 1, MPI_INT, + &(nPoint_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); + + /*--- Put the counters into cumulative storage format. ---*/ + + for (int ii = 0; ii < size; ii++) { + nPoint_Cum[ii+1] += nPoint_Cum[ii]; + } + + SPRINTF(str_buf, "POINTS %i float\n", SU2_TYPE::Int(GlobalPoint)); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Load/write the 1D buffer of point coordinates. Note that we + always have 3 coordinate dimensions, even for 2D problems. ---*/ + + float *coord_buf = new float[myPoint*NCOORDS]; + for (iPoint = 0; iPoint < myPoint; iPoint++) { + for (iDim = 0; iDim < NCOORDS; iDim++) { + if (nDim == 2 && iDim == 2) { + coord_buf[iPoint*NCOORDS + iDim] = 0.0; + } else { + float val = (float)dataSorter->GetData(iDim, iPoint); + coord_buf[iPoint*NCOORDS + iDim] = val; + } + } + } + if (!BigEndian) SwapBytes((char *)coord_buf, sizeof(float), myPoint*NCOORDS); + + /*--- We will write the point coordinates as floats. ---*/ + + etype = MPI_FLOAT; + + /*--- Define a derived datatype for this ranks contiguous + chunk of data that will be placed in the file. ---*/ + + MPI_Type_contiguous(myPoint*NCOORDS, MPI_FLOAT, &filetype); + MPI_Type_commit(&filetype); + + /*--- Compute the offset for this rank's linear partition of the + data in bytes. ---*/ + + disp2 = disp + NCOORDS*nPoint_Cum[rank]*sizeof(float); + + /*--- Set the view for the MPI file write, i.e., describe the + location in the file that this rank "sees" for writing its + piece of the file. ---*/ + + MPI_File_set_view(fhw, disp2, etype, filetype, + (char*)"native", MPI_INFO_NULL); + + /*--- Collective call for all ranks to write simultaneously. ---*/ + + MPI_File_write_all(fhw, coord_buf, myPoint*NCOORDS, MPI_FLOAT, &status); + + /*--- Update the displacement position for MPI IO. ---*/ + + disp += NCOORDS*nPoint_Cum[size]*sizeof(float); + file_size += sizeof(float)*myPoint*NCOORDS; + + /*--- Free the derived datatype and coordinate array. ---*/ + + MPI_Type_free(&filetype); + delete [] coord_buf; + + /*--- Compute our local number of elements, the required storage, + and reduce the total number of elements and storage globally. ---*/ + + unsigned long nTot_Line; + unsigned long nTot_Tria, nTot_Quad; + unsigned long nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; + unsigned long myElem, myElemStorage, GlobalElem, GlobalElemStorage; + + unsigned long nParallel_Line = dataSorter->GetnElem(LINE), + nParallel_Tria = dataSorter->GetnElem(TRIANGLE), + nParallel_Quad = dataSorter->GetnElem(QUADRILATERAL), + nParallel_Tetr = dataSorter->GetnElem(TETRAHEDRON), + nParallel_Hexa = dataSorter->GetnElem(HEXAHEDRON), + nParallel_Pris = dataSorter->GetnElem(PRISM), + nParallel_Pyra = dataSorter->GetnElem(PYRAMID); + + SU2_MPI::Allreduce(&nParallel_Line, &nTot_Line, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Tria, &nTot_Tria, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Quad, &nTot_Quad, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Tetr, &nTot_Tetr, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Hexa, &nTot_Hexa, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Pris, &nTot_Pris, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Pyra, &nTot_Pyra, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + + myElem = (nParallel_Line + nParallel_Tria + nParallel_Quad + nParallel_Tetr + + nParallel_Hexa + nParallel_Pris + nParallel_Pyra); + myElemStorage = (nParallel_Line*3 + nParallel_Tria*4 + nParallel_Quad*5 + nParallel_Tetr*5 + + nParallel_Hexa*9 + nParallel_Pris*7 + nParallel_Pyra*6); + + GlobalElem = (nTot_Line + nTot_Tria + nTot_Quad + nTot_Tetr + + nTot_Hexa + nTot_Pris + nTot_Pyra); + GlobalElemStorage = (nTot_Line*3 + nTot_Tria*4 + nTot_Quad*5 + nTot_Tetr*5 + + nTot_Hexa*9 + nTot_Pris*7 + nTot_Pyra*6); + + + + /*--- Communicate the number of total cells/storage that will be + written by each rank. After this communication, each proc knows how + many cells will be written before its location in the file and the + offsets can be correctly set. ---*/ + + int *nElem_Snd = new int[size+1]; int *nElemStorage_Snd = new int[size+1]; + int *nElem_Cum = new int[size+1]; int *nElemStorage_Cum = new int[size+1]; + + nElem_Snd[0] = 0; nElemStorage_Snd[0] = 0; + nElem_Cum[0] = 0; nElemStorage_Cum[0] = 0; + for (int ii=1; ii < size; ii++) { + nElem_Snd[ii] = myElem; nElemStorage_Snd[ii] = myElemStorage; + nElem_Cum[ii] = 0; nElemStorage_Cum[ii] = 0; + } + nElem_Snd[size] = myElem; nElemStorage_Snd[size] = myElemStorage; + nElem_Cum[size] = 0; nElemStorage_Cum[size] = 0; + + /*--- Communicate the local counts to all ranks for building offsets. ---*/ + + SU2_MPI::Alltoall(&(nElem_Snd[1]), 1, MPI_INT, + &(nElem_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); + + SU2_MPI::Alltoall(&(nElemStorage_Snd[1]), 1, MPI_INT, + &(nElemStorage_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); + + /*--- Put the counters into cumulative storage format. ---*/ + + for (int ii = 0; ii < size; ii++) { + nElem_Cum[ii+1] += nElem_Cum[ii]; + nElemStorage_Cum[ii+1] += nElemStorage_Cum[ii]; + } + + /*--- Reset the file view before writing the next ASCII line for cells. ---*/ + + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, + (char*)"native", MPI_INFO_NULL); + SPRINTF(str_buf, "\nCELLS %i %i\n", SU2_TYPE::Int(GlobalElem), + SU2_TYPE::Int(GlobalElemStorage)); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Load/write 1D buffers for the connectivity of each element type. ---*/ + + int *conn_buf = new int[myElemStorage]; + unsigned long iStorage = 0; + + for (iElem = 0; iElem < nParallel_Line; iElem++) { + conn_buf[iStorage+0] = N_POINTS_LINE; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(LINE, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(LINE, iElem, 1)-1; + iStorage += (N_POINTS_LINE+1); + } + + for (iElem = 0; iElem < nParallel_Tria; iElem++) { + conn_buf[iStorage+0] = N_POINTS_TRIANGLE; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1)-1; + conn_buf[iStorage+3] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)-1 ; + iStorage += (N_POINTS_TRIANGLE+1); + } + + for (iElem = 0; iElem < nParallel_Quad; iElem++) { + conn_buf[iStorage+0] = N_POINTS_QUADRILATERAL; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1)-1; + conn_buf[iStorage+3] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2)-1; + conn_buf[iStorage+4] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3)-1; + iStorage += (N_POINTS_QUADRILATERAL+1); + + } + + for (iElem = 0; iElem < nParallel_Tetr; iElem++) { + conn_buf[iStorage+0] = N_POINTS_TETRAHEDRON; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1)-1; + conn_buf[iStorage+3] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2)-1; + conn_buf[iStorage+4] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3)-1; + iStorage += (N_POINTS_TETRAHEDRON+1); + + } + + for (iElem = 0; iElem < nParallel_Hexa; iElem++) { + conn_buf[iStorage+0] = N_POINTS_HEXAHEDRON; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1)-1; + conn_buf[iStorage+3] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2)-1; + conn_buf[iStorage+4] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3)-1; + conn_buf[iStorage+5] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4)-1; + conn_buf[iStorage+6] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5)-1; + conn_buf[iStorage+7] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6)-1; + conn_buf[iStorage+8] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7)-1; + iStorage += (N_POINTS_HEXAHEDRON+1); + } + + for (iElem = 0; iElem < nParallel_Pris; iElem++) { + conn_buf[iStorage+0] = N_POINTS_PRISM; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(PRISM, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(PRISM, iElem, 1)-1; + conn_buf[iStorage+3] = dataSorter->GetElem_Connectivity(PRISM, iElem, 2)-1; + conn_buf[iStorage+4] = dataSorter->GetElem_Connectivity(PRISM, iElem, 3)-1; + conn_buf[iStorage+5] = dataSorter->GetElem_Connectivity(PRISM, iElem, 4)-1; + conn_buf[iStorage+6] = dataSorter->GetElem_Connectivity(PRISM, iElem, 5)-1; + iStorage += (N_POINTS_PRISM+1); + } + + for (iElem = 0; iElem < nParallel_Pyra; iElem++) { + conn_buf[iStorage+0] = N_POINTS_PYRAMID; + conn_buf[iStorage+1] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0)-1; + conn_buf[iStorage+2] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1)-1; + conn_buf[iStorage+3] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2)-1; + conn_buf[iStorage+4] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3)-1; + conn_buf[iStorage+5] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4)-1; + iStorage += (N_POINTS_PYRAMID+1); + } + + + if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), myElemStorage); + + /*--- We write the connectivity with MPI_INTs. ---*/ + + etype = MPI_INT; + + /*--- Define a derived datatype for this ranks contiguous + chunk of data that will be placed in the file. ---*/ + + MPI_Type_contiguous(myElemStorage, MPI_INT, &filetype); + MPI_Type_commit(&filetype); + + /*--- Compute the offset for this rank's linear partition of the + data in bytes. ---*/ + + disp2 = (disp + nElemStorage_Cum[rank]*sizeof(int)); + + /*--- Set the view for the MPI file write, i.e., describe the + location in the file that this rank "sees" for writing its + piece of the file. ---*/ + + MPI_File_set_view(fhw, disp2, etype, filetype, + (char*)"native", MPI_INFO_NULL); + + /*--- Collective call for all ranks to write simultaneously. ---*/ + + MPI_File_write_all(fhw, conn_buf, myElemStorage, MPI_INT, &status); + + /*--- Update the displacement position for MPI IO. ---*/ + + disp += nElemStorage_Cum[size]*sizeof(int); + + file_size += sizeof(int)*myElemStorage; + + /*--- Free the derived datatype. ---*/ + + MPI_Type_free(&filetype); + delete [] conn_buf; + + /*--- Load/write the cell type for all elements in the file. ---*/ + + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, + (char*)"native", MPI_INFO_NULL); + SPRINTF (str_buf, "\nCELL_TYPES %i\n", SU2_TYPE::Int(GlobalElem)); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + int *type_buf = new int[myElem]; + unsigned long jElem = 0; + + for (iElem = 0; iElem < nParallel_Line; iElem++) { + type_buf[jElem] = LINE; jElem++; + } + for (iElem = 0; iElem < nParallel_Tria; iElem++) { + type_buf[jElem] = TRIANGLE; jElem++; + } + for (iElem = 0; iElem < nParallel_Quad; iElem++) { + type_buf[jElem] = QUADRILATERAL; jElem++; + } + for (iElem = 0; iElem < nParallel_Tetr; iElem++) { + type_buf[jElem] = TETRAHEDRON; jElem++; + } + for (iElem = 0; iElem < nParallel_Hexa; iElem++) { + type_buf[jElem] = HEXAHEDRON; jElem++; + } + for (iElem = 0; iElem < nParallel_Pris; iElem++) { + type_buf[jElem] = PRISM; jElem++; + } + for (iElem = 0; iElem < nParallel_Pyra; iElem++) { + type_buf[jElem] = PYRAMID; jElem++; + } + + if (!BigEndian) SwapBytes((char *)type_buf, sizeof(int), myElem); + + /*--- We write the cell types with MPI_INTs. ---*/ + + etype = MPI_INT; + + /*--- Define a derived datatype for this ranks contiguous + chunk of data that will be placed in the file. ---*/ + + MPI_Type_contiguous(myElem, MPI_INT, &filetype); + MPI_Type_commit(&filetype); + + /*--- Compute the offset for this rank's linear partition of the + data in bytes. ---*/ + + disp2 = (disp + nElem_Cum[rank]*sizeof(int)); + + /*--- Set the view for the MPI file write, i.e., describe the + location in the file that this rank "sees" for writing its + piece of the file. ---*/ + + MPI_File_set_view(fhw, disp2, etype, filetype, + (char*)"native", MPI_INFO_NULL); + + /*--- Collective call for all ranks to write simultaneously. ---*/ + + MPI_File_write_all(fhw, type_buf, myElem, MPI_INT, &status); + + /*--- Update the displacement position for MPI IO. ---*/ + + disp += nElem_Cum[size]*sizeof(int); + + file_size += sizeof(int)*myElem; + + /*--- Free the derived datatype. ---*/ + + MPI_Type_free(&filetype); + if (type_buf != NULL) delete [] type_buf; + + /*--- Now write the scalar and vector point data. ---*/ + + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, + (char*)"native", MPI_INFO_NULL); + SPRINTF (str_buf, "\nPOINT_DATA %i\n", SU2_TYPE::Int(GlobalPoint)); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Adjust container start location to avoid point coords. ---*/ + + unsigned short varStart = 2; + if (nDim == 3) varStart++; + + /*--- Loop over all variables that have been registered in the output. ---*/ + + unsigned short iField, VarCounter = varStart; + for (iField = varStart; iField < fieldnames.size(); iField++) { + + string fieldname = fieldnames[iField]; + fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), + fieldname.end()); + + /*--- Check whether this field is a vector or scalar. ---*/ + + bool output_variable = true, isVector = false; + size_t found = fieldnames[iField].find("_x"); + if (found!=string::npos) { + output_variable = true; + isVector = true; + } + found = fieldnames[iField].find("_y"); + if (found!=string::npos) { + /*--- We have found a vector, so skip the Y component. ---*/ + output_variable = false; + VarCounter++; + } + found = fieldnames[iField].find("_z"); + if (found!=string::npos) { + /*--- We have found a vector, so skip the Z component. ---*/ + output_variable = false; + VarCounter++; + } + + /*--- Write the point data as an vector or a scalar. ---*/ + + if (output_variable && isVector) { + + /*--- Adjust the string name to remove the leading "X-" ---*/ + + fieldname.erase(fieldname.end()-2,fieldname.end()); + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, + (char*)"native", MPI_INFO_NULL); + SPRINTF (str_buf, "\nVECTORS %s float\n", fieldname.c_str()); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Prepare the 1D data buffer on this rank. ---*/ + + float *vec_buf = new float[myPoint*NCOORDS]; + + /*--- Load up the buffer for writing this rank's vector data. ---*/ + + float val = 0.0; + for (iPoint = 0; iPoint < myPoint; iPoint++) { + for (iDim = 0; iDim < NCOORDS; iDim++) { + if (nDim == 2 && iDim == 2) { + vec_buf[iPoint*NCOORDS + iDim] = 0.0; + } else { + val = (float)dataSorter->GetData(VarCounter+iDim,iPoint); + vec_buf[iPoint*NCOORDS + iDim] = val; + } + } + } + if (!BigEndian) + SwapBytes((char *)vec_buf, sizeof(float), myPoint*NCOORDS); + + /*--- We will write the point data as floats. ---*/ + + etype = MPI_FLOAT; + + /*--- Define a derived datatype for this ranks contiguous + chunk of data that will be placed in the file. ---*/ + + MPI_Type_contiguous(myPoint*NCOORDS, MPI_FLOAT, &filetype); + MPI_Type_commit(&filetype); + + /*--- Compute the offset for this rank's linear partition of the + data in bytes. ---*/ + + disp2 = disp + NCOORDS*nPoint_Cum[rank]*sizeof(float); + + /*--- Set the view for the MPI file write, i.e., describe the + location in the file that this rank "sees" for writing its + piece of the file. ---*/ + + MPI_File_set_view(fhw, disp2, etype, filetype, + (char*)"native", MPI_INFO_NULL); + + /*--- Collective call for all ranks to write simultaneously. ---*/ + + MPI_File_write_all(fhw, vec_buf, myPoint*NCOORDS, MPI_FLOAT, &status); + + /*--- Update the displacement position for MPI IO. ---*/ + + disp += NCOORDS*nPoint_Cum[size]*sizeof(float); + + file_size += sizeof(float)*myPoint*NCOORDS; + + /*--- Free the derived datatype and coordinate array. ---*/ + + MPI_Type_free(&filetype); + delete [] vec_buf; vec_buf = NULL; + + VarCounter++; + + } else if (output_variable) { + + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, + (char*)"native", MPI_INFO_NULL); + SPRINTF (str_buf, "\nSCALARS %s float 1\n", fieldname.c_str()); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, + (char*)"native", MPI_INFO_NULL); + SPRINTF (str_buf, "LOOKUP_TABLE default\n"); + if (rank == MASTER_NODE) + MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), + MPI_CHAR, MPI_STATUS_IGNORE); + disp += strlen(str_buf)*sizeof(char); + file_size += sizeof(char)*strlen(str_buf); + + /*--- Prepare the 1D data buffer on this rank. ---*/ + + float *scalar_buf = new float[myPoint]; + + /*--- For now, create a temp 1D buffer to load up the data for writing. + This will be replaced with a derived data type most likely. ---*/ + + for (iPoint = 0; iPoint < myPoint; iPoint++) { + float val = (float)dataSorter->GetData(VarCounter,iPoint); + scalar_buf[iPoint] = val; + } + if (!BigEndian) SwapBytes((char *)scalar_buf, sizeof(float), myPoint); + + /*--- We will write the point data as floats. ---*/ + + etype = MPI_FLOAT; + + /*--- Define a derived datatype for this ranks contiguous + chunk of data that will be placed in the file. ---*/ + + MPI_Type_contiguous(myPoint, MPI_FLOAT, &filetype); + MPI_Type_commit(&filetype); + + /*--- Compute the offset for this rank's linear partition of the + data in bytes. ---*/ + + disp2 = disp + nPoint_Cum[rank]*sizeof(float); + + /*--- Set the view for the MPI file write, i.e., describe the + location in the file that this rank "sees" for writing its + piece of the file. ---*/ + + MPI_File_set_view(fhw, disp2, etype, filetype, + (char*)"native", MPI_INFO_NULL); + + /*--- Collective call for all ranks to write simultaneously. ---*/ + + MPI_File_write_all(fhw, scalar_buf, myPoint, MPI_FLOAT, &status); + + /*--- Update the displacement position for MPI IO. ---*/ + + disp += nPoint_Cum[size]*sizeof(float); + + file_size += sizeof(float)*myPoint; + + /*--- Free the derived datatype and coordinate array. ---*/ + + MPI_Type_free(&filetype); + delete [] scalar_buf; scalar_buf = NULL; + + VarCounter++; + } + + } + + /*--- All ranks close the file after writing. ---*/ + + MPI_File_close(&fhw); + + + /*--- Compute and store the write time. ---*/ + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime-StartTime; + + /*--- Communicate the total file size for the restart ---*/ + +#ifdef HAVE_MPI + su2double my_file_size = file_size; + SU2_MPI::Allreduce(&my_file_size, &file_size, 1, + MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); +#endif + + /*--- Compute and store the bandwidth ---*/ + + Bandwidth = file_size/(1.0e6)/UsedTime; + + /*--- Delete the offset counters that we needed for MPI IO. ---*/ + + delete [] nElem_Snd; delete [] nElem_Cum; + delete [] nElemStorage_Snd; delete [] nElemStorage_Cum; + delete [] nPoint_Snd; delete [] nPoint_Cum; + +#endif +} + + +/*--- Subroutine to swap bytes, in case we need to convert to + big endian, which is expected for ParaView binary legacy format. ---*/ + +void CParaviewBinaryFileWriter::SwapBytes(char *buffer, size_t nBytes, unsigned long nVar) { + + /*--- Store half the number of bytes in kk. ---*/ + + const int kk = (int)nBytes/2; + + /*--- Loop over the number of variables in the buffer. ---*/ + + for (int j = 0; j < (int)nVar; j++) { + + /*--- Initialize ii and jj, which are used to store the + indices of the bytes to be swapped. ---*/ + + int ii = j*(int)nBytes; + int jj = ii + (int)nBytes - 1; + + /*--- Swap the bytes. ---*/ + + for (int i = 0; i < kk; i++) { + char tmp = buffer[jj]; + buffer[jj] = buffer[ii]; + buffer[ii] = tmp; + + ii++; + jj--; + + } + } +} diff --git a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp new file mode 100644 index 000000000000..84782c8b9714 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp @@ -0,0 +1,365 @@ +#include "../../../include/output/filewriter/CParaviewFileWriter.hpp" + +const string CParaviewFileWriter::fileExt = ".vtk"; + +CParaviewFileWriter::CParaviewFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim){} + + +CParaviewFileWriter::~CParaviewFileWriter(){} + +void CParaviewFileWriter::Write_Data(){ + + if (!dataSorter->GetConnectivitySorted()){ + SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); + } + + unsigned short iDim; + + unsigned long iPoint, iElem; + + unsigned long nGlobal_Elem_Storage; + + ofstream Paraview_File; + + int iProcessor; + + /*--- Set a timer for the file writing. ---*/ + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + + /*--- Open Paraview ASCII file and write the header. ---*/ + + if (rank == MASTER_NODE) { + Paraview_File.open(fileName.c_str(), ios::out); + Paraview_File.precision(6); + Paraview_File << "# vtk DataFile Version 3.0\n"; + Paraview_File << "vtk output\n"; + Paraview_File << "ASCII\n"; + Paraview_File << "DATASET UNSTRUCTURED_GRID\n"; + + /*--- Write the header ---*/ + Paraview_File << "POINTS "<< dataSorter->GetnPointsGlobal() <<" double\n"; + + } + + Paraview_File.close(); + +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + /*--- Each processor opens the file. ---*/ + + Paraview_File.open(fileName.c_str(), ios::out | ios::app); + + /*--- Write surface and volumetric point coordinates. ---*/ + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + + /*--- Write the node data from this proc ---*/ + + + for (iPoint = 0; iPoint < dataSorter->GetnPoints(); iPoint++) { + for (iDim = 0; iDim < nDim; iDim++) + Paraview_File << scientific << dataSorter->GetData(iDim, iPoint) << "\t"; + if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; + } + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + /*--- Reduce the total number of each element. ---*/ + + unsigned long nTot_Line, nTot_Tria, nTot_Quad, nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; + unsigned long nParallel_Line = dataSorter->GetnElem(LINE), + nParallel_Tria = dataSorter->GetnElem(TRIANGLE), + nParallel_Quad = dataSorter->GetnElem(QUADRILATERAL), + nParallel_Tetr = dataSorter->GetnElem(TETRAHEDRON), + nParallel_Hexa = dataSorter->GetnElem(HEXAHEDRON), + nParallel_Pris = dataSorter->GetnElem(PRISM), + nParallel_Pyra = dataSorter->GetnElem(PYRAMID); +#ifdef HAVE_MPI + SU2_MPI::Reduce(&nParallel_Line, &nTot_Line, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nParallel_Tria, &nTot_Tria, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nParallel_Quad, &nTot_Quad, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nParallel_Tetr, &nTot_Tetr, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nParallel_Hexa, &nTot_Hexa, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nParallel_Pris, &nTot_Pris, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Reduce(&nParallel_Pyra, &nTot_Pyra, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); +#else + nTot_Line = nParallel_Line; + + nTot_Tria = nParallel_Tria; + nTot_Quad = nParallel_Quad; + nTot_Tetr = nParallel_Tetr; + nTot_Hexa = nParallel_Hexa; + nTot_Pris = nParallel_Pris; + nTot_Pyra = nParallel_Pyra; +#endif + + if (rank == MASTER_NODE) { + + /*--- Write the header ---*/ + nGlobal_Elem_Storage = nTot_Line*3 + nTot_Tria*4 + nTot_Quad*5 + nTot_Tetr*5 + nTot_Hexa*9 + nTot_Pris*7 + nTot_Pyra*6; + + Paraview_File << "\nCELLS " << dataSorter->GetnElem() << "\t" << nGlobal_Elem_Storage << "\n"; + + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + /*--- Write connectivity data. ---*/ + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + + + for (iElem = 0; iElem < nParallel_Line; iElem++) { + Paraview_File << N_POINTS_LINE << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(LINE, iElem, 0)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(LINE, iElem, 1)-1 << "\t"; + } + + for (iElem = 0; iElem < nParallel_Tria; iElem++) { + Paraview_File << N_POINTS_TRIANGLE << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)-1 << "\t"; + } + + for (iElem = 0; iElem < nParallel_Quad; iElem++) { + Paraview_File << N_POINTS_QUADRILATERAL << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3)-1 << "\t"; + } + + + for (iElem = 0; iElem < nParallel_Tetr; iElem++) { + Paraview_File << N_POINTS_TETRAHEDRON << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0)-1 << "\t" + << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2)-1 << "\t" + << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3)-1 << "\t"; + } + + for (iElem = 0; iElem < nParallel_Hexa; iElem++) { + Paraview_File << N_POINTS_HEXAHEDRON << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0)-1 << "\t" + << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2)-1 << "\t" + << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4)-1 << "\t" + << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6)-1 << "\t" + << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7)-1 << "\t"; + } + + for (iElem = 0; iElem < nParallel_Pris; iElem++) { + Paraview_File << N_POINTS_PRISM << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 0)-1 << "\t" + << dataSorter->GetElem_Connectivity(PRISM, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 2)-1 << "\t" + << dataSorter->GetElem_Connectivity(PRISM, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 4)-1 << "\t" + << dataSorter->GetElem_Connectivity(PRISM, iElem, 5)-1 << "\t"; + } + + for (iElem = 0; iElem < nParallel_Pyra; iElem++) { + Paraview_File << N_POINTS_PYRAMID << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0)-1 << "\t" + << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2)-1 << "\t" + << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4)-1 << "\t"; + } + + } Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + if (rank == MASTER_NODE) { + + /*--- Write the header ---*/ + Paraview_File << "\nCELL_TYPES " << dataSorter->GetnElem() << "\n"; + + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + for (iElem = 0; iElem < nParallel_Line; iElem++) Paraview_File << "3\t"; + for (iElem = 0; iElem < nParallel_Tria; iElem++) Paraview_File << "5\t"; + for (iElem = 0; iElem < nParallel_Quad; iElem++) Paraview_File << "9\t"; + for (iElem = 0; iElem < nParallel_Tetr; iElem++) Paraview_File << "10\t"; + for (iElem = 0; iElem < nParallel_Hexa; iElem++) Paraview_File << "12\t"; + for (iElem = 0; iElem < nParallel_Pris; iElem++) Paraview_File << "13\t"; + for (iElem = 0; iElem < nParallel_Pyra; iElem++) Paraview_File << "14\t"; + } + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + if (rank == MASTER_NODE) { + /*--- Write the header ---*/ + Paraview_File << "\nPOINT_DATA "<< dataSorter->GetnPointsGlobal() <<"\n"; + + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + unsigned short varStart = 2; + if (nDim == 3) varStart++; + + /*--- Need to adjust container location to avoid PointID tag and coords. ---*/ + unsigned short VarCounter = varStart; + + for (unsigned short iField = varStart; iField < fieldnames.size(); iField++) { + + string fieldname = fieldnames[iField]; + + fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), fieldname.end()); + + bool output_variable = true, isVector = false; + size_t found = fieldnames[iField].find("_x"); + if (found!=string::npos) { + output_variable = true; + isVector = true; + } + found = fieldnames[iField].find("_y"); + if (found!=string::npos) { + output_variable = false; + //skip + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + VarCounter++; + } +found = fieldnames[iField].find("_z"); + if (found!=string::npos) { + output_variable = false; + //skip + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + VarCounter++; + } + + if (output_variable && isVector) { + + fieldname.erase(fieldname.end()-2,fieldname.end()); + + if (rank == MASTER_NODE) { + Paraview_File << "\nVECTORS " << fieldname << " double\n"; + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + /*--- Write surface and volumetric point coordinates. ---*/ + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + + /*--- Write the node data from this proc ---*/ + + for (iPoint = 0; iPoint < dataSorter->GetnPoints(); iPoint++) { + Paraview_File << scientific << dataSorter->GetData(VarCounter+0, iPoint) << "\t" << dataSorter->GetData(VarCounter+1, iPoint) << "\t"; + if (nDim == 3) Paraview_File << scientific << dataSorter->GetData(VarCounter+2, iPoint) << "\t"; + if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; + } + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + VarCounter++; + + } else if (output_variable) { + + if (rank == MASTER_NODE) { + + Paraview_File << "\nSCALARS " << fieldname << " double 1\n"; + Paraview_File << "LOOKUP_TABLE default\n"; + } + + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + /*--- Write surface and volumetric point coordinates. ---*/ + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + + /*--- Write the node data from this proc ---*/ + + for (iPoint = 0; iPoint < dataSorter->GetnPoints(); iPoint++) { + Paraview_File << scientific << dataSorter->GetData(VarCounter, iPoint) << "\t"; + } + + } + Paraview_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + VarCounter++; + } + + } + + Paraview_File.close(); + + + /*--- Compute and store the write time. ---*/ + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime-StartTime; + + file_size = Determine_Filesize(fileName); + + /*--- Compute and store the bandwidth ---*/ + + Bandwidth = file_size/(1.0e6)/UsedTime; +} + diff --git a/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp new file mode 100644 index 000000000000..5d528e5cd4aa --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp @@ -0,0 +1,197 @@ +#include "../../../include/output/filewriter/CSU2BinaryFileWriter.hpp" + +const string CSU2BinaryFileWriter::fileExt = ".dat"; + +CSU2BinaryFileWriter::CSU2BinaryFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim){} + + +CSU2BinaryFileWriter::~CSU2BinaryFileWriter(){ + +} + +void CSU2BinaryFileWriter::Write_Data(){ + + /*--- Local variables ---*/ + + unsigned short iVar; + + unsigned short GlobalField_Counter = fieldnames.size(); + unsigned long nParallel_Poin = dataSorter->GetnPoints(); + + ofstream restart_file; + char str_buf[CGNS_STRING_SIZE], fname[100]; + + file_size = 0.0; + + strcpy(fname, fileName.c_str()); + + /*--- Prepare the first ints containing the counts. The first is a + magic number that we can use to check for binary files (it is the hex + representation for "SU2"). The second two values are number of variables + and number of points (DoFs). The last two values are for metadata: + one int for ExtIter and 8 su2doubles. ---*/ + + int var_buf_size = 5; + int var_buf[5] = {535532, GlobalField_Counter, (int)dataSorter->GetnPointsGlobal(), 0, 0}; + + /*--- Set a timer for the binary file writing. ---*/ + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + +#ifndef HAVE_MPI + + FILE* fhw; + fhw = fopen(fname, "wb"); + + /*--- Error check for opening the file. ---*/ + + if (!fhw) { + SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + } + + /*--- First, write the number of variables and points. ---*/ + + fwrite(var_buf, var_buf_size, sizeof(int), fhw); + file_size += (su2double)var_buf_size*sizeof(int); + + /*--- Write the variable names to the file. Note that we are adopting a + fixed length of 33 for the string length to match with CGNS. This is + needed for when we read the strings later. ---*/ + + for (iVar = 0; iVar < GlobalField_Counter; iVar++) { + strncpy(str_buf, fieldnames[iVar].c_str(), CGNS_STRING_SIZE); + fwrite(str_buf, CGNS_STRING_SIZE, sizeof(char), fhw); + file_size += (su2double)CGNS_STRING_SIZE*sizeof(char); + } + + /*--- Call to write the entire restart file data in binary in one shot. ---*/ + + fwrite(dataSorter->GetData(), nParallel_Poin*GlobalField_Counter, sizeof(passivedouble), fhw); + file_size += (su2double)nParallel_Poin*GlobalField_Counter*sizeof(passivedouble); + + /*--- Close the file. ---*/ + + fclose(fhw); + +#else + + /*--- Parallel binary output using MPI I/O. ---*/ + + MPI_File fhw; + SU2_MPI::Status status; + MPI_Datatype etype, filetype; + MPI_Offset disp; + int ierr; + + /*--- We're writing only su2doubles in the data portion of the file. ---*/ + + etype = MPI_DOUBLE; + + /*--- Define a derived datatype for this ranks contiguous chunk of data + that will be placed in the restart (1D array size = num points * num vars). ---*/ + + MPI_Type_contiguous(nParallel_Poin*GlobalField_Counter, MPI_DOUBLE, &filetype); + MPI_Type_commit(&filetype); + + /*--- All ranks open the file using MPI. Here, we try to open the file with + exclusive so that an error is generated if the file exists. We always want + to write a fresh restart file, so we delete any existing files and create + a new one. ---*/ + + ierr = MPI_File_open(MPI_COMM_WORLD, fname, + MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, + MPI_INFO_NULL, &fhw); + if (ierr != MPI_SUCCESS) { + MPI_File_close(&fhw); + if (rank == 0) + MPI_File_delete(fname, MPI_INFO_NULL); + ierr = MPI_File_open(MPI_COMM_WORLD, fname, + MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, + MPI_INFO_NULL, &fhw); + } + + /*--- Error check opening the file. ---*/ + + if (ierr) { + SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + } + + /*--- First, write the number of variables and points (i.e., cols and rows), + which we will need in order to read the file later. Also, write the + variable string names here. Only the master rank writes the header. ---*/ + + if (rank == MASTER_NODE) { + MPI_File_write(fhw, var_buf, var_buf_size, MPI_INT, MPI_STATUS_IGNORE); + file_size += (su2double)var_buf_size*sizeof(int); + + /*--- Write the variable names to the file. Note that we are adopting a + fixed length of 33 for the string length to match with CGNS. This is + needed for when we read the strings later. ---*/ + + for (iVar = 0; iVar < GlobalField_Counter; iVar++) { + disp = var_buf_size*sizeof(int) + iVar*CGNS_STRING_SIZE*sizeof(char); + strncpy(str_buf, fieldnames[iVar].c_str(), CGNS_STRING_SIZE); + MPI_File_write_at(fhw, disp, str_buf, CGNS_STRING_SIZE, MPI_CHAR, MPI_STATUS_IGNORE); + file_size += (su2double)CGNS_STRING_SIZE*sizeof(char); + } + } + + /*--- Compute the offset for this rank's linear partition of the data in bytes. + After the calculations above, we have the partition sizes store in nPoint_Linear + in cumulative storage format. ---*/ + + disp = (var_buf_size*sizeof(int) + GlobalField_Counter*CGNS_STRING_SIZE*sizeof(char) + + GlobalField_Counter*dataSorter->GetnPointCumulative(rank)*sizeof(passivedouble)); + + /*--- Set the view for the MPI file write, i.e., describe the location in + the file that this rank "sees" for writing its piece of the restart file. ---*/ + + MPI_File_set_view(fhw, disp, etype, filetype, (char*)"native", MPI_INFO_NULL); + + /*--- Collective call for all ranks to write to their view simultaneously. ---*/ + + MPI_File_write_all(fhw, dataSorter->GetData(), GlobalField_Counter*nParallel_Poin, MPI_DOUBLE, &status); + file_size += (su2double)GlobalField_Counter*nParallel_Poin*sizeof(passivedouble); + + /*--- Free the derived datatype. ---*/ + + MPI_Type_free(&filetype); + + /*--- Reset the file view before writing the metadata. ---*/ + + MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, (char*)"native", MPI_INFO_NULL); + + /*--- All ranks close the file after writing. ---*/ + + MPI_File_close(&fhw); + +#endif + + /*--- Compute and store the write time. ---*/ + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime-StartTime; + + /*--- Communicate the total file size for the restart ---*/ + +#ifdef HAVE_MPI + su2double my_file_size = file_size; + SU2_MPI::Allreduce(&my_file_size, &file_size, 1, + MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); +#endif + + /*--- Compute and store the bandwidth ---*/ + + Bandwidth = file_size/(1.0e6)/UsedTime; + +} diff --git a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp new file mode 100644 index 000000000000..f05f3c50ee73 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp @@ -0,0 +1,107 @@ +#include "../../../include/output/filewriter/CSU2FileWriter.hpp" + +const string CSU2FileWriter::fileExt = ".csv"; + +CSU2FileWriter::CSU2FileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim){} + + +CSU2FileWriter::~CSU2FileWriter(){ + +} + +void CSU2FileWriter::Write_Data(){ + + /*--- Local variables ---*/ + + unsigned short iVar; + unsigned long iPoint; + + ofstream restart_file; + + int iProcessor; + + /*--- Set a timer for the file writing. ---*/ + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + + /*--- Only the master node writes the header. ---*/ + + if (rank == MASTER_NODE) { + restart_file.open(fileName.c_str(), ios::out); + restart_file.precision(15); + restart_file << "\"PointID\""; + for (iVar = 0; iVar < fieldnames.size()-1; iVar++) + restart_file << ",\"" << fieldnames[iVar] << "\""; + restart_file << ",\"" << fieldnames[fieldnames.size()-1] << "\"" << endl; + restart_file.close(); + } + +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + /*--- All processors open the file. ---*/ + + restart_file.open(fileName.c_str(), ios::out | ios::app); + restart_file.precision(15); + + /*--- Write the restart file in parallel, processor by processor. ---*/ + + unsigned long myPoint = 0, Global_Index; + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + for (iPoint = 0; iPoint < dataSorter->GetnPoints(); iPoint++) { + + /*--- Global Index of the current point. (note outer loop over procs) ---*/ + + Global_Index = dataSorter->GetGlobalIndex(iPoint); + + /*--- Write global index. (note outer loop over procs) ---*/ + + restart_file << Global_Index << ", "; + myPoint++; + + /*--- Loop over the variables and write the values to file ---*/ + + for (iVar = 0; iVar < fieldnames.size()-1; iVar++) { + restart_file << scientific << dataSorter->GetData(iVar, iPoint) << ", "; + } + restart_file << scientific << dataSorter->GetData(fieldnames.size()-1, iPoint) << "\n"; + } + + } + /*--- Flush the file and wait for all processors to arrive. ---*/ + restart_file.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + } + + /*--- Compute and store the write time. ---*/ + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime-StartTime; + + /*--- Determine the file size ---*/ + + file_size = Determine_Filesize(fileName); + + /*--- Compute and store the bandwidth ---*/ + + Bandwidth = file_size/(1.0e6)/UsedTime; + + /*--- All processors close the file. ---*/ + + restart_file.close(); +} diff --git a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp new file mode 100644 index 000000000000..fcdd823d590a --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp @@ -0,0 +1,268 @@ +#include "../../../include/output/filewriter/CSU2MeshFileWriter.hpp" +#include "../../../../Common/include/toolboxes/printing_toolbox.hpp" + +const string CSU2MeshFileWriter::fileExt = ".su2"; + +CSU2MeshFileWriter::CSU2MeshFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter, + unsigned short iZone, unsigned short nZone) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim), iZone(iZone), nZone(nZone) {} + + +CSU2MeshFileWriter::~CSU2MeshFileWriter(){ + +} + + +void CSU2MeshFileWriter::Write_Data(){ + + unsigned long iElem, iPoint, iElem_Bound, nElem_Bound_, vnodes_edge[2], vnodes_triangle[3], vnodes_quad[4], offset, nElem; + unsigned short iMarker, iDim, iChar, VTK_Type, nMarker_; + short SendTo; + ifstream input_file; + string text_line, Marker_Tag, str; + string::size_type position; + int iProcessor; + + ofstream output_file; + char cstr[MAX_STRING_SIZE], out_file[MAX_STRING_SIZE]; + + strcpy (out_file, fileName.c_str()); + strcpy (cstr, out_file); + + if (rank == MASTER_NODE){ + + + output_file.open(cstr, ios::out); + + if (nZone > 1){ + output_file << "IZONE= " << iZone+1 << endl; + } + + /*--- Write dimensions data. ---*/ + + output_file << "NDIME= " << nDim << endl; + + output_file << "NELEM= " << dataSorter->GetnElem() << endl; + + output_file.close(); + } + + output_file.open(cstr, ios::out | ios::app); + output_file.precision(15); + nElem = 0; + offset = 0; + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + for (iElem = 0; iElem < dataSorter->GetnElem(TRIANGLE); iElem++) { + output_file << "5\t"; + output_file << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2) - 1 << "\t"; + output_file << nElem + offset << "\n"; nElem++; + } + for (iElem = 0; iElem < dataSorter->GetnElem(QUADRILATERAL); iElem++) { + output_file << "9\t"; + output_file << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3) - 1 << "\t"; + output_file << nElem + offset << "\n"; nElem++; + } + for (iElem = 0; iElem < dataSorter->GetnElem(TETRAHEDRON); iElem++) { + output_file << "10\t"; + output_file << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) - 1 << "\t"; + output_file << nElem + offset << "\n"; nElem++; + } + for (iElem = 0; iElem < dataSorter->GetnElem(HEXAHEDRON); iElem++) { + output_file << "12\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7) - 1 << "\t"; + output_file << nElem + offset << "\n"; nElem++; + } + for (iElem = 0; iElem < dataSorter->GetnElem(PRISM); iElem++) { + output_file << "13\t"; + output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, 0) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, 1) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, 2) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, 3) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, 4) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, 5) - 1 << "\t"; + output_file << nElem + offset << "\n"; nElem++; + } + + for (iElem = 0; iElem < dataSorter->GetnElem(PYRAMID); iElem++) { + output_file << "14\t"; + output_file << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3) - 1 << "\t"; + output_file << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) - 1 << "\t"; + output_file << nElem + offset << "\n"; nElem++; + } + } + output_file.flush(); +#ifdef HAVE_MPI + SU2_MPI::Allreduce(&nElem, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + + /*--- Write the node coordinates ---*/ + if (rank == MASTER_NODE){ + output_file << "NPOIN= " << dataSorter->GetnPointsGlobal(); + output_file << endl; + output_file.flush(); + } + + + unsigned long Global_Index, myPoint = 0; + offset = 0; + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + for (iPoint = 0; iPoint < dataSorter->GetnPoints(); iPoint++) { + + /*--- Global Index of the current point. (note outer loop over procs) ---*/ + + Global_Index = iPoint + offset; + + /*--- Only write original domain points, i.e., exclude any periodic + or halo nodes, even if they are output in the viz. files. ---*/ + + /*--- Loop over the variables and write the values to file ---*/ + + for (iDim = 0; iDim < nDim; iDim++) { + output_file << scientific << dataSorter->GetData(iDim, iPoint) << "\t"; + } + + /*--- Write global index. (note outer loop over procs) ---*/ + + output_file << Global_Index << "\t"; + myPoint++; + + output_file << "\n"; + + } + } + /*--- Flush the file and wait for all processors to arrive. ---*/ + output_file.flush(); +#ifdef HAVE_MPI + SU2_MPI::Allreduce(&myPoint, &offset, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + output_file.close(); + + if (rank == MASTER_NODE){ + + output_file.open(cstr, ios::out | ios::app); + + /*--- Read the boundary information ---*/ + + if (nZone == 1){ + str = "boundary"; + } else { + str = "boundary_" + PrintingToolbox::to_string(iZone); + } + + str += ".dat"; + + input_file.open(str.c_str(), ios::out); + + if (!input_file.is_open()){ + SU2_MPI::Error(string("Cannot find ") + str, CURRENT_FUNCTION); + } + + /*--- Read grid file with format SU2 ---*/ + + while (getline (input_file, text_line)) { + + /*--- Write the physical boundaries ---*/ + + position = text_line.find ("NMARK=",0); + if (position != string::npos) { + + text_line.erase (0,6); nMarker_ = atoi(text_line.c_str()); + output_file << "NMARK= " << nMarker_ << endl; + + for (iMarker = 0 ; iMarker < nMarker_; iMarker++) { + + getline (input_file, text_line); + text_line.erase (0,11); + string::size_type position; + for (iChar = 0; iChar < 20; iChar++) { + position = text_line.find( " ", 0 ); + if (position != string::npos) text_line.erase (position,1); + position = text_line.find( "\r", 0 ); + if (position != string::npos) text_line.erase (position,1); + position = text_line.find( "\n", 0 ); + if (position != string::npos) text_line.erase (position,1); + } + Marker_Tag = text_line.c_str(); + + /*--- Standart physical boundary ---*/ + + getline (input_file, text_line); + + text_line.erase (0,13); nElem_Bound_ = atoi(text_line.c_str()); + output_file << "MARKER_TAG= " << Marker_Tag << endl; + output_file << "MARKER_ELEMS= " << nElem_Bound_<< endl; + getline (input_file, text_line); + + text_line.erase (0,8); SendTo = atoi(text_line.c_str()); + + if (Marker_Tag == "SEND_RECEIVE"){ + output_file << "SEND_TO= " << SendTo << endl; + } + for (iElem_Bound = 0; iElem_Bound < nElem_Bound_; iElem_Bound++) { + + getline(input_file, text_line); + istringstream bound_line(text_line); + + bound_line >> VTK_Type; + output_file << VTK_Type; + + switch(VTK_Type) { + case LINE: + bound_line >> vnodes_edge[0]; bound_line >> vnodes_edge[1]; + output_file << "\t" << vnodes_edge[0] << "\t" << vnodes_edge[1] << endl; + break; + case TRIANGLE: + bound_line >> vnodes_triangle[0]; bound_line >> vnodes_triangle[1]; bound_line >> vnodes_triangle[2]; + output_file << "\t" << vnodes_triangle[0] << "\t" << vnodes_triangle[1] << "\t" << vnodes_triangle[2] << endl; + break; + case QUADRILATERAL: + bound_line >> vnodes_quad[0]; bound_line >> vnodes_quad[1]; bound_line >> vnodes_quad[2]; bound_line >> vnodes_quad[3]; + output_file << "\t" << vnodes_quad[0] << "\t" << vnodes_quad[1] << "\t" << vnodes_quad[2] << "\t" << vnodes_quad[3] << endl; + break; + case VERTEX: + bound_line >> vnodes_edge[0]; bound_line >> vnodes_edge[1]; + output_file << "\t" << vnodes_edge[0] << "\t" << vnodes_edge[1] <volume_sorter = volume_sorter; + + connectivity_sorted = false; + + /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary + geometrical information for the FEM DG solver. ---*/ + + CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + + unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); + CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); + + /*--- Update the solution by looping over the owned volume elements. ---*/ + + for(unsigned long l=0; l::iterator lastEntry; + lastEntry = unique(globalSurfaceDOFIDs.begin(), globalSurfaceDOFIDs.end()); + globalSurfaceDOFIDs.erase(lastEntry, globalSurfaceDOFIDs.end()); + + /*-------------------------------------------------------------------*/ + /*--- Step 2: Communicate the information of globalSurfaceDOFIDs ---*/ + /*--- to the ranks, which actually store this information ---*/ + /*--- in Parallel_Data. ---*/ + /*-------------------------------------------------------------------*/ + + /* Allocate the memory for the first index of the communication buffers. */ + vector > sendBuf(size, vector(0)); + + /* Loop over the entries of globalSurfaceDOFIDs and fill the + communication buffers accordingly. */ + for(unsigned long i=0; iGetRankContainingIndex(globalSurfaceDOFIDs[i]); + + /* Store the global ID in the send buffer for iProcessor. */ + sendBuf[iProcessor].push_back(globalSurfaceDOFIDs[i]); + } + + /* Determine the number of DOFs to be sent to each processor. */ + int nRankSend = 0; + vector nDOFSend(size); + for(int i=0; i nDOFRecv(size); + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(nDOFSend.data(), 1, MPI_UNSIGNED_LONG, + nDOFRecv.data(), 1, MPI_UNSIGNED_LONG, MPI_COMM_WORLD); +#else + nDOFRecv[rank] = nDOFSend[rank]; +#endif + + /* Determine the number of messages this rank will receive. */ + int nRankRecv = 0; + for(int i=0; i > recvBuf(size, vector(0)); + +#ifdef HAVE_MPI + /* Launch the non-blocking sends. Do not send anything to myself. */ + vector sendReq(nRankSend); + nRankSend = 0; + for(int i=0; i recvReq(nRankRecv); + nRankRecv = 0; + for(int i=0; iGetCumulativeSizeBeforeRank(rank); + + for(int jj=0; jjGetData(jj,ii); + } + + /*--- Reduce the total number of surf points we have. This will be + needed for writing the surface solution files later. ---*/ +#ifdef HAVE_MPI + SU2_MPI::Allreduce(&nParallel_Poin, &nGlobal_Poin_Par, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#else + nGlobal_Poin_Par = nParallel_Poin; +#endif + + /*-------------------------------------------------------------------*/ + /*--- Step 3: Modify the surface connectivities, such that only ---*/ + /*--- the data of surface DOFs needs to be written. ---*/ + /*-------------------------------------------------------------------*/ + + /* Determine the offset for my surface DOFs. */ + unsigned long offsetSurfaceDOFs = 0; +#ifdef HAVE_MPI + vector nSurfaceDOFsRanks(size); + + SU2_MPI::Allgather(&nParallel_Poin, 1, MPI_UNSIGNED_LONG, + nSurfaceDOFsRanks.data(), 1, MPI_UNSIGNED_LONG, + MPI_COMM_WORLD); + + for(int i=0; i mapGlobalVol2Surf; + for(unsigned long i=0; isecond; + } + + /* Copy the original send buffers, because that information is + still needed. */ + vector > originalSendBuf = sendBuf; + +#ifdef HAVE_MPI + /* Launch the non-blocking sends for the reverse communication, where the + receive buffers must be used for sending. Do not send anything to myself. */ + nRankRecv = 0; + for(int i=0; isecond; + + for(unsigned long i=0; i<(nParallel_Tria*N_POINTS_TRIANGLE); ++i) + Conn_Tria_Par[i] = mapGlobalVol2Surf.find(Conn_Tria_Par[i])->second; + + for(unsigned long i=0; i<(nParallel_Quad*N_POINTS_QUADRILATERAL); ++i) + Conn_Quad_Par[i] = mapGlobalVol2Surf.find(Conn_Quad_Par[i])->second; +} + +void CSurfaceFEMDataSorter::SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) { + + SortSurfaceConnectivity(config, geometry, LINE ); + SortSurfaceConnectivity(config, geometry, TRIANGLE ); + SortSurfaceConnectivity(config, geometry, QUADRILATERAL); + + + unsigned long nTotal_Surf_Elem = nParallel_Line + nParallel_Tria + nParallel_Quad; +#ifndef HAVE_MPI + nGlobal_Elem_Par = nTotal_Surf_Elem; +#else + SU2_MPI::Allreduce(&nTotal_Surf_Elem, &nGlobal_Elem_Par, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#endif + + connectivity_sorted = true; + +} + + + +void CSurfaceFEMDataSorter::SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { + + /* Determine the number of nodes for this element type. */ + unsigned short NODES_PER_ELEMENT = 0; + switch (Elem_Type) { + case LINE: + NODES_PER_ELEMENT = N_POINTS_LINE; + break; + case TRIANGLE: + NODES_PER_ELEMENT = N_POINTS_TRIANGLE; + break; + case QUADRILATERAL: + NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; + break; + default: + SU2_MPI::Error("Unrecognized element type", CURRENT_FUNCTION); + } + + /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary + geometrical information for the FEM DG solver. ---*/ + CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + + unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); + CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); + + const CBoundaryFEM *boundaries = DGGeometry->GetBoundaries(); + const CFEMStandardBoundaryFace *standardBoundaryFacesSol = DGGeometry->GetStandardBoundaryFacesSol(); + + /*--- Create the map from the global DOF ID to the local index. + Note one is added to the index value, because visualization + softwares typically use 1-based indexing. ---*/ + vector globalID; + for(unsigned long l=0; lGetnMarker_All(); ++iMarker) { + if( !boundaries[iMarker].periodicBoundary ) { + if (config->GetMarker_All_Plotting(iMarker) == YES) { + const vector &surfElem = boundaries[iMarker].surfElem; + for(unsigned long i=0; i 0) Conn_SubElem = new int[nSubElem_Local*NODES_PER_ELEMENT](); + + /*--- Repeat the loop over the surface elements of the boundary markers + that must be plotted, but now store the connectivity. ---*/ + unsigned long kNode = 0; + for(unsigned short iMarker=0; iMarker < config->GetnMarker_All(); ++iMarker) { + if( !boundaries[iMarker].periodicBoundary ) { + if (config->GetMarker_All_Plotting(iMarker) == YES) { + const vector &surfElem = boundaries[iMarker].surfElem; + + /* Loop over the surface elements of this boundary marker. */ + for(unsigned long i=0; ivolume_sorter = volume_sorter; + + connectivity_sorted = false; + + nGlobalPoint_Sort = geometry->GetGlobal_nPointDomain(); + nLocalPoint_Sort = geometry->GetnPointDomain(); + + /*--- Create the linear partitioner --- */ + + linearPartitioner = new CLinearPartitioner(nGlobalPoint_Sort, 0); + +} + +CSurfaceFVMDataSorter::~CSurfaceFVMDataSorter(){ + + if (linearPartitioner != NULL) delete linearPartitioner; + delete [] passiveDoubleBuffer; + +} + +void CSurfaceFVMDataSorter::SortOutputData() { + + unsigned long iProcessor; + unsigned long iPoint, iElem; + unsigned long Global_Index; + + int VARS_PER_POINT = GlobalField_Counter; + int *Local_Halo = NULL; + int iNode, count; + +#ifdef HAVE_MPI + SU2_MPI::Request *send_req, *recv_req; + SU2_MPI::Status status; + int ind; +#endif + + + /*--- Prepare to check and communicate the nodes that each proc has + locally from the surface connectivity. ---*/ + + int *nElem_Send = new int[size+1](); nElem_Send[0] = 0; + int *nElem_Recv = new int[size+1](); nElem_Recv[0] = 0; + int *nElem_Flag = new int[size](); + + for (int ii=0; ii < size; ii++) { + nElem_Send[ii] = 0; + nElem_Recv[ii] = 0; + nElem_Flag[ii]= -1; + } + nElem_Send[size] = 0; nElem_Recv[size] = 0; + + /*--- Loop through our local line elements and check where each + of the grid nodes resides based on global index. ---*/ + + for (int ii = 0; ii < (int)nParallel_Line; ii++) { + for ( int jj = 0; jj < N_POINTS_LINE; jj++ ) { + + /*--- Get global index. Note the -1 since it was 1-based for viz. ---*/ + + iNode = ii*N_POINTS_LINE+jj; + Global_Index = Conn_Line_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != iNode)) { + nElem_Flag[iProcessor] = iNode; + nElem_Send[iProcessor+1]++; + } + + } + } + + /*--- Reset out flags and then loop through our local triangle surface + elements performing the same check for where each grid node resides. ---*/ + + for (int ii=0; ii < size; ii++) nElem_Flag[ii]= -1; + + for (int ii = 0; ii < (int)nParallel_Tria; ii++) { + for ( int jj = 0; jj < N_POINTS_TRIANGLE; jj++ ) { + + /*--- Get global index. Note the -1 since it was 1-based for viz. ---*/ + + iNode = ii*N_POINTS_TRIANGLE + jj; + Global_Index = Conn_Tria_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != iNode)) { + nElem_Flag[iProcessor] = iNode; + nElem_Send[iProcessor+1]++; + } + + } + } + + /*--- Reset out flags and then loop through our local quad surface + elements performing the same check for where each grid node resides. ---*/ + + for (int ii=0; ii < size; ii++) nElem_Flag[ii]= -1; + + for (int ii = 0; ii < (int)nParallel_Quad; ii++) { + for ( int jj = 0; jj < N_POINTS_QUADRILATERAL; jj++ ) { + + /*--- Get global index. Note the -1 since it was 1-based for viz. ---*/ + + iNode = ii*N_POINTS_QUADRILATERAL+jj; + Global_Index = Conn_Quad_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != iNode)) { + nElem_Flag[iProcessor] = iNode; + nElem_Send[iProcessor+1]++; + } + + } + } + + /*--- Communicate the number of nodes to be sent/recv'd amongst + all processors. After this communication, each proc knows how + many nodes it will receive from each other processor. ---*/ + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, + &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nElem_Recv[1] = nElem_Send[1]; +#endif + + /*--- Prepare to send. First check how many + messages we will be sending and receiving. Here we also put + the counters into cumulative storage format to make the + communications simpler. ---*/ + + int nSends = 0, nRecvs = 0; + for (int ii=0; ii < size; ii++) nElem_Flag[ii] = -1; + + for (int ii = 0; ii < size; ii++) { + if ((ii != rank) && (nElem_Send[ii+1] > 0)) nSends++; + if ((ii != rank) && (nElem_Recv[ii+1] > 0)) nRecvs++; + + nElem_Send[ii+1] += nElem_Send[ii]; + nElem_Recv[ii+1] += nElem_Recv[ii]; + } + + /*--- Allocate arrays for sending the global ID. ---*/ + + unsigned long *idSend = new unsigned long[nElem_Send[size]](); + + /*--- Create an index variable to keep track of our index + positions as we load up the send buffer. ---*/ + + unsigned long *idIndex = new unsigned long[size](); + for (int ii=0; ii < size; ii++) idIndex[ii] = nElem_Send[ii]; + + /*--- Now loop back through the local connectivities for the surface + elements and load up the global IDs for sending to their home proc. ---*/ + + for (int ii = 0; ii < (int)nParallel_Line; ii++) { + for ( int jj = 0; jj < N_POINTS_LINE; jj++ ) { + + /*--- Get global index. Note the -1 since it was 1-based for viz. ---*/ + + iNode = ii*N_POINTS_LINE+jj; + Global_Index = Conn_Line_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Load global ID into the buffer for sending ---*/ + + if (nElem_Flag[iProcessor] != iNode) { + + nElem_Flag[iProcessor] = iNode; + unsigned long nn = idIndex[iProcessor]; + + /*--- Load the connectivity values. ---*/ + + idSend[nn] = Global_Index; nn++; + + /*--- Increment the index by the message length ---*/ + + idIndex[iProcessor]++; + + } + + } + } + + for (int ii=0; ii < size; ii++) nElem_Flag[ii]= -1; + + for (int ii = 0; ii < (int)nParallel_Tria; ii++) { + for ( int jj = 0; jj < N_POINTS_TRIANGLE; jj++ ) { + + /*--- Get global index. Note the -1 since it was 1-based for viz. ---*/ + + iNode = ii*N_POINTS_TRIANGLE + jj; + Global_Index = Conn_Tria_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Load global ID into the buffer for sending ---*/ + + if (nElem_Flag[iProcessor] != iNode) { + + nElem_Flag[iProcessor] = iNode; + unsigned long nn = idIndex[iProcessor]; + + /*--- Load the connectivity values. ---*/ + + idSend[nn] = Global_Index; nn++; + + /*--- Increment the index by the message length ---*/ + + idIndex[iProcessor]++; + + } + + } + } + + for (int ii=0; ii < size; ii++) nElem_Flag[ii]= -1; + + for (int ii = 0; ii < (int)nParallel_Quad; ii++) { + for ( int jj = 0; jj < N_POINTS_QUADRILATERAL; jj++ ) { + + /*--- Get global index. Note the -1 since it was 1-based for viz. ---*/ + + iNode = ii*N_POINTS_QUADRILATERAL+jj; + Global_Index = Conn_Quad_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Load global ID into the buffer for sending ---*/ + + if (nElem_Flag[iProcessor] != iNode) { + + nElem_Flag[iProcessor] = iNode; + unsigned long nn = idIndex[iProcessor]; + + /*--- Load the connectivity values. ---*/ + + idSend[nn] = Global_Index; nn++; + + /*--- Increment the index by the message length ---*/ + + idIndex[iProcessor]++; + + } + + } + } + + /*--- Allocate the memory that we need for receiving the global IDs + values and then cue up the non-blocking receives. Note that + we do not include our own rank in the communications. We will + directly copy our own data later. ---*/ + + unsigned long *idRecv = new unsigned long[nElem_Recv[size]](); + +#ifdef HAVE_MPI + /*--- We need double the number of messages to send both the conn. + and the flags for the halo cells. ---*/ + + send_req = new SU2_MPI::Request[nSends]; + recv_req = new SU2_MPI::Request[nRecvs]; + + /*--- Launch the non-blocking recv's for the global IDs. ---*/ + + unsigned long iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(idRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the global IDs. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(idSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } +#endif + + /*--- Copy my own rank's data into the recv buffer directly. ---*/ + + int mm = nElem_Recv[rank]; + int ll = nElem_Send[rank]; + int kk = nElem_Send[rank+1]; + + for (int nn=ll; nnGetnPoints()]; + for (iPoint = 0; iPoint < volume_sorter->GetnPoints(); iPoint++) surfPoint[iPoint] = -1; + + for (int ii = 0; ii < nElem_Recv[size]; ii++) { + surfPoint[(int)idRecv[ii] - volume_sorter->GetNodeBegin(rank)] = (int)idRecv[ii]; + } + + /*--- First, add up the number of surface points I have on my rank. ---*/ + + nParallel_Poin = 0; + Renumber2Global.clear(); + + for (iPoint = 0; iPoint < volume_sorter->GetnPoints(); iPoint++) { + if (surfPoint[iPoint] != -1) { + + /*--- Save the global index values for CSV output. ---*/ + + Renumber2Global[nParallel_Poin] = surfPoint[iPoint]; + + /*--- Increment total number of surface points found locally. ---*/ + + nParallel_Poin++; + + } + } + + /*--- Communicate this number of local surface points to all other + processors so that it can be used to create offsets for the new + global numbering for the surface points. ---*/ + + int *nPoint_Send = new int[size+1](); nPoint_Send[0] = 0; + int *nPoint_Recv = new int[size+1](); nPoint_Recv[0] = 0; + + for (int ii=1; ii < size+1; ii++) nPoint_Send[ii]= (int)nParallel_Poin; + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, + &(nPoint_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nPoint_Recv[1] = nPoint_Send[1]; +#endif + + /*--- Go to cumulative storage format to compute the offsets. ---*/ + + for (int ii = 0; ii < size; ii++) { + nPoint_Send[ii+1] += nPoint_Send[ii]; + nPoint_Recv[ii+1] += nPoint_Recv[ii]; + } + + /*--- Now that we know the number of local surface points that we have, + we can allocate the new data structure to hold these points alone. Here, + we also copy the data for those points from our volume data structure. ---*/ + + if (passiveDoubleBuffer == nullptr){ + passiveDoubleBuffer = new passivedouble[nParallel_Poin*VARS_PER_POINT]; + } + for (int jj = 0; jj < VARS_PER_POINT; jj++) { + count = 0; + for (int ii = 0; ii < (int)volume_sorter->GetnPoints(); ii++) { + if (surfPoint[ii] !=-1) { + passiveDoubleBuffer[count*VARS_PER_POINT + jj] = volume_sorter->GetData(jj,ii); + count++; + } + } + } + /*--- Reduce the total number of surf points we have. This will be + needed for writing the surface solution files later. ---*/ + +#ifndef HAVE_MPI + nGlobal_Poin_Par = nParallel_Poin; +#else + SU2_MPI::Allreduce(&nParallel_Poin, &nGlobal_Poin_Par, 1, + MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#endif + + /*--- Now that we know every proc's global offset for the number of + surface points, we can create the new global numbering. Here, we + create a new mapping using two arrays, which will need to be + communicated. We use our mask again here. ---*/ + + unsigned long *globalP = new unsigned long[nParallel_Poin](); + unsigned long *renumbP = new unsigned long[nParallel_Poin](); + + count = 0; + for (iPoint = 0; iPoint < volume_sorter->GetnPoints(); iPoint++) { + if (surfPoint[iPoint] != -1) { + globalP[count] = surfPoint[iPoint]; + renumbP[count] = count + nPoint_Recv[rank]; + count++; + } + } + + /*--------------------------------------------------------------------------*/ + /*--- Step 3: Communicate the arrays with the new global surface point ---*/ + /*--- numbering to the procs that hold the connectivity for ---*/ + /*--- each element. This will be done in two phases. First, ---*/ + /*--- we send the arrays around to the other procs based on ---*/ + /*--- the linear partitioning for the elems. This gets us ---*/ + /*--- most of the way there, however, due to the type of ---*/ + /*--- linear partitioning for the elements, there may exist ---*/ + /*--- elements that have nodes outside of the linear part. ---*/ + /*--- bounds. This is because the elems are distributed based ---*/ + /*--- on the node with the smallest global ID. ---*/ + /*--------------------------------------------------------------------------*/ + + /*--- Reset our flags and counters ---*/ + + for (int ii=0; ii < size; ii++) { + nElem_Send[ii] = 0; + nElem_Recv[ii] = 0; + nElem_Flag[ii]= -1; + } + nElem_Send[size] = 0; nElem_Recv[size] = 0; + + /*--- Loop through my local surface nodes, find which proc the global + value lives on, then communicate the global ID and remumbered value. ---*/ + + for (int ii = 0; ii < (int)nParallel_Poin; ii++) { + + Global_Index = globalP[ii]; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != ii)) { + nElem_Flag[iProcessor] = ii; + nElem_Send[iProcessor+1]++; + } + + } + + /*--- Communicate the number of cells to be sent/recv'd amongst + all processors. After this communication, each proc knows how + many cells it will receive from each other processor. ---*/ + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, + &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nElem_Recv[1] = nElem_Send[1]; +#endif + + /*--- Prepare to send. First check how many + messages we will be sending and receiving. Here we also put + the counters into cumulative storage format to make the + communications simpler. ---*/ + + nSends = 0; nRecvs = 0; + for (int ii=0; ii < size; ii++) nElem_Flag[ii] = -1; + + for (int ii = 0; ii < size; ii++) { + if ((ii != rank) && (nElem_Send[ii+1] > 0)) nSends++; + if ((ii != rank) && (nElem_Recv[ii+1] > 0)) nRecvs++; + + nElem_Send[ii+1] += nElem_Send[ii]; + nElem_Recv[ii+1] += nElem_Recv[ii]; + } + + /*--- Allocate memory to hold the globals that we are + sending. ---*/ + + unsigned long *globalSend = NULL; + globalSend = new unsigned long[nElem_Send[size]](); + + /*--- Allocate memory to hold the renumbering that we are + sending. ---*/ + + unsigned long *renumbSend = NULL; + renumbSend = new unsigned long[nElem_Send[size]](); + + /*--- Create an index variable to keep track of our index + position as we load up the send buffer. ---*/ + + unsigned long *index = new unsigned long[size](); + for (int ii=0; ii < size; ii++) index[ii] = nElem_Send[ii]; + + /*--- Loop back through and load up the buffers for the global IDs + and their new renumbering values. ---*/ + + for (int ii = 0; ii < (int)nParallel_Poin; ii++) { + + Global_Index = globalP[ii]; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + if (nElem_Flag[iProcessor] != ii) { + + nElem_Flag[iProcessor] = ii; + unsigned long nn = index[iProcessor]; + + globalSend[nn] = Global_Index; + renumbSend[nn] = renumbP[ii]; + + /*--- Increment the index by the message length ---*/ + + index[iProcessor]++; + + } + } + + /*--- Free memory after loading up the send buffer. ---*/ + + delete [] index; + + /*--- Allocate the memory that we need for receiving the + values and then cue up the non-blocking receives. Note that + we do not include our own rank in the communications. We will + directly copy our own data later. ---*/ + + unsigned long *globalRecv = NULL; + globalRecv = new unsigned long[nElem_Recv[size]](); + + unsigned long *renumbRecv = NULL; + renumbRecv = new unsigned long[nElem_Recv[size]](); + +#ifdef HAVE_MPI + /*--- We need double the number of messages to send both the conn. + and the flags for the halo cells. ---*/ + + send_req = new SU2_MPI::Request[2*nSends]; + recv_req = new SU2_MPI::Request[2*nRecvs]; + + /*--- Launch the non-blocking recv's for the global ID. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(globalRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the global ID. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(globalSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking recv's for the renumbered ID. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(renumbRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage+nRecvs])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the renumbered ID. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(renumbSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage+nSends])); + iMessage++; + } + } + +#endif + + /*--- Load our own procs data into the buffers directly. ---*/ + + mm = nElem_Recv[rank]; + ll = nElem_Send[rank]; + kk = nElem_Send[rank+1]; + + for (int nn=ll; nn renumber for nodes. Note + the adding of 1 back in here for the eventual viz. purposes. ---*/ + + map Global2Renumber; + for (int ii = 0; ii < nElem_Recv[size]; ii++) { + Global2Renumber[globalRecv[ii]] = renumbRecv[ii] + 1; + } + + + /*--- The final step is one last pass over all elements to check + for points outside of the linear partitions of the elements. Again, + note that elems were distributed based on their smallest global ID, + so some nodes of the elem may have global IDs lying outside of the + linear partitioning. We need to recover the mapping for these + outliers. We loop over all local surface elements to find these. ---*/ + + vector::iterator it; + vector outliers; + + for (int ii = 0; ii < (int)nParallel_Line; ii++) { + for ( int jj = 0; jj < N_POINTS_LINE; jj++ ) { + + iNode = ii*N_POINTS_LINE+jj; + Global_Index = Conn_Line_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Store the global ID if it is outside our own linear partition. ---*/ + + if ((iProcessor != (unsigned long)rank)) { + outliers.push_back(Global_Index); + } + + } + } + + for (int ii=0; ii < size; ii++) nElem_Flag[ii]= -1; + + for (int ii = 0; ii < (int)nParallel_Tria; ii++) { + for ( int jj = 0; jj < N_POINTS_TRIANGLE; jj++ ) { + + iNode = ii*N_POINTS_TRIANGLE + jj; + Global_Index = Conn_Tria_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Store the global ID if it is outside our own linear partition. ---*/ + + if ((iProcessor != (unsigned long)rank)) { + outliers.push_back(Global_Index); + } + + } + } + + for (int ii=0; ii < size; ii++) nElem_Flag[ii]= -1; + + for (int ii = 0; ii < (int)nParallel_Quad; ii++) { + for ( int jj = 0; jj < N_POINTS_QUADRILATERAL; jj++ ) { + + iNode = ii*N_POINTS_QUADRILATERAL+jj; + Global_Index = Conn_Quad_Par[iNode]-1; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Store the global ID if it is outside our own linear partition. ---*/ + + if ((iProcessor != (unsigned long)rank)) { + outliers.push_back(Global_Index); + } + + } + } + + /*--- Create a unique list of global IDs that fall outside of our procs + linear partition. ---*/ + + sort(outliers.begin(), outliers.end()); + it = unique(outliers.begin(), outliers.end()); + outliers.resize(it - outliers.begin()); + + /*--- Now loop over the outliers and communicate to those procs that + hold the new numbering for our outlier points. We need to ask for the + new numbering from these procs. ---*/ + + for (int ii=0; ii < size; ii++) { + nElem_Send[ii] = 0; + nElem_Recv[ii] = 0; + nElem_Flag[ii]= -1; + } + nElem_Send[size] = 0; nElem_Recv[size] = 0; + + for (int ii = 0; ii < (int)outliers.size(); ii++) { + + Global_Index = outliers[ii]; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != ii)) { + nElem_Flag[iProcessor] = ii; + nElem_Send[iProcessor+1]++; + } + + } + + /*--- Communicate the number of cells to be sent/recv'd amongst + all processors. After this communication, each proc knows how + many cells it will receive from each other processor. ---*/ + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, + &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nElem_Recv[1] = nElem_Send[1]; +#endif + + /*--- Prepare to send connectivities. First check how many + messages we will be sending and receiving. Here we also put + the counters into cumulative storage format to make the + communications simpler. ---*/ + + nSends = 0; nRecvs = 0; + for (int ii=0; ii < size; ii++) nElem_Flag[ii] = -1; + + for (int ii = 0; ii < size; ii++) { + if ((ii != rank) && (nElem_Send[ii+1] > 0)) nSends++; + if ((ii != rank) && (nElem_Recv[ii+1] > 0)) nRecvs++; + + nElem_Send[ii+1] += nElem_Send[ii]; + nElem_Recv[ii+1] += nElem_Recv[ii]; + } + + delete [] idSend; + idSend = new unsigned long[nElem_Send[size]]; + for (int ii = 0; ii < nElem_Send[size]; ii++) + idSend[ii] = 0; + + /*--- Reset our index variable for reuse. ---*/ + + for (int ii=0; ii < size; ii++) idIndex[ii] = nElem_Send[ii]; + + /*--- Loop over the outliers again and load up the global IDs. ---*/ + + for (int ii = 0; ii < (int)outliers.size(); ii++) { + + Global_Index = outliers[ii]; + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != ii)) { + + nElem_Flag[iProcessor] = ii; + unsigned long nn = idIndex[iProcessor]; + + /*--- Load the global ID values. ---*/ + + idSend[nn] = Global_Index; nn++; + + /*--- Increment the index by the message length ---*/ + + idIndex[iProcessor]++; + + } + } + + /*--- Allocate the memory that we need for receiving the + values and then cue up the non-blocking receives. Note that + we do not include our own rank in the communications. We will + directly copy our own data later. ---*/ + + delete [] idRecv; + idRecv = new unsigned long[nElem_Recv[size]](); + +#ifdef HAVE_MPI + /*--- We need double the number of messages to send both the conn. + and the flags for the halo cells. ---*/ + + send_req = new SU2_MPI::Request[nSends]; + recv_req = new SU2_MPI::Request[nRecvs]; + + /*--- Launch the non-blocking recv's for the connectivity. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(idRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the connectivity. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(idSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } +#endif + + /*--- Copy my own rank's data into the recv buffer directly. ---*/ + + mm = nElem_Recv[rank]; + ll = nElem_Send[rank]; + kk = nElem_Send[rank+1]; + + for (int nn=ll; nn nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(idSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking recv's for the connectivity. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(idRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } +#endif + + /*--- Copy my own rank's data into the recv buffer directly. ---*/ + + mm = nElem_Send[rank]; + ll = nElem_Recv[rank]; + kk = nElem_Recv[rank+1]; + + for (int nn=ll; nn renumber transformation. Note that by construction, + nElem_Send[ii] == outliers.size(). We also add in the 1 for viz. here. ---*/ + + for (int ii = 0; ii < nElem_Send[size]; ii++) { + Global2Renumber[outliers[ii]] = idSend[ii] + 1; + } + + /*--- We can now overwrite the local connectivity for our surface elems + using our completed map with the new global renumbering. Whew!! Note + the -1 when accessing the conn from the map. ---*/ + + for (iElem = 0; iElem < nParallel_Line; iElem++) { + iNode = (int)iElem*N_POINTS_LINE; + Conn_Line_Par[iNode+0] = (int)Global2Renumber[Conn_Line_Par[iNode+0]-1]; + Conn_Line_Par[iNode+1] = (int)Global2Renumber[Conn_Line_Par[iNode+1]-1]; + } + + for (iElem = 0; iElem < nParallel_Tria; iElem++) { + iNode = (int)iElem*N_POINTS_TRIANGLE; + Conn_Tria_Par[iNode+0] = (int)Global2Renumber[Conn_Tria_Par[iNode+0]-1]; + Conn_Tria_Par[iNode+1] = (int)Global2Renumber[Conn_Tria_Par[iNode+1]-1]; + Conn_Tria_Par[iNode+2] = (int)Global2Renumber[Conn_Tria_Par[iNode+2]-1]; + } + + for (iElem = 0; iElem < nParallel_Quad; iElem++) { + iNode = (int)iElem*N_POINTS_QUADRILATERAL; + Conn_Quad_Par[iNode+0] = (int)Global2Renumber[Conn_Quad_Par[iNode+0]-1]; + Conn_Quad_Par[iNode+1] = (int)Global2Renumber[Conn_Quad_Par[iNode+1]-1]; + Conn_Quad_Par[iNode+2] = (int)Global2Renumber[Conn_Quad_Par[iNode+2]-1]; + Conn_Quad_Par[iNode+3] = (int)Global2Renumber[Conn_Quad_Par[iNode+3]-1]; + } + + /*--- Free temporary memory ---*/ + + delete [] idIndex; + delete [] surfPoint; + delete [] globalP; + delete [] renumbP; + + delete [] idSend; + delete [] idRecv; + delete [] globalSend; + delete [] globalRecv; + delete [] renumbSend; + delete [] renumbRecv; + delete [] nElem_Recv; + delete [] nElem_Send; + delete [] nElem_Flag; + delete [] Local_Halo; + delete [] nPoint_Send; + delete [] nPoint_Recv; + +} + +void CSurfaceFVMDataSorter::SortConnectivity(CConfig *config, CGeometry *geometry, bool val_sort) { + + /*--- Sort connectivity for each type of element (excluding halos). Note + In these routines, we sort the connectivity into a linear partitioning + across all processors based on the global index of the grid nodes. ---*/ + + /*--- Sort volumetric grid connectivity. ---*/ + + SortSurfaceConnectivity(config, geometry, LINE ); + SortSurfaceConnectivity(config, geometry, TRIANGLE ); + SortSurfaceConnectivity(config, geometry, QUADRILATERAL); + + + unsigned long nTotal_Surf_Elem = nParallel_Line + nParallel_Tria + nParallel_Quad; +#ifndef HAVE_MPI + nGlobal_Elem_Par = nTotal_Surf_Elem; +#else + SU2_MPI::Allreduce(&nTotal_Surf_Elem, &nGlobal_Elem_Par, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#endif + + connectivity_sorted = true; + +} + +void CSurfaceFVMDataSorter::SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { + + unsigned long iProcessor; + unsigned short NODES_PER_ELEMENT; + unsigned long iPoint, jPoint; + unsigned long nElem_Total = 0, Global_Index; + + unsigned long iMarker; + + int *Conn_Elem = NULL; + +#ifdef HAVE_MPI + SU2_MPI::Request *send_req, *recv_req; + SU2_MPI::Status status; + int ind; +#endif + + /*--- Store the local number of this element type and the number of nodes + per this element type. In serial, this will be the total number of this + element type in the entire mesh. In parallel, it is the number on only + the current partition. ---*/ + + switch (Elem_Type) { + case LINE: + NODES_PER_ELEMENT = N_POINTS_LINE; + break; + case TRIANGLE: + NODES_PER_ELEMENT = N_POINTS_TRIANGLE; + break; + case QUADRILATERAL: + NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; + break; + default: + SU2_MPI::Error("Unrecognized element type", CURRENT_FUNCTION); + NODES_PER_ELEMENT = 0; + break; + } + + /*--- We start with the connectivity distributed across all procs with + no particular ordering assumed. We need to loop through our local partition + and decide how many elements we must send to each other rank in order to + have all elements sorted according to a linear partitioning of the grid + nodes, i.e., rank 0 holds the first nPoint()/nProcessors nodes. + First, initialize a counter and flag. ---*/ + + int *nElem_Send = new int[size+1]; nElem_Send[0] = 0; + int *nElem_Recv = new int[size+1]; nElem_Recv[0] = 0; + int *nElem_Flag = new int[size]; + + for (int ii=0; ii < size; ii++) { + nElem_Send[ii] = 0; + nElem_Recv[ii] = 0; + nElem_Flag[ii]= -1; + } + nElem_Send[size] = 0; nElem_Recv[size] = 0; + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_Plotting(iMarker) == YES) { + + for (int ii = 0; ii < (int)geometry->GetnElem_Bound(iMarker); ii++) { + + if (geometry->bound[iMarker][ii]->GetVTK_Type() == Elem_Type) { + for ( int jj = 0; jj < NODES_PER_ELEMENT; jj++ ) { + + /*--- Get the index of the current point. ---*/ + + iPoint = geometry->bound[iMarker][ii]->GetNode(jj); + Global_Index = geometry->node[iPoint]->GetGlobalIndex(); + + /*--- Search for the lowest global index in this element. We + send the element to the processor owning the range that includes + the lowest global index value. ---*/ + + for (int kk = 0; kk < NODES_PER_ELEMENT; kk++) { + jPoint = geometry->bound[iMarker][ii]->GetNode(kk); + unsigned long newID = geometry->node[jPoint]->GetGlobalIndex(); + if (newID < Global_Index) Global_Index = newID; + } + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- If we have not visited this element yet, increment our + number of elements that must be sent to a particular proc. ---*/ + + if ((nElem_Flag[iProcessor] != ii)) { + nElem_Flag[iProcessor] = ii; + nElem_Send[iProcessor+1]++; + } + + } + } + } + } + } + + /*--- Communicate the number of cells to be sent/recv'd amongst + all processors. After this communication, each proc knows how + many cells it will receive from each other processor. ---*/ + +#ifdef HAVE_MPI + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, + &(nElem_Recv[1]), 1, MPI_INT, MPI_COMM_WORLD); +#else + nElem_Recv[1] = nElem_Send[1]; +#endif + + /*--- Prepare to send connectivities. First check how many + messages we will be sending and receiving. Here we also put + the counters into cumulative storage format to make the + communications simpler. ---*/ + + int nSends = 0, nRecvs = 0; + for (int ii=0; ii < size; ii++) nElem_Flag[ii] = -1; + + for (int ii = 0; ii < size; ii++) { + if ((ii != rank) && (nElem_Send[ii+1] > 0)) nSends++; + if ((ii != rank) && (nElem_Recv[ii+1] > 0)) nRecvs++; + + nElem_Send[ii+1] += nElem_Send[ii]; + nElem_Recv[ii+1] += nElem_Recv[ii]; + } + + /*--- Allocate memory to hold the connectivity that we are + sending. ---*/ + + unsigned long *connSend = NULL; + connSend = new unsigned long[NODES_PER_ELEMENT*nElem_Send[size]]; + for (int ii = 0; ii < NODES_PER_ELEMENT*nElem_Send[size]; ii++) + connSend[ii] = 0; + + /*--- Allocate arrays for storing halo flags. ---*/ + + unsigned short *haloSend = new unsigned short[nElem_Send[size]]; + for (int ii = 0; ii < nElem_Send[size]; ii++) + haloSend[ii] = false; + + /*--- Create an index variable to keep track of our index + position as we load up the send buffer. ---*/ + + unsigned long *index = new unsigned long[size]; + for (int ii=0; ii < size; ii++) index[ii] = NODES_PER_ELEMENT*nElem_Send[ii]; + + unsigned long *haloIndex = new unsigned long[size]; + for (int ii=0; ii < size; ii++) haloIndex[ii] = nElem_Send[ii]; + + /*--- Loop through our elements and load the elems and their + additional data that we will send to the other procs. ---*/ + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_Plotting(iMarker) == YES) { + + for (int ii = 0; ii < (int)geometry->GetnElem_Bound(iMarker); ii++) { + + if (geometry->bound[iMarker][ii]->GetVTK_Type() == Elem_Type) { + for ( int jj = 0; jj < NODES_PER_ELEMENT; jj++ ) { + + /*--- Get the index of the current point. ---*/ + + iPoint = geometry->bound[iMarker][ii]->GetNode(jj); + Global_Index = geometry->node[iPoint]->GetGlobalIndex(); + + /*--- Search for the lowest global index in this element. We + send the element to the processor owning the range that includes + the lowest global index value. ---*/ + + for (int kk = 0; kk < NODES_PER_ELEMENT; kk++) { + jPoint = geometry->bound[iMarker][ii]->GetNode(kk); + unsigned long newID = geometry->node[jPoint]->GetGlobalIndex(); + if (newID < Global_Index) Global_Index = newID; + } + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = linearPartitioner->GetRankContainingIndex(Global_Index); + + /*--- Load connectivity into the buffer for sending ---*/ + + if (nElem_Flag[iProcessor] != ii) { + + nElem_Flag[iProcessor] = ii; + unsigned long nn = index[iProcessor]; + unsigned long mm = haloIndex[iProcessor]; + + /*--- Load the connectivity values. ---*/ + + for (int kk = 0; kk < NODES_PER_ELEMENT; kk++) { + iPoint = geometry->bound[iMarker][ii]->GetNode(kk); + connSend[nn] = geometry->node[iPoint]->GetGlobalIndex(); nn++; + + /*--- Check if this is a halo node. If so, flag this element + as a halo cell. We will use this later to sort and remove + any duplicates from the connectivity list. ---*/ + + if (volume_sorter->GetHalo(iPoint)) haloSend[mm] = true; + + } + + /*--- Increment the index by the message length ---*/ + + index[iProcessor] += NODES_PER_ELEMENT; + haloIndex[iProcessor]++; + + } + } + } + } + } + } + + /*--- Free memory after loading up the send buffer. ---*/ + + delete [] index; + delete [] haloIndex; + + /*--- Allocate the memory that we need for receiving the conn + values and then cue up the non-blocking receives. Note that + we do not include our own rank in the communications. We will + directly copy our own data later. ---*/ + + unsigned long *connRecv = NULL; + connRecv = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; + for (int ii = 0; ii < NODES_PER_ELEMENT*nElem_Recv[size]; ii++) + connRecv[ii] = 0; + + unsigned short *haloRecv = new unsigned short[nElem_Recv[size]]; + for (int ii = 0; ii < nElem_Recv[size]; ii++) + haloRecv[ii] = false; + +#ifdef HAVE_MPI + /*--- We need double the number of messages to send both the conn. + and the flags for the halo cells. ---*/ + + send_req = new SU2_MPI::Request[2*nSends]; + recv_req = new SU2_MPI::Request[2*nRecvs]; + + /*--- Launch the non-blocking recv's for the connectivity. ---*/ + + unsigned long iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = NODES_PER_ELEMENT*nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = NODES_PER_ELEMENT*kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(connRecv[ll]), count, MPI_UNSIGNED_LONG, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the connectivity. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = NODES_PER_ELEMENT*nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = NODES_PER_ELEMENT*kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(connSend[ll]), count, MPI_UNSIGNED_LONG, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage])); + iMessage++; + } + } + + /*--- Repeat the process to communicate the halo flags. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Recv[ii])) { + int ll = nElem_Recv[ii]; + int kk = nElem_Recv[ii+1] - nElem_Recv[ii]; + int count = kk; + int source = ii; + int tag = ii + 1; + SU2_MPI::Irecv(&(haloRecv[ll]), count, MPI_UNSIGNED_SHORT, source, tag, + MPI_COMM_WORLD, &(recv_req[iMessage+nRecvs])); + iMessage++; + } + } + + /*--- Launch the non-blocking sends of the halo flags. ---*/ + + iMessage = 0; + for (int ii=0; ii nElem_Send[ii])) { + int ll = nElem_Send[ii]; + int kk = nElem_Send[ii+1] - nElem_Send[ii]; + int count = kk; + int dest = ii; + int tag = rank + 1; + SU2_MPI::Isend(&(haloSend[ll]), count, MPI_UNSIGNED_SHORT, dest, tag, + MPI_COMM_WORLD, &(send_req[iMessage+nSends])); + iMessage++; + } + } +#endif + + /*--- Copy my own rank's data into the recv buffer directly. ---*/ + + int mm = NODES_PER_ELEMENT*nElem_Recv[rank]; + int ll = NODES_PER_ELEMENT*nElem_Send[rank]; + int kk = NODES_PER_ELEMENT*nElem_Send[rank+1]; + + for (int nn=ll; nn 0) Conn_Elem = new int[NODES_PER_ELEMENT*nElem_Recv[size]]; + int count = 0; nElem_Total = 0; + for (int ii = 0; ii < nElem_Recv[size]; ii++) { + if (!haloRecv[ii]) { + nElem_Total++; + for (int jj = 0; jj < NODES_PER_ELEMENT; jj++) { + Conn_Elem[count] = (int)connRecv[ii*NODES_PER_ELEMENT+jj] + 1; + count++; + } + } + } + + /*--- Store the particular global element count in the class data, + and set the class data pointer to the connectivity array. ---*/ + + switch (Elem_Type) { + case LINE: + nParallel_Line = nElem_Total; + if (Conn_Line_Par != NULL) delete [] Conn_Line_Par; + if (nParallel_Line > 0) Conn_Line_Par = Conn_Elem; + break; + case TRIANGLE: + nParallel_Tria = nElem_Total; + if (Conn_Tria_Par != NULL) delete [] Conn_Tria_Par; + if (nParallel_Tria > 0) Conn_Tria_Par = Conn_Elem; + break; + case QUADRILATERAL: + nParallel_Quad = nElem_Total; + if (Conn_Quad_Par != NULL) delete [] Conn_Quad_Par; + if (nParallel_Quad > 0) Conn_Quad_Par = Conn_Elem; + break; + default: + SU2_MPI::Error("Unrecognized element type", CURRENT_FUNCTION); + break; + } + + /*--- Free temporary memory from communications ---*/ + + delete [] connSend; + delete [] connRecv; + delete [] haloSend; + delete [] haloRecv; + delete [] nElem_Recv; + delete [] nElem_Send; + delete [] nElem_Flag; + +} diff --git a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp new file mode 100644 index 000000000000..4ae02eb1119d --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp @@ -0,0 +1,599 @@ +#include "../../../include/output/filewriter/CTecplotBinaryFileWriter.hpp" +#ifdef HAVE_TECIO + #include "TECIO.h" +#endif +#include + +const string CTecplotBinaryFileWriter::fileExt = ".szplt"; + +CTecplotBinaryFileWriter::CTecplotBinaryFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter, + unsigned long time_iter, su2double timestep) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim), time_iter(time_iter), timestep(timestep){} + +CTecplotBinaryFileWriter::~CTecplotBinaryFileWriter(){} + +void CTecplotBinaryFileWriter::Write_Data(){ + + if (!dataSorter->GetConnectivitySorted()){ + SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); + } + + /*--- Set a timer for the binary file writing. ---*/ + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + +#ifdef HAVE_TECIO + + /*--- Reduce the total number of each element. ---*/ + + unsigned long nTot_Line, nTot_Tria, nTot_Quad, nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; + unsigned long nParallel_Line = dataSorter->GetnElem(LINE), + nParallel_Tria = dataSorter->GetnElem(TRIANGLE), + nParallel_Quad = dataSorter->GetnElem(QUADRILATERAL), + nParallel_Tetr = dataSorter->GetnElem(TETRAHEDRON), + nParallel_Hexa = dataSorter->GetnElem(HEXAHEDRON), + nParallel_Pris = dataSorter->GetnElem(PRISM), + nParallel_Pyra = dataSorter->GetnElem(PYRAMID); +#ifdef HAVE_MPI + SU2_MPI::Allreduce(&nParallel_Line, &nTot_Line, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Tria, &nTot_Tria, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Quad, &nTot_Quad, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Tetr, &nTot_Tetr, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Hexa, &nTot_Hexa, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Pris, &nTot_Pris, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Pyra, &nTot_Pyra, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#else + nTot_Line = nParallel_Line; + + nTot_Tria = nParallel_Tria; + nTot_Quad = nParallel_Quad; + nTot_Tetr = nParallel_Tetr; + nTot_Hexa = nParallel_Hexa; + nTot_Pris = nParallel_Pris; + nTot_Pyra = nParallel_Pyra; +#endif + + string data_set_title = "Visualization of the solution"; + + ostringstream tecplot_variable_names; + for (size_t iVar = 0; iVar < fieldnames.size()-1; ++iVar) { + tecplot_variable_names << fieldnames[iVar] << ","; + } + tecplot_variable_names << fieldnames[fieldnames.size()-1]; + + void* file_handle = NULL; + int32_t err = tecFileWriterOpen(fileName.c_str(), data_set_title.c_str(), tecplot_variable_names.str().c_str(), + FILEFORMAT_SZL, FILETYPE_FULL, (int32_t)FieldDataType_Double, NULL, &file_handle); + if (err) cout << "Error opening Tecplot file '" << fileName << "'" << endl; + +#ifdef HAVE_MPI + err = tecMPIInitialize(file_handle, MPI_COMM_WORLD, MASTER_NODE); + if (err) cout << "Error initializing Tecplot parallel output." << endl; +#endif + + /*--- Define the zone(s). For 2D, and for 3D surfaces, each rank outputs a separate zone. ---*/ + + int64_t num_nodes; + int64_t num_cells; + int32_t zone_type; + + + num_nodes = static_cast(dataSorter->GetnPointsGlobal()); + num_cells = static_cast(dataSorter->GetnElem()); + if (nDim == 3){ + if ((nTot_Quad > 0 || nTot_Tria > 0) && (nTot_Hexa + nTot_Pris + nTot_Pyra + nTot_Tetr == 0)){ + zone_type = ZONETYPE_FEQUADRILATERAL; + } + else { + zone_type = ZONETYPE_FEBRICK; + } + } + else { + if (nTot_Line > 0 && (nTot_Tria + nTot_Quad == 0)){ + zone_type = ZONETYPE_FELINESEG; + + } + else{ + zone_type = ZONETYPE_FEQUADRILATERAL; + } + } + + bool is_unsteady = false; + passivedouble solution_time = 0.0; + + if (timestep > 0.0){ + is_unsteady = true; + solution_time = SU2_TYPE::GetValue(timestep)*time_iter; + } + + int32_t zone; + vector value_locations(fieldnames.size(), 1); /* Nodal variables. */ + err = tecZoneCreateFE(file_handle, "Zone", zone_type, num_nodes, num_cells, NULL, NULL, &value_locations[0], NULL, 0, 0, 0, &zone); + if (err) cout << rank << ": Error creating Tecplot zone." << endl; + if (is_unsteady) { + err = tecZoneSetUnsteadyOptions(file_handle, zone, solution_time, time_iter + 1); + if (err) cout << rank << ": Error setting Tecplot zone unsteady options." << std::endl; + } + +#ifdef HAVE_MPI + + unsigned short iVar; + NodePartitioner node_partitioner(num_nodes, size); + std::set halo_nodes; + vector sorted_halo_nodes; + vector halo_var_data; + vector num_nodes_to_receive(size, 0); + vector values_to_receive_displacements(size); + + if (zone_type == ZONETYPE_FEBRICK) { + + /* We output a single, partitioned zone where each rank outputs one partition. */ + vector partition_owners; + partition_owners.reserve(size); + for (int32_t iRank = 0; iRank < size; ++iRank) + partition_owners.push_back(iRank); + err = tecZoneMapPartitionsToMPIRanks(file_handle, zone, size, &partition_owners[0]); + if (err) cout << rank << ": Error assigning MPI ranks for Tecplot zone partitions." << endl; + + /* Gather a list of nodes we refer to but are not outputting. */ + + for (unsigned long i = 0; i < nParallel_Tria * N_POINTS_TRIANGLE; ++i) + if ((unsigned long)dataSorter->GetElem_Connectivity(TRIANGLE, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(TRIANGLE, 0, i)) + halo_nodes.insert(dataSorter->GetElem_Connectivity(TRIANGLE, 0, i)); + + for (unsigned long i = 0; i < nParallel_Quad * N_POINTS_QUADRILATERAL; ++i) + if ((unsigned long)dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i)) + halo_nodes.insert(dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i)); + + for (unsigned long i = 0; i < nParallel_Tetr * N_POINTS_TETRAHEDRON; ++i) + if ((unsigned long)dataSorter->GetElem_Connectivity(TETRAHEDRON, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(TETRAHEDRON, 0, i)) + halo_nodes.insert(dataSorter->GetElem_Connectivity(TETRAHEDRON, 0, i)); + + for (unsigned long i = 0; i < nParallel_Hexa * N_POINTS_HEXAHEDRON; ++i) + if ((unsigned long)dataSorter->GetElem_Connectivity(HEXAHEDRON, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(HEXAHEDRON, 0, i)) + halo_nodes.insert(dataSorter->GetElem_Connectivity(HEXAHEDRON, 0, i)); + + for (unsigned long i = 0; i < nParallel_Pris * N_POINTS_PRISM; ++i) + if ((unsigned long)dataSorter->GetElem_Connectivity(PRISM, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(PRISM, 0, i)) + halo_nodes.insert(dataSorter->GetElem_Connectivity(PRISM, 0, i)); + + for (unsigned long i = 0; i < nParallel_Pyra * N_POINTS_PYRAMID; ++i) + if ((unsigned long)dataSorter->GetElem_Connectivity(PYRAMID, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(PYRAMID, 0, i)) + halo_nodes.insert(dataSorter->GetElem_Connectivity(PYRAMID, 0, i)); + + /* Sorted list of halo nodes for this MPI rank. */ + sorted_halo_nodes.assign(halo_nodes.begin(), halo_nodes.end()); + + /* Have to include all nodes our cells refer to or TecIO will barf, so add the halo node count to the number of local nodes. */ + int64_t partition_num_nodes = dataSorter->GetNodeEnd(rank) - dataSorter->GetNodeBegin(rank) + static_cast(halo_nodes.size()); + int64_t partition_num_cells = nParallel_Tetr + nParallel_Hexa + nParallel_Pris + nParallel_Pyra; + + /*--- We effectively tack the halo nodes onto the end of the node list for this partition. + TecIO will later replace them with references to nodes in neighboring partitions. */ + size_t num_halo_nodes = sorted_halo_nodes.size(); + vector halo_node_local_numbers(max((size_t)1, num_halo_nodes)); /* Min size 1 to avoid crashes when we access these vectors below. */ + vector neighbor_partitions(max((size_t)1, num_halo_nodes)); + vector neighbor_nodes(max((size_t)1, num_halo_nodes)); + for(int64_t i = 0; i < static_cast(num_halo_nodes); ++i) { + halo_node_local_numbers[i] = dataSorter->GetNodeEnd(rank) - dataSorter->GetNodeBegin(rank) + i + 1; + int owning_rank; + unsigned long node_number; + node_partitioner.GetOwningRankAndNodeNumber(sorted_halo_nodes[i], owning_rank, node_number); + neighbor_partitions[i] = owning_rank + 1; /* Partition numbers are 1-based. */ + neighbor_nodes[i] = static_cast(node_number); + } + err = tecFEPartitionCreate64(file_handle, zone, rank + 1, partition_num_nodes, partition_num_cells, + static_cast(num_halo_nodes), &halo_node_local_numbers[0], &neighbor_partitions[0], &neighbor_nodes[0], 0, NULL); + if (err) cout << rank << ": Error creating Tecplot zone partition." << endl; + + /* Gather halo node data. First, tell each rank how many nodes' worth of data we need from them. */ + for (size_t i = 0; i < num_halo_nodes; ++i) + ++num_nodes_to_receive[neighbor_partitions[i] - 1]; + vector num_nodes_to_send(size); + SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, MPI_COMM_WORLD); + + /* Now send the global node numbers whose data we need, + and receive the same from all other ranks. + Each rank has globally consecutive node numbers, + so we can just parcel out sorted_halo_nodes for send. */ + vector nodes_to_send_displacements(size); + vector nodes_to_receive_displacements(size); + nodes_to_send_displacements[0] = 0; + nodes_to_receive_displacements[0] = 0; + for(int iRank = 1; iRank < size; ++iRank) { + nodes_to_send_displacements[iRank] = nodes_to_send_displacements[iRank - 1] + num_nodes_to_send[iRank - 1]; + nodes_to_receive_displacements[iRank] = nodes_to_receive_displacements[iRank - 1] + num_nodes_to_receive[iRank - 1]; + } + int total_num_nodes_to_send = nodes_to_send_displacements[size - 1] + num_nodes_to_send[size - 1]; + vector nodes_to_send(max(1, total_num_nodes_to_send)); + + /* The terminology gets a bit confusing here. We're sending the node numbers + (sorted_halo_nodes) whose data we need to receive, and receiving + lists of nodes whose data we need to send. */ + if (sorted_halo_nodes.empty()) sorted_halo_nodes.resize(1); /* Avoid crash. */ + SU2_MPI::Alltoallv(&sorted_halo_nodes[0], &num_nodes_to_receive[0], &nodes_to_receive_displacements[0], MPI_UNSIGNED_LONG, + &nodes_to_send[0], &num_nodes_to_send[0], &nodes_to_send_displacements[0], MPI_UNSIGNED_LONG, + MPI_COMM_WORLD); + + /* Now actually send and receive the data */ + vector data_to_send(max(1, total_num_nodes_to_send * (int)fieldnames.size())); + halo_var_data.resize(max((size_t)1, fieldnames.size() * num_halo_nodes)); + vector num_values_to_send(size); + vector values_to_send_displacements(size); + vector num_values_to_receive(size); + size_t index = 0; + for(int iRank = 0; iRank < size; ++iRank) { + /* We send and receive GlobalField_Counter values per node. */ + num_values_to_send[iRank] = num_nodes_to_send[iRank] * fieldnames.size(); + values_to_send_displacements[iRank] = nodes_to_send_displacements[iRank] * fieldnames.size(); + num_values_to_receive[iRank] = num_nodes_to_receive[iRank] * fieldnames.size(); + values_to_receive_displacements[iRank] = nodes_to_receive_displacements[iRank] * fieldnames.size(); + for(iVar = 0; iVar < fieldnames.size(); ++iVar) + for(int iNode = 0; iNode < num_nodes_to_send[iRank]; ++iNode) { + unsigned long node_offset = nodes_to_send[nodes_to_send_displacements[iRank] + iNode] - dataSorter->GetNodeBegin(rank) - 1; + data_to_send[index++] =dataSorter->GetData(iVar,node_offset); + } + } + SU2_MPI::Alltoallv(&data_to_send[0], &num_values_to_send[0], &values_to_send_displacements[0], MPI_DOUBLE, + &halo_var_data[0], &num_values_to_receive[0], &values_to_receive_displacements[0], MPI_DOUBLE, + MPI_COMM_WORLD); + } + else { + /* Zone will be gathered to and output by MASTER_NODE */ + int32_t partition_owner = MASTER_NODE; + err = tecZoneMapPartitionsToMPIRanks(file_handle, zone, 1, &partition_owner); + } + + /*--- Write surface and volumetric solution data. ---*/ + + if (zone_type == ZONETYPE_FEBRICK) { + std::vector values_to_write(dataSorter->GetnPoints()); + for (iVar = 0; err == 0 && iVar < fieldnames.size(); iVar++) { + for(unsigned long i = 0; i < dataSorter->GetnPoints(); ++i) + values_to_write[i] = dataSorter->GetData(iVar, i); + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, rank + 1, dataSorter->GetnPoints(), &values_to_write[0]); + if (err) cout << rank << ": Error outputting Tecplot variable values." << endl; + for (int iRank = 0; err == 0 && iRank < size; ++iRank) { + if (num_nodes_to_receive[iRank] > 0) { + int var_data_offset = values_to_receive_displacements[iRank] + num_nodes_to_receive[iRank] * iVar; + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, rank + 1, static_cast(num_nodes_to_receive[iRank]), &halo_var_data[var_data_offset]); + if (err) cout << rank << ": Error outputting Tecplot halo values." << endl; + } + } + } + } else { + if (rank == MASTER_NODE) { + vector var_data; + unsigned long nPoint = dataSorter->GetnPoints(); + vector num_points(size); + SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, &num_points[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + + for(int iRank = 0; iRank < size; ++iRank) { + int64_t rank_num_points = num_points[iRank]; + + if (rank_num_points > 0) { + if (iRank == rank) { /* Output local data. */ + std::vector values_to_write; + for (iVar = 0; err == 0 && iVar < fieldnames.size(); iVar++) { + values_to_write.resize(rank_num_points); + for(unsigned long i = 0; i < (unsigned long)rank_num_points; ++i) + values_to_write[i] = dataSorter->GetData(iVar,i); + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &values_to_write[0]); + if (err) cout << rank << ": Error outputting Tecplot variable values." << endl; + } + } + else { /* Receive data from other rank. */ + var_data.resize(max((int64_t)1, (int64_t)fieldnames.size() * rank_num_points)); + CBaseMPIWrapper::Recv(&var_data[0], fieldnames.size() * rank_num_points, MPI_DOUBLE, iRank, iRank, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + for (iVar = 0; err == 0 && iVar < fieldnames.size(); iVar++) { + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &var_data[iVar * rank_num_points]); + if (err) cout << rank << ": Error outputting Tecplot surface variable values." << endl; + } + } + } + } + } + else { /* Send data to MASTER_NODE */ + unsigned long nPoint = dataSorter->GetnPoints(); + + SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + + vector var_data; + size_t var_data_size = fieldnames.size() * dataSorter->GetnPoints(); + var_data.reserve(var_data_size); + for (iVar = 0; err == 0 && iVar < fieldnames.size() ; iVar++) + for(unsigned long i = 0; i < dataSorter->GetnPoints(); ++i) + var_data.push_back(dataSorter->GetData(iVar,i)); + + if (var_data.size() > 0) + CBaseMPIWrapper::Send(&var_data[0], static_cast(var_data.size()), MPI_DOUBLE, MASTER_NODE, rank, MPI_COMM_WORLD); + } + } + +#else + + unsigned short iVar; + + vector var_data; + size_t var_data_size = fieldnames.size() * dataSorter->GetnPoints(); + var_data.reserve(var_data_size); + + + for (iVar = 0; err == 0 && iVar < fieldnames.size(); iVar++) { + for(unsigned long i = 0; i < dataSorter->GetnPoints(); ++i) + var_data.push_back(dataSorter->GetData(iVar,i)); + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, dataSorter->GetnPoints(), &var_data[iVar * dataSorter->GetnPoints()]); + if (err) cout << rank << ": Error outputting Tecplot variable value." << endl; + } + + +#endif /* HAVE_MPI */ + + /*--- Write connectivity data. ---*/ + + unsigned long iElem; + +#ifdef HAVE_MPI + if (zone_type == ZONETYPE_FEBRICK) { + + int64_t nodes[8]; + + /** + * Each rank writes node numbers relative to the partition it is outputting (starting with node number 1). + * Ghost (halo) nodes identified above are numbered sequentially just beyond the end of the actual, local nodes. + * Note that beg_node and end_node refer to zero-based node numbering, but Conn_* contain one-based node numbers. + */ +#define MAKE_LOCAL(n) dataSorter->GetNodeBegin(rank) < (unsigned long)n && (unsigned long)n <= dataSorter->GetNodeEnd(rank) \ + ? (int64_t)((unsigned long)n - dataSorter->GetNodeBegin(rank)) \ + : GetHaloNodeNumber(n, dataSorter->GetNodeEnd(rank) - dataSorter->GetNodeBegin(rank), sorted_halo_nodes) + + for (iElem = 0; err == 0 && iElem < nParallel_Tetr; iElem++) { + nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1)); + nodes[2] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2)); + nodes[3] = nodes[2]; + nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3)); + nodes[5] = nodes[4]; + nodes[6] = nodes[4]; + nodes[7] = nodes[4]; + err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Hexa; iElem++) { + nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1)); + nodes[2] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2)); + nodes[3] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4)); + nodes[5] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5)); + nodes[6] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6)); + nodes[7] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7)); + err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Pris; iElem++) { + nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 1)); + nodes[2] = nodes[1]; + nodes[3] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 2)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 3)); + nodes[5] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 4)); + nodes[6] = nodes[5]; + nodes[7] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 5)); + err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Pyra; iElem++) { + nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1)); + nodes[2] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2)); + nodes[3] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4)); + nodes[5] = nodes[4]; + nodes[6] = nodes[4]; + nodes[7] = nodes[4]; + err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + } else { + if (rank == MASTER_NODE) { + + /* Non-hexahedral output by the master node. Output local data directly, and gather other data from the other ranks. */ + + int64_t nodes[4]; + + vector connectivity_sizes(size); + unsigned long unused = 0; + SU2_MPI::Gather(&unused, 1, MPI_UNSIGNED_LONG, &connectivity_sizes[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + vector connectivity; + for(int iRank = 0; iRank < size; ++iRank) { + if (iRank == rank) { + for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(LINE, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(LINE, iElem, 1); + err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 2, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); + err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3); + err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + } else { /* Receive node map and write out. */ + connectivity.resize(max((unsigned long)1, connectivity_sizes[iRank])); + SU2_MPI::Recv(&connectivity[0], connectivity_sizes[iRank], MPI_UNSIGNED_LONG, iRank, iRank, MPI_COMM_WORLD, MPI_STATUS_IGNORE); + err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, connectivity_sizes[iRank], &connectivity[0]); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + } + } else { + + /* Non-hexahedral output by non-master node. Send what we've got to the master node. */ + + unsigned long connectivity_size; + connectivity_size = 2 * nParallel_Line + 4 * (nParallel_Tria + nParallel_Quad); + SU2_MPI::Gather(&connectivity_size, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); + vector connectivity; + connectivity.reserve(connectivity_size); + for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { + connectivity.push_back(dataSorter->GetElem_Connectivity(LINE, iElem, 0)); + connectivity.push_back(dataSorter->GetElem_Connectivity(LINE, iElem, 0)); + } + + for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { + connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0)); + connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1)); + connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)); + connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)); + } + + for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { + connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0)); + connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1)); + connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2)); + connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3)); + } + + if (connectivity.empty()) connectivity.resize(1); /* Avoid crash */ + SU2_MPI::Send(&connectivity[0], connectivity_size, MPI_UNSIGNED_LONG, MASTER_NODE, rank, MPI_COMM_WORLD); + } + } +#else + + int64_t nodes[8]; + + for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); + err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3); + err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Tetr; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2); + nodes[4] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); + nodes[5] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); + nodes[6] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); + nodes[7] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); + err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Hexa; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3); + nodes[4] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4); + nodes[5] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5); + nodes[6] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6); + nodes[7] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7); + err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Pris; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(PRISM, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(PRISM, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(PRISM, iElem, 1); + nodes[3] = dataSorter->GetElem_Connectivity(PRISM, iElem, 2); + nodes[4] = dataSorter->GetElem_Connectivity(PRISM, iElem, 3); + nodes[5] = dataSorter->GetElem_Connectivity(PRISM, iElem, 4); + nodes[6] = dataSorter->GetElem_Connectivity(PRISM, iElem, 4); + nodes[7] = dataSorter->GetElem_Connectivity(PRISM, iElem, 5); + err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + for (iElem = 0; err == 0 && iElem < nParallel_Pyra; iElem++) { + nodes[0] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0); + nodes[1] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1); + nodes[2] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2); + nodes[3] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3); + nodes[4] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); + nodes[5] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); + nodes[6] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); + nodes[7] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); + err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); + if (err) cout << rank << ": Error outputting Tecplot node values." << endl; + } + + + +#endif + + err = tecFileWriterClose(&file_handle); + if (err) cout << rank << ": Error finishing Tecplot file output." << endl; + +#endif /* HAVE_TECIO */ + + /*--- Compute and store the write time. ---*/ + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime-StartTime; + + file_size = Determine_Filesize(fileName); + + /*--- Compute and store the bandwidth ---*/ + + Bandwidth = file_size/(1.0e6)/UsedTime; +} + + +int64_t CTecplotBinaryFileWriter::GetHaloNodeNumber(unsigned long global_node_number, unsigned long last_local_node, vector const &halo_node_list) +{ + vector::const_iterator it = lower_bound(halo_node_list.begin(), halo_node_list.end(), global_node_number); + assert(it != halo_node_list.end()); + assert(*it == global_node_number); + /* When C++11 is universally available, replace the following mouthful with "auto" */ + iterator_traits::const_iterator>::difference_type offset = distance(halo_node_list.begin(), it); + assert(offset >= 0); + return (int64_t)(last_local_node + offset + 1); +} + diff --git a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp new file mode 100644 index 000000000000..bb7c37e73915 --- /dev/null +++ b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp @@ -0,0 +1,216 @@ +#include "../../../include/output/filewriter/CTecplotFileWriter.hpp" + +const string CTecplotFileWriter::fileExt = ".dat"; + +CTecplotFileWriter::CTecplotFileWriter(vector fields, unsigned short nDim, + string fileName, CParallelDataSorter *dataSorter, + unsigned long time_iter, su2double timestep) : + CFileWriter(std::move(fields), std::move(fileName), dataSorter, fileExt, nDim), time_iter(time_iter), timestep(timestep){} + +CTecplotFileWriter::~CTecplotFileWriter(){} + +void CTecplotFileWriter::Write_Data(){ + + if (!dataSorter->GetConnectivitySorted()){ + SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); + } + + unsigned short iVar; + + unsigned long iPoint, iElem; + + int iProcessor; + + ofstream Tecplot_File; + + file_size = 0.0; + + /*--- Set a timer for the file writing. ---*/ + +#ifndef HAVE_MPI + StartTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StartTime = MPI_Wtime(); +#endif + + /*--- Reduce the total number of each element. ---*/ + + unsigned long nTot_Line, nTot_Tria, nTot_Quad, nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; + unsigned long nParallel_Line = dataSorter->GetnElem(LINE), + nParallel_Tria = dataSorter->GetnElem(TRIANGLE), + nParallel_Quad = dataSorter->GetnElem(QUADRILATERAL), + nParallel_Tetr = dataSorter->GetnElem(TETRAHEDRON), + nParallel_Hexa = dataSorter->GetnElem(HEXAHEDRON), + nParallel_Pris = dataSorter->GetnElem(PRISM), + nParallel_Pyra = dataSorter->GetnElem(PYRAMID); +#ifdef HAVE_MPI + SU2_MPI::Allreduce(&nParallel_Line, &nTot_Line, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Tria, &nTot_Tria, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Quad, &nTot_Quad, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Tetr, &nTot_Tetr, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Hexa, &nTot_Hexa, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Pris, &nTot_Pris, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); + SU2_MPI::Allreduce(&nParallel_Pyra, &nTot_Pyra, 1, MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); +#else + nTot_Line = nParallel_Line; + + nTot_Tria = nParallel_Tria; + nTot_Quad = nParallel_Quad; + nTot_Tetr = nParallel_Tetr; + nTot_Hexa = nParallel_Hexa; + nTot_Pris = nParallel_Pris; + nTot_Pyra = nParallel_Pyra; +#endif + + /*--- Open Tecplot ASCII file and write the header. ---*/ + + if (rank == MASTER_NODE) { + Tecplot_File.open(fileName.c_str(), ios::out); + Tecplot_File.precision(6); + Tecplot_File << "TITLE = \"Visualization of the solution\"" << endl; + + Tecplot_File << "VARIABLES = "; + for (iVar = 0; iVar < fieldnames.size()-1; iVar++) { + Tecplot_File << "\"" << fieldnames[iVar] << "\","; + } + Tecplot_File << "\"" << fieldnames[fieldnames.size()-1] << "\"" << endl; + + /*--- Write the header ---*/ + + Tecplot_File << "ZONE "; + + if (timestep > 0.0){ + Tecplot_File << "STRANDID="< 0 && (nTot_Tria + nTot_Quad == 0)){ + Tecplot_File << ", DATAPACKING=POINT, ZONETYPE=FELINESEG"<< endl; + } + else{ + Tecplot_File << ", DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL"<< endl; + } + } + Tecplot_File.close(); + } + +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + + /*--- Each processor opens the file. ---*/ + + Tecplot_File.open(fileName.c_str(), ios::out | ios::app); + + /*--- Write surface and volumetric solution data. ---*/ + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + + /*--- Write the node data from this proc ---*/ + + + for (iPoint = 0; iPoint < dataSorter->GetnPoints(); iPoint++) { + for (iVar = 0; iVar < fieldnames.size(); iVar++) + Tecplot_File << scientific << dataSorter->GetData(iVar, iPoint) << "\t"; + Tecplot_File << endl; + } + } + + Tecplot_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + + /*--- Write connectivity data. ---*/ + + for (iProcessor = 0; iProcessor < size; iProcessor++) { + if (rank == iProcessor) { + + for (iElem = 0; iElem < nParallel_Line; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(LINE, iElem, 0) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(LINE, iElem, 1)<< "\n"; + } + + + for (iElem = 0; iElem < nParallel_Tria; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2) << "\n"; + } + + for (iElem = 0; iElem < nParallel_Quad; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3) << "\n"; + } + + for (iElem = 0; iElem < nParallel_Tetr; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\n"; + } + + for (iElem = 0; iElem < nParallel_Hexa; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7) << "\n"; + } + + for (iElem = 0; iElem < nParallel_Pris; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 1) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 3) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 4) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 5) << "\n"; + } + + for (iElem = 0; iElem < nParallel_Pyra; iElem++) { + Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\t"; + Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\n"; + } + + + } + Tecplot_File.flush(); +#ifdef HAVE_MPI + SU2_MPI::Barrier(MPI_COMM_WORLD); +#endif + } + + Tecplot_File.close(); + + /*--- Compute and store the write time. ---*/ + +#ifndef HAVE_MPI + StopTime = su2double(clock())/su2double(CLOCKS_PER_SEC); +#else + StopTime = MPI_Wtime(); +#endif + UsedTime = StopTime-StartTime; + + file_size = Determine_Filesize(fileName); + + /*--- Compute and store the bandwidth ---*/ + + Bandwidth = file_size/(1.0e6)/UsedTime; +} + + diff --git a/SU2_CFD/src/output_physics.cpp b/SU2_CFD/src/output/output_physics.cpp similarity index 98% rename from SU2_CFD/src/output_physics.cpp rename to SU2_CFD/src/output/output_physics.cpp index 464f12c9b8c1..5c7826732409 100644 --- a/SU2_CFD/src/output_physics.cpp +++ b/SU2_CFD/src/output/output_physics.cpp @@ -35,10 +35,12 @@ * License along with SU2. If not, see . */ -#include "../include/output_structure.hpp" +#include "../../include/output/COutputLegacy.hpp" +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" -void COutput::ComputeTurboPerformance(CSolver *solver_container, CGeometry *geometry, CConfig *config) { +void COutputLegacy::ComputeTurboPerformance(CSolver *solver_container, CGeometry *geometry, CConfig *config) { CFluidModel *FluidModel; unsigned short nDim = geometry->GetnDim(); @@ -61,7 +63,7 @@ void COutput::ComputeTurboPerformance(CSolver *solver_container, CGeometry *geom /*--- Compute BC imposed value for convergence monitoring ---*/ for(iMarkerTP = 0; iMarkerTP < nMarkerTP; iMarkerTP++ ){ for(iSpan = 0; iSpan < config->GetnSpan_iZones(iMarkerTP) + 1; iSpan++){ - if(config->GetRampOutletPressure() && config->GetExtIter() > 0){ + if(config->GetRampOutletPressure() && config->GetInnerIter() > 0){ PressureOut_BC[iMarkerTP][iSpan] = config->GetMonitorOutletPressure()/config->GetPressure_Ref(); } FluidModel->SetTDState_PT(config->GetTotalPressureIn_BC(), config->GetTotalTemperatureIn_BC()); diff --git a/SU2_CFD/src/output_structure.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp similarity index 92% rename from SU2_CFD/src/output_structure.cpp rename to SU2_CFD/src/output/output_structure_legacy.cpp index b23c990f5bb2..47379fade86b 100644 --- a/SU2_CFD/src/output_structure.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -2,7 +2,7 @@ * \file output_structure.cpp * \brief Main subroutines for output solver information * \author F. Palacios, T. Economon - * \version 6.2.0 "Falcon" + * \version 6.1.0 "Falcon" * * The current SU2 release has been coordinated by the * SU2 International Developers Society @@ -18,7 +18,7 @@ * - Prof. Edwin van der Weide's group at the University of Twente. * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, * Tim Albring, and the SU2 contributors. * * SU2 is free software; you can redistribute it and/or @@ -35,9 +35,12 @@ * License along with SU2. If not, see . */ -#include "../include/output_structure.hpp" +#include "../../include/output/COutputLegacy.hpp" -COutput::COutput(CConfig *config) { +#include "../../../Common/include/geometry_structure.hpp" +#include "../../include/solver_structure.hpp" + +COutputLegacy::COutputLegacy(CConfig *config) { rank = SU2_MPI::GetRank(); size = SU2_MPI::GetSize(); @@ -321,7 +324,7 @@ COutput::COutput(CConfig *config) { } } -COutput::~COutput(void) { +COutputLegacy::~COutputLegacy(void) { /* delete pointers initialized at construction*/ /* Coords and Conn_*(Connectivity) have their own dealloc functions */ /* Data is taken care of in DeallocateSolution function */ @@ -444,7 +447,7 @@ COutput::~COutput(void) { } } -void COutput::SetSurfaceCSV_Flow(CConfig *config, CGeometry *geometry, +void COutputLegacy::SetSurfaceCSV_Flow(CConfig *config, CGeometry *geometry, CSolver *FlowSolver, unsigned long iExtIter, unsigned short val_iZone, unsigned short val_iInst) { @@ -464,12 +467,12 @@ void COutput::SetSurfaceCSV_Flow(CConfig *config, CGeometry *geometry, ofstream SurfFlow_file; /*--- Write file name with extension if unsteady ---*/ - strcpy (cstr, config->GetSurfFlowCoeff_FileName().c_str()); + strcpy (cstr, config->GetSurfCoeff_FileName().c_str()); - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(val_iInst)); - }else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { + }else if (config->GetTime_Marching() && config->GetTime_Domain()) { if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iExtIter)); @@ -680,15 +683,15 @@ void COutput::SetSurfaceCSV_Flow(CConfig *config, CGeometry *geometry, /*--- Write file name with extension if unsteady ---*/ char buffer[50]; - string filename = config->GetSurfFlowCoeff_FileName(); + string filename = config->GetSurfCoeff_FileName(); ofstream SurfFlow_file; /*--- Write file name with extension if unsteady ---*/ strcpy (cstr, filename.c_str()); - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(val_iInst)); - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { + } else if (config->GetTime_Marching() && config->GetTime_Domain()) { if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iExtIter)); @@ -797,7 +800,7 @@ void COutput::SetSurfaceCSV_Flow(CConfig *config, CGeometry *geometry, } -void COutput::SetSurfaceCSV_Adjoint(CConfig *config, CGeometry *geometry, CSolver *AdjSolver, CSolver *FlowSolution, unsigned long iExtIter, unsigned short val_iZone, unsigned short val_iInst) { +void COutputLegacy::SetSurfaceCSV_Adjoint(CConfig *config, CGeometry *geometry, CSolver *AdjSolver, CSolver *FlowSolution, unsigned long iExtIter, unsigned short val_iZone, unsigned short val_iInst) { #ifndef HAVE_MPI @@ -811,10 +814,10 @@ void COutput::SetSurfaceCSV_Adjoint(CConfig *config, CGeometry *geometry, CSolve strcpy (cstr, config->GetSurfAdjCoeff_FileName().c_str()); - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(val_iInst)); - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { + } else if (config->GetTime_Marching() && config->GetTime_Domain()) { if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iExtIter)); @@ -1067,10 +1070,10 @@ void COutput::SetSurfaceCSV_Adjoint(CConfig *config, CGeometry *geometry, CSolve /*--- Write file name with extension if unsteady ---*/ strcpy (cstr, filename.c_str()); - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(val_iInst)); - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { + } else if (config->GetTime_Marching() && config->GetTime_Domain()) { if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iExtIter)); @@ -1203,7 +1206,7 @@ void COutput::SetSurfaceCSV_Adjoint(CConfig *config, CGeometry *geometry, CSolve #endif } -void COutput::MergeConnectivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { +void COutputLegacy::MergeConnectivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { /*--- Flags identifying the types of files to be written. ---*/ @@ -1273,7 +1276,7 @@ void COutput::MergeConnectivity(CConfig *config, CGeometry *geometry, unsigned s } -void COutput::MergeCoordinates(CConfig *config, CGeometry *geometry) { +void COutputLegacy::MergeCoordinates(CConfig *config, CGeometry *geometry) { /*--- Local variables needed on all processors ---*/ @@ -1563,7 +1566,7 @@ void COutput::MergeCoordinates(CConfig *config, CGeometry *geometry) { } -void COutput::MergeVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::MergeVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { int iProcessor; unsigned short NODES_PER_ELEMENT = 0; @@ -1934,7 +1937,7 @@ void COutput::MergeVolumetricConnectivity(CConfig *config, CGeometry *geometry, } -void COutput::MergeSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::MergeSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { unsigned short NODES_PER_ELEMENT; @@ -2285,7 +2288,7 @@ void COutput::MergeSurfaceConnectivity(CConfig *config, CGeometry *geometry, uns } -void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short Kind_Solver = config->GetKind_Solver(); unsigned short iVar = 0, jVar = 0, FirstIndex = NONE, SecondIndex = NONE, ThirdIndex = NONE; @@ -2375,110 +2378,109 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv nVar_Consv = nVar_First + nVar_Second + nVar_Third; nVar_Total = nVar_Consv; - if (!config->GetLow_MemoryOutput()) { - - /*--- Add the limiters ---*/ - - if (config->GetWrt_Limiters()) nVar_Total += nVar_Consv; - - /*--- Add the residuals ---*/ - - if (config->GetWrt_Residuals()) nVar_Total += nVar_Consv; - - /*--- Add the grid velocity to the restart file for the unsteady adjoint ---*/ - - if (dynamic_grid && !fem) { - iVar_GridVel = nVar_Total; + + /*--- Add the limiters ---*/ + + if (config->GetWrt_Limiters()) nVar_Total += nVar_Consv; + + /*--- Add the residuals ---*/ + + if (config->GetWrt_Residuals()) nVar_Total += nVar_Consv; + + /*--- Add the grid velocity to the restart file for the unsteady adjoint ---*/ + + if (dynamic_grid && !fem) { + iVar_GridVel = nVar_Total; + if (geometry->GetnDim() == 2) nVar_Total += 2; + else if (geometry->GetnDim() == 3) nVar_Total += 3; + } + + /*--- Add Pressure, Temperature, Cp, Mach to the restart file ---*/ + + if (Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || + Kind_Solver == INC_EULER || Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS || + Kind_Solver == FEM_EULER || Kind_Solver == FEM_NAVIER_STOKES || Kind_Solver == FEM_RANS || + Kind_Solver == FEM_LES) { + iVar_PressCp = nVar_Total; nVar_Total += 3; + iVar_MachMean = nVar_Total; nVar_Total += 1; + } + + /*--- Add Laminar Viscosity, Skin Friction, Heat Flux, & yPlus to the restart file ---*/ + + if (Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || + Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS || + Kind_Solver == FEM_NAVIER_STOKES || Kind_Solver == FEM_RANS || Kind_Solver == FEM_LES) { + iVar_Lam = nVar_Total; + nVar_Total += 1; + iVar_ViscCoeffs = nVar_Total; + if (geometry->GetnDim() == 2) nVar_Total += 2; + else if (geometry->GetnDim() == 3) nVar_Total += 3; + iVar_HeatCoeffs = nVar_Total; + nVar_Total += 2; + } + + /*--- Add Eddy Viscosity to the restart file ---*/ + + if (Kind_Solver == RANS || Kind_Solver == FEM_RANS || Kind_Solver == FEM_LES || Kind_Solver == INC_RANS) { + iVar_Eddy = nVar_Total; nVar_Total += 1; + } + + /*--- Add Sharp edges to the restart file ---*/ + + if (config->GetWrt_SharpEdges()) { + if (((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) || + ((Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) || + ((Kind_Solver == FEM_EULER) || (Kind_Solver == FEM_NAVIER_STOKES) || (Kind_Solver == FEM_RANS) || (Kind_Solver == FEM_LES))) { + iVar_Sharp = nVar_Total; nVar_Total += 1; + } + } + + + if (( Kind_Solver == ADJ_EULER ) || + ( Kind_Solver == ADJ_NAVIER_STOKES ) || + ( Kind_Solver == ADJ_RANS )) { + iVar_Sens = nVar_Total; nVar_Total += 2; + } + + if (Kind_Solver == FEM_ELASTICITY) { + /*--- If the analysis is dynamic... ---*/ + if (config->GetTime_Domain()) { + /*--- Velocities ---*/ + iVar_FEA_Vel = nVar_Total; if (geometry->GetnDim() == 2) nVar_Total += 2; else if (geometry->GetnDim() == 3) nVar_Total += 3; - } - - /*--- Add Pressure, Temperature, Cp, Mach to the restart file ---*/ - - if (Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == INC_EULER || Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS || - Kind_Solver == FEM_EULER || Kind_Solver == FEM_NAVIER_STOKES || Kind_Solver == FEM_RANS || - Kind_Solver == FEM_LES) { - iVar_PressCp = nVar_Total; nVar_Total += 3; - iVar_MachMean = nVar_Total; nVar_Total += 1; - } - - /*--- Add Laminar Viscosity, Skin Friction, Heat Flux, & yPlus to the restart file ---*/ - - if (Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS || - Kind_Solver == FEM_NAVIER_STOKES || Kind_Solver == FEM_RANS || Kind_Solver == FEM_LES) { - iVar_Lam = nVar_Total; - nVar_Total += 1; - iVar_ViscCoeffs = nVar_Total; + /*--- Accelerations ---*/ + iVar_FEA_Accel = nVar_Total; if (geometry->GetnDim() == 2) nVar_Total += 2; else if (geometry->GetnDim() == 3) nVar_Total += 3; - iVar_HeatCoeffs = nVar_Total; - nVar_Total += 2; - } - - /*--- Add Eddy Viscosity to the restart file ---*/ - - if (Kind_Solver == RANS || Kind_Solver == FEM_RANS || Kind_Solver == FEM_LES || Kind_Solver == INC_RANS) { - iVar_Eddy = nVar_Total; nVar_Total += 1; - } - - /*--- Add Sharp edges to the restart file ---*/ - - if (config->GetWrt_SharpEdges()) { - if (((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) || - ((Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) || - ((Kind_Solver == FEM_EULER) || (Kind_Solver == FEM_NAVIER_STOKES) || (Kind_Solver == FEM_RANS) || (Kind_Solver == FEM_LES))) { - iVar_Sharp = nVar_Total; nVar_Total += 1; - } - } - - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS )) { - iVar_Sens = nVar_Total; nVar_Total += 2; - } - - if (Kind_Solver == FEM_ELASTICITY) { - /*--- If the analysis is dynamic... ---*/ - if (config->GetDynamic_Analysis() == DYNAMIC) { - /*--- Velocities ---*/ - iVar_FEA_Vel = nVar_Total; - if (geometry->GetnDim() == 2) nVar_Total += 2; - else if (geometry->GetnDim() == 3) nVar_Total += 3; - /*--- Accelerations ---*/ - iVar_FEA_Accel = nVar_Total; - if (geometry->GetnDim() == 2) nVar_Total += 2; - else if (geometry->GetnDim() == 3) nVar_Total += 3; - } - iVar_FEA_Stress = nVar_Total; nVar_Total += 3; - if (geometry->GetnDim() == 3) {iVar_FEA_Stress_3D = nVar_Total; nVar_Total += 3;} - iVar_FEA_Extra = nVar_Total; nVar_Total += 1; - } - - if ((Kind_Solver == DISC_ADJ_EULER) || - (Kind_Solver == DISC_ADJ_NAVIER_STOKES) || - (Kind_Solver == DISC_ADJ_RANS) || - (Kind_Solver == DISC_ADJ_INC_EULER) || - (Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES) || - (Kind_Solver == DISC_ADJ_INC_RANS)) { - iVar_Sens = nVar_Total; nVar_Total += 1; - iVar_SensDim = nVar_Total; nVar_Total += nDim; } - - if ((Kind_Solver == DISC_ADJ_FEM) && (config->GetFSI_Simulation())){ - iVar_FEA_Extra = nVar_Total; nVar_Total += 2; - } - - if (config->GetExtraOutput()) { - if (Kind_Solver == RANS || Kind_Solver == INC_RANS) { - iVar_Extra = nVar_Total; nVar_Extra = solver[TURB_SOL]->GetnOutputVariables(); nVar_Total += nVar_Extra; - } + iVar_FEA_Stress = nVar_Total; nVar_Total += 3; + if (geometry->GetnDim() == 3) {iVar_FEA_Stress_3D = nVar_Total; nVar_Total += 3;} + iVar_FEA_Extra = nVar_Total; nVar_Total += 1; + } + + if ((Kind_Solver == DISC_ADJ_EULER) || + (Kind_Solver == DISC_ADJ_NAVIER_STOKES) || + (Kind_Solver == DISC_ADJ_RANS) || + (Kind_Solver == DISC_ADJ_INC_EULER) || + (Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES) || + (Kind_Solver == DISC_ADJ_INC_RANS)) { + iVar_Sens = nVar_Total; nVar_Total += 1; + iVar_SensDim = nVar_Total; nVar_Total += nDim; + } + + if ((Kind_Solver == DISC_ADJ_FEM) && (config->GetFSI_Simulation())){ + iVar_FEA_Extra = nVar_Total; nVar_Total += 2; + } + + if (config->GetExtraOutput()) { + if (Kind_Solver == RANS || Kind_Solver == INC_RANS) { + iVar_Extra = nVar_Total; nVar_Extra = solver[TURB_SOL]->GetnOutputVariables(); nVar_Total += nVar_Extra; } - } + + Local_Halo = new int[geometry->GetnPoint()]; for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) Local_Halo[iPoint] = !geometry->node[iPoint]->GetDomain(); @@ -2620,23 +2622,22 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv Buffer_Send_Var[jPoint] = solver[CurrentIndex]->node[iPoint]->GetSolution(jVar); - if (!config->GetLow_MemoryOutput()) { - - if (config->GetWrt_Limiters()) { - Buffer_Send_Vol[jPoint] = solver[CurrentIndex]->node[iPoint]->GetLimiter_Primitive(jVar); - } - - if (config->GetWrt_Residuals()) { - if (!config->GetDiscrete_Adjoint()) { - Buffer_Send_Res[jPoint] = solver[CurrentIndex]->LinSysRes.GetBlock(iPoint, jVar); - } else { - Buffer_Send_Res[jPoint] = solver[CurrentIndex]->node[iPoint]->GetSolution(jVar) - - solver[CurrentIndex]->node[iPoint]->GetSolution_Old(jVar); - } + + if (config->GetWrt_Limiters()) { + Buffer_Send_Vol[jPoint] = solver[CurrentIndex]->node[iPoint]->GetLimiter_Primitive(jVar); + } + + if (config->GetWrt_Residuals()) { + if (!config->GetDiscrete_Adjoint()) { + Buffer_Send_Res[jPoint] = solver[CurrentIndex]->LinSysRes.GetBlock(iPoint, jVar); + } else { + Buffer_Send_Res[jPoint] = solver[CurrentIndex]->node[iPoint]->GetSolution(jVar) - + solver[CurrentIndex]->node[iPoint]->GetSolution_Old(jVar); } - } + + /*--- Only send/recv the volumes & global indices during the first loop ---*/ if (iVar == 0) { @@ -2655,26 +2656,25 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv #else for (iPoint = 0; iPoint < nBuffer_Scalar; iPoint++) Buffer_Recv_Var[iPoint] = Buffer_Send_Var[iPoint]; #endif - if (!config->GetLow_MemoryOutput()) { - - if (config->GetWrt_Limiters()) { + + if (config->GetWrt_Limiters()) { #ifdef HAVE_MPI - SU2_MPI::Gather(Buffer_Send_Vol, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Vol, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(Buffer_Send_Vol, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Vol, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); #else - for (iPoint = 0; iPoint < nBuffer_Scalar; iPoint++) Buffer_Recv_Vol[iPoint] = Buffer_Send_Vol[iPoint]; + for (iPoint = 0; iPoint < nBuffer_Scalar; iPoint++) Buffer_Recv_Vol[iPoint] = Buffer_Send_Vol[iPoint]; #endif - } - - if (config->GetWrt_Residuals()) { + } + + if (config->GetWrt_Residuals()) { #ifdef HAVE_MPI - SU2_MPI::Gather(Buffer_Send_Res, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Res, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); + SU2_MPI::Gather(Buffer_Send_Res, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Res, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); #else - for (iPoint = 0; iPoint < nBuffer_Scalar; iPoint++) Buffer_Recv_Res[iPoint] = Buffer_Send_Res[iPoint]; + for (iPoint = 0; iPoint < nBuffer_Scalar; iPoint++) Buffer_Recv_Res[iPoint] = Buffer_Send_Res[iPoint]; #endif - } - } + + if (iVar == 0) { #ifdef HAVE_MPI SU2_MPI::Gather(Buffer_Send_GlobalIndex, nBuffer_Scalar, MPI_UNSIGNED_LONG, Buffer_Recv_GlobalIndex, nBuffer_Scalar, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); @@ -2696,21 +2696,20 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv Data[iVar][iGlobal_Index] = Buffer_Recv_Var[jPoint]; - if (!config->GetLow_MemoryOutput()) { - - if (config->GetWrt_Limiters()) { - Data[iVar+nVar_Consv][iGlobal_Index] = Buffer_Recv_Vol[jPoint]; - } - - if (config->GetWrt_Residuals()) { - unsigned short ExtraIndex; - ExtraIndex = nVar_Consv; - if (config->GetWrt_Limiters()) ExtraIndex = 2*nVar_Consv; - Data[iVar+ExtraIndex][iGlobal_Index] = Buffer_Recv_Res[jPoint]; - } - + + if (config->GetWrt_Limiters()) { + Data[iVar+nVar_Consv][iGlobal_Index] = Buffer_Recv_Vol[jPoint]; + } + + if (config->GetWrt_Residuals()) { + unsigned short ExtraIndex; + ExtraIndex = nVar_Consv; + if (config->GetWrt_Limiters()) ExtraIndex = 2*nVar_Consv; + Data[iVar+ExtraIndex][iGlobal_Index] = Buffer_Recv_Res[jPoint]; } + + jPoint++; } /*--- Adjust jPoint to index of next proc's data in the buffers. ---*/ @@ -2719,9 +2718,7 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv } } - - if (!config->GetLow_MemoryOutput()) { - + /*--- Additional communication routine for the grid velocity. Note that we are reusing the same temporary buffers from above for efficiency. Also, in the future more routines like this could be used to write @@ -3386,7 +3383,7 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv /*--- Communicate the Velocities for dynamic FEM problem ---*/ - if ((Kind_Solver == FEM_ELASTICITY) && (config->GetDynamic_Analysis() == DYNAMIC)) { + if ((Kind_Solver == FEM_ELASTICITY) && (config->GetTime_Domain())) { /*--- Loop over this partition to collect the current variable ---*/ @@ -3449,7 +3446,7 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv /*--- Communicate the Accelerations for dynamic FEM problem ---*/ - if ((Kind_Solver == FEM_ELASTICITY) && (config->GetDynamic_Analysis() == DYNAMIC)) { + if ((Kind_Solver == FEM_ELASTICITY) && (config->GetTime_Domain())) { /*--- Loop over this partition to collect the current variable ---*/ @@ -3793,7 +3790,7 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv } } - } + /*--- Immediately release the temporary buffers. ---*/ @@ -3833,7 +3830,7 @@ void COutput::MergeSolution(CConfig *config, CGeometry *geometry, CSolver **solv } -void COutput::MergeBaselineSolution(CConfig *config, CGeometry *geometry, CSolver *solver, unsigned short val_iZone) { +void COutputLegacy::MergeBaselineSolution(CConfig *config, CGeometry *geometry, CSolver *solver, unsigned short val_iZone) { /*--- Local variables needed on all processors ---*/ unsigned short iVar; @@ -4054,49 +4051,47 @@ void COutput::MergeBaselineSolution(CConfig *config, CGeometry *geometry, CSolve } -void COutput::SetRestart(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::SetRestart(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { /*--- Local variables ---*/ unsigned short nZone = geometry->GetnZone(); unsigned short Kind_Solver = config->GetKind_Solver(); unsigned short iVar, iDim, nDim = geometry->GetnDim(); - unsigned long iPoint, iExtIter = config->GetExtIter(); + unsigned long iPoint, iExtIter = config->GetInnerIter(); bool dynamic_grid = config->GetDynamic_Grid(); - bool dynamic_fem = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic_fem = (config->GetTime_Domain()); bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); bool disc_adj_fem = (config->GetKind_Solver() == DISC_ADJ_FEM); ofstream restart_file; ofstream meta_file; string filename, meta_filename; bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); /*--- Retrieve filename from config ---*/ - if (((config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint())) && ((config->GetKind_Solver() != DISC_ADJ_FEM))) { - filename = config->GetRestart_AdjFileName(); - filename = config->GetObjFunc_Extension(filename); - } else if (fem) { - filename = config->GetRestart_FEMFileName(); - } else if (disc_adj_fem){ - filename = config->GetRestart_AdjFEMFileName(); - } else { - filename = config->GetRestart_FlowFileName(); - } +// if (((config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint())) && ((config->GetKind_Solver() != DISC_ADJ_FEM))) { +// filename = config->GetRestart_AdjFileName(); +// filename = config->GetObjFunc_Extension(filename); +// } else if (fem) { +// filename = config->GetRestart_FEMFileName(); +// } else if (disc_adj_fem){ +// filename = config->GetRestart_AdjFEMFileName(); +// } else { +// filename = config->GetRestart_FileName(); +// } /*--- Append the zone number if multizone problems ---*/ if (nZone > 1) - filename= config->GetMultizone_FileName(filename, val_iZone); + filename= config->GetMultizone_FileName(filename, val_iZone, ".dat"); /*--- Unsteady problems require an iteration number to be appended. ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(config->GetiInst())); - } else if (config->GetWrt_Unsteady()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + if (config->GetTime_Marching() == HARMONIC_BALANCE) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(config->GetiInst()), ".dat"); + } else if (config->GetTime_Domain()) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter), ".dat"); } else if ((fem || disc_adj_fem) && (config->GetWrt_Dynamic())) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter), ".dat"); } /*--- Open the restart file and write the solution. ---*/ @@ -4123,122 +4118,120 @@ void COutput::SetRestart(CConfig *config, CGeometry *geometry, CSolver **solver, restart_file << "\t\"Conservative_" << iVar+1<<"\""; } - if (!config->GetLow_MemoryOutput()) { - - if (config->GetWrt_Limiters()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - restart_file << "\t\"Limiter_" << iVar+1<<"\""; - } - } - if (config->GetWrt_Residuals()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - restart_file << "\t\"Residual_" << iVar+1<<"\""; - } - } - - /*--- Mesh velocities for dynamic mesh cases ---*/ - - if (dynamic_grid && !fem) { - if (nDim == 2) { - restart_file << "\t\"Grid_Velx\"\t\"Grid_Vely\""; - } else { - restart_file << "\t\"Grid_Velx\"\t\"Grid_Vely\"\t\"Grid_Velz\""; - } + if (config->GetWrt_Limiters()) { + for (iVar = 0; iVar < nVar_Consv; iVar++) { + restart_file << "\t\"Limiter_" << iVar+1<<"\""; } - - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || - (Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { - restart_file << "\t\"Pressure\"\t\"Temperature\"\t\"Pressure_Coefficient\"\t\"Mach\""; - } else - restart_file << "\t\"Pressure\"\t\"Temperature\"\t\"Cp\"\t\"Mach\""; + } + if (config->GetWrt_Residuals()) { + for (iVar = 0; iVar < nVar_Consv; iVar++) { + restart_file << "\t\"Residual_" << iVar+1<<"\""; } - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || - (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { - if (nDim == 2) restart_file << "\t\"Laminar_Viscosity\"\t\"Skin_Friction_Coefficient_X\"\t\"Skin_Friction_Coefficient_Y\"\t\"Heat_Flux\"\t\"Y_Plus\""; - if (nDim == 3) restart_file << "\t\"Laminar_Viscosity\"\t\"Skin_Friction_Coefficient_X\"\t\"Skin_Friction_Coefficient_Y\"\t\"Skin_Friction_Coefficient_Z\"\t\"Heat_Flux\"\t\"Y_Plus\""; - } else { - if (nDim == 2) restart_file << "\t\"m\"\t\"Cf_x\"\t\"Cf_y\"\t\"h\"\t\"y+\""; - if (nDim == 3) restart_file << "\t\"m\"\t\"Cf_x\"\t\"Cf_y\"\t\"Cf_z\"\t\"h\"\t\"y+\""; - } + } + + /*--- Mesh velocities for dynamic mesh cases ---*/ + + if (dynamic_grid && !fem) { + if (nDim == 2) { + restart_file << "\t\"Grid_Velx\"\t\"Grid_Vely\""; + } else { + restart_file << "\t\"Grid_Velx\"\t\"Grid_Vely\"\t\"Grid_Velz\""; } - - if (Kind_Solver == RANS || Kind_Solver == INC_RANS) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { - restart_file << "\t\"Eddy_Viscosity\""; - } else - restart_file << "\t\"mt\""; + } + + if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || + (Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { + if (config->GetTabular_FileFormat() == TAB_CSV) { + restart_file << "\t\"Pressure\"\t\"Temperature\"\t\"Pressure_Coefficient\"\t\"Mach\""; + } else + restart_file << "\t\"Pressure\"\t\"Temperature\"\t\"Cp\"\t\"Mach\""; + } + + if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || + (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { + if (config->GetTabular_FileFormat() == TAB_CSV) { + if (nDim == 2) restart_file << "\t\"Laminar_Viscosity\"\t\"Skin_Friction_Coefficient_X\"\t\"Skin_Friction_Coefficient_Y\"\t\"Heat_Flux\"\t\"Y_Plus\""; + if (nDim == 3) restart_file << "\t\"Laminar_Viscosity\"\t\"Skin_Friction_Coefficient_X\"\t\"Skin_Friction_Coefficient_Y\"\t\"Skin_Friction_Coefficient_Z\"\t\"Heat_Flux\"\t\"Y_Plus\""; + } else { + if (nDim == 2) restart_file << "\t\"m\"\t\"Cf_x\"\t\"Cf_y\"\t\"h\"\t\"y+\""; + if (nDim == 3) restart_file << "\t\"m\"\t\"Cf_x\"\t\"Cf_y\"\t\"Cf_z\"\t\"h\"\t\"y+\""; } - - if (config->GetWrt_SharpEdges()) { - if (((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) || - ((Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS))) { - restart_file << "\t\"Sharp_Edge_Dist\""; - } + } + + if (Kind_Solver == RANS || Kind_Solver == INC_RANS) { + if ((config->GetTabular_FileFormat() == TAB_CSV)) { + restart_file << "\t\"Eddy_Viscosity\""; + } else + restart_file << "\t\"mt\""; + } + + if (config->GetWrt_SharpEdges()) { + if (((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) || + ((Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS))) { + restart_file << "\t\"Sharp_Edge_Dist\""; } - - if ((Kind_Solver == ADJ_EULER ) || - (Kind_Solver == ADJ_NAVIER_STOKES ) || - (Kind_Solver == ADJ_RANS ) ) { - restart_file << "\t\"Surface_Sensitivity\"\t\"Solution_Sensor\""; + } + + if ((Kind_Solver == ADJ_EULER ) || + (Kind_Solver == ADJ_NAVIER_STOKES ) || + (Kind_Solver == ADJ_RANS ) ) { + restart_file << "\t\"Surface_Sensitivity\"\t\"Solution_Sensor\""; + } + if (( Kind_Solver == DISC_ADJ_EULER ) || + ( Kind_Solver == DISC_ADJ_NAVIER_STOKES ) || + ( Kind_Solver == DISC_ADJ_RANS ) || + ( Kind_Solver == DISC_ADJ_INC_EULER ) || + ( Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES ) || + ( Kind_Solver == DISC_ADJ_INC_RANS )) { + restart_file << "\t\"Surface_Sensitivity\"\t\"Sensitivity_x\"\t\"Sensitivity_y\""; + if (geometry->GetnDim() == 3) { + restart_file << "\t\"Sensitivity_z\""; } - if (( Kind_Solver == DISC_ADJ_EULER ) || - ( Kind_Solver == DISC_ADJ_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_RANS ) || - ( Kind_Solver == DISC_ADJ_INC_EULER ) || - ( Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_INC_RANS )) { - restart_file << "\t\"Surface_Sensitivity\"\t\"Sensitivity_x\"\t\"Sensitivity_y\""; - if (geometry->GetnDim() == 3) { - restart_file << "\t\"Sensitivity_z\""; - } + } + + if (Kind_Solver == FEM_ELASTICITY) { + if (!dynamic_fem) { + if (geometry->GetnDim() == 2) + restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Von_Mises_Stress\""; + if (geometry->GetnDim() == 3) + restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Szz\"\t\"Sxz\"\t\"Syz\"\t\"Von_Mises_Stress\""; } - - if (Kind_Solver == FEM_ELASTICITY) { - if (!dynamic_fem) { - if (geometry->GetnDim() == 2) - restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Von_Mises_Stress\""; - if (geometry->GetnDim() == 3) - restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Szz\"\t\"Sxz\"\t\"Syz\"\t\"Von_Mises_Stress\""; + else if (dynamic_fem) { + if (geometry->GetnDim() == 2) { + restart_file << "\t\"Velocity_1\"\t\"Velocity_2\"\t\"Acceleration_1\"\t\"Acceleration_2\""; + restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Von_Mises_Stress\""; } - else if (dynamic_fem) { - if (geometry->GetnDim() == 2) { - restart_file << "\t\"Velocity_1\"\t\"Velocity_2\"\t\"Acceleration_1\"\t\"Acceleration_2\""; - restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Von_Mises_Stress\""; - } - if (geometry->GetnDim() == 3) { - restart_file << "\t\"Velocity_1\"\t\"Velocity_2\"\t\"Velocity_3\"\t\"Acceleration_1\"\t\"Acceleration_2\"\t\"Acceleration_3\""; - restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Szz\"\t\"Sxz\"\t\"Syz\"\t\"Von_Mises_Stress\""; - } + if (geometry->GetnDim() == 3) { + restart_file << "\t\"Velocity_1\"\t\"Velocity_2\"\t\"Velocity_3\"\t\"Acceleration_1\"\t\"Acceleration_2\"\t\"Acceleration_3\""; + restart_file << "\t\"Sxx\"\t\"Syy\"\t\"Sxy\"\t\"Szz\"\t\"Sxz\"\t\"Syz\"\t\"Von_Mises_Stress\""; } } + } + + if ((Kind_Solver == DISC_ADJ_FEM) && (config->GetFSI_Simulation())){ + if (geometry->GetnDim() == 2) + restart_file << "\t\"CrossTerm_1\"\t\"CrossTerm_2\""; + if (geometry->GetnDim() == 3) + restart_file << "\t\"CrossTerm_1\"\t\"CrossTerm_2\"\t\"CrossTerm_3\""; + } + + + if (config->GetExtraOutput()) { + string *headings = NULL; + //if (Kind_Solver == RANS) { + headings = solver[TURB_SOL]->OutputHeadingNames; + //} - if ((Kind_Solver == DISC_ADJ_FEM) && (config->GetFSI_Simulation())){ - if (geometry->GetnDim() == 2) - restart_file << "\t\"CrossTerm_1\"\t\"CrossTerm_2\""; - if (geometry->GetnDim() == 3) - restart_file << "\t\"CrossTerm_1\"\t\"CrossTerm_2\"\t\"CrossTerm_3\""; - } - - - if (config->GetExtraOutput()) { - string *headings = NULL; - //if (Kind_Solver == RANS) { - headings = solver[TURB_SOL]->OutputHeadingNames; - //} - - for (iVar = 0; iVar < nVar_Extra; iVar++) { - if (headings == NULL) { - restart_file << "\t\"ExtraOutput_" << iVar+1<<"\""; - } else { - restart_file << "\t\""<< headings[iVar] <<"\""; - } + for (iVar = 0; iVar < nVar_Extra; iVar++) { + if (headings == NULL) { + restart_file << "\t\"ExtraOutput_" << iVar+1<<"\""; + } else { + restart_file << "\t\""<< headings[iVar] <<"\""; } } } + restart_file << "\n"; /*--- Write the restart file ---*/ @@ -4276,10 +4269,10 @@ void COutput::SetRestart(CConfig *config, CGeometry *geometry, CSolver **solver, /*--- Write the general header and flow conditions ----*/ - if (dual_time) - restart_file <<"EXT_ITER= " << config->GetExtIter() + 1 << endl; - else - restart_file <<"EXT_ITER= " << config->GetExtIter() + config->GetExtIter_OffSet() + 1 << endl; +// if (dual_time) + restart_file <<"EXT_ITER= " << config->GetInnerIter() + 1 << endl; +// else +// restart_file <<"EXT_ITER= " << config->GetInnerIter() + config->GetInnerIter_OffSet() + 1 << endl; restart_file <<"AOA= " << config->GetAoA() - config->GetAoA_Offset() << endl; restart_file <<"SIDESLIP_ANGLE= " << config->GetAoS() - config->GetAoS_Offset() << endl; restart_file <<"INITIAL_BCTHRUST= " << config->GetInitial_BCThrust() << endl; @@ -4295,7 +4288,7 @@ void COutput::SetRestart(CConfig *config, CGeometry *geometry, CSolver **solver, } -void COutput::DeallocateCoordinates(CConfig *config, CGeometry *geometry) { +void COutputLegacy::DeallocateCoordinates(CConfig *config, CGeometry *geometry) { unsigned short iDim, nDim = geometry->GetnDim(); @@ -4312,7 +4305,7 @@ void COutput::DeallocateCoordinates(CConfig *config, CGeometry *geometry) { } } -void COutput::DeallocateConnectivity(CConfig *config, CGeometry *geometry, bool surf_sol) { +void COutputLegacy::DeallocateConnectivity(CConfig *config, CGeometry *geometry, bool surf_sol) { /*--- The master node alone owns all data found in this routine. ---*/ if (rank == MASTER_NODE) { @@ -4336,7 +4329,7 @@ void COutput::DeallocateConnectivity(CConfig *config, CGeometry *geometry, bool } } -void COutput::DeallocateSolution(CConfig *config, CGeometry *geometry) { +void COutputLegacy::DeallocateSolution(CConfig *config, CGeometry *geometry) { /*--- The master node alone owns all data found in this routine. ---*/ if (rank == MASTER_NODE) { @@ -4350,7 +4343,7 @@ void COutput::DeallocateSolution(CConfig *config, CGeometry *geometry) { } } -void COutput::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, unsigned short val_iZone, unsigned short val_iInst) { +void COutputLegacy::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, unsigned short val_iZone, unsigned short val_iInst) { char cstr[200], buffer[50], turb_resid[1000], adj_turb_resid[1000]; unsigned short iMarker_Monitoring; string Monitoring_Tag, monitoring_coeff, aeroelastic_coeff, turbo_coeff; @@ -4389,16 +4382,19 @@ void COutput::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, un /*--- Write file name with extension ---*/ string filename = config->GetConv_FileName(); + string hist_ext = ".csv"; + if (config->GetTabular_FileFormat() == TAB_TECPLOT) hist_ext = ".dat"; + if(config->GetnZone() > 1){ - filename = config->GetMultizone_HistoryFileName(filename, val_iZone); + filename = config->GetMultizone_HistoryFileName(filename, val_iZone, hist_ext); } if(config->GetnTimeInstances() > 1){ filename = config->GetMultiInstance_HistoryFileName(filename, val_iInst); } strcpy (cstr, filename.data()); - if (config->GetWrt_Unsteady() && config->GetRestart()) { - long iExtIter = config->GetUnst_RestartIter(); + if (config->GetTime_Domain() && config->GetRestart()) { + long iExtIter = config->GetRestart_Iter(); if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d", SU2_TYPE::Int(iExtIter)); @@ -4407,11 +4403,9 @@ void COutput::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, un strcat(cstr, buffer); } - if ((config->GetOutput_FileFormat() == TECPLOT) || - (config->GetOutput_FileFormat() == FIELDVIEW)) SPRINTF (buffer, ".dat"); - else if ((config->GetOutput_FileFormat() == TECPLOT_BINARY) || - (config->GetOutput_FileFormat() == FIELDVIEW_BINARY)) SPRINTF (buffer, ".plt"); - else if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) SPRINTF (buffer, ".csv"); + if ((config->GetTabular_FileFormat() == TECPLOT)) SPRINTF (buffer, ".dat"); + else if ((config->GetTabular_FileFormat() == TAB_TECPLOT)) SPRINTF (buffer, ".plt"); + else if ((config->GetTabular_FileFormat() == TAB_CSV)) SPRINTF (buffer, ".csv"); strcat(cstr, buffer); ConvHist_file->open(cstr, ios::out); @@ -4518,10 +4512,8 @@ void COutput::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, un char end[]= ",\"Linear_Solver_Iterations\",\"CFL_Number\",\"Time(min)\"\n"; char endfea[]= ",\"Linear_Solver_Iterations\",\"Time(min)\"\n"; - if ((config->GetOutput_FileFormat() == TECPLOT) || - (config->GetOutput_FileFormat() == TECPLOT_BINARY) || - (config->GetOutput_FileFormat() == FIELDVIEW) || - (config->GetOutput_FileFormat() == FIELDVIEW_BINARY)) { + if ((config->GetTabular_FileFormat() == TECPLOT) || + (config->GetTabular_FileFormat() == TECPLOT_BINARY)) { ConvHist_file[0] << "TITLE = \"SU2 Simulation\"" << endl; ConvHist_file[0] << "VARIABLES = "; } @@ -4598,17 +4590,15 @@ void COutput::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, un } - if (config->GetOutput_FileFormat() == TECPLOT || - config->GetOutput_FileFormat() == TECPLOT_BINARY || - config->GetOutput_FileFormat() == FIELDVIEW || - config->GetOutput_FileFormat() == FIELDVIEW_BINARY) { + if (config->GetTabular_FileFormat() == TECPLOT || + config->GetTabular_FileFormat() == TECPLOT_BINARY) { ConvHist_file[0] << "ZONE T= \"Convergence history\"" << endl; } } -void COutput::SetConvHistory_Body(ofstream *ConvHist_file, +void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, CGeometry ****geometry, CSolver *****solver_container, CConfig **config, @@ -4622,8 +4612,8 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, bool output_comboObj = (config[val_iZone]->GetnObj() > 1); bool fluid_structure = (config[val_iZone]->GetFSI_Simulation()); bool fea = ((config[val_iZone]->GetKind_Solver()== FEM_ELASTICITY)||(config[val_iZone]->GetKind_Solver()== DISC_ADJ_FEM)); - unsigned long iIntIter = config[val_iZone]->GetIntIter(); - unsigned long iExtIter = config[val_iZone]->GetExtIter(); + unsigned long iIntIter = config[val_iZone]->GetInnerIter(); + unsigned long iExtIter = config[val_iZone]->GetInnerIter(); unsigned short FinestMesh = config[val_iZone]->GetFinestMesh(); unsigned short nZone = config[val_iZone]->GetnZone(); unsigned short nInst = config[val_iZone]->GetnTimeInstances(); @@ -4639,7 +4629,7 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, if (!disc_adj && !cont_adj && !DualTime_Iteration) { if ((config[val_iZone]->GetFixed_CL_Mode()) && - (config[val_iZone]->GetnExtIter()-config[val_iZone]->GetIter_dCL_dAlpha() - 1 < iExtIter)) { + (config[val_iZone]->GetnInner_Iter()-config[val_iZone]->GetIter_dCL_dAlpha() - 1 < iExtIter)) { output_files = false; } @@ -4649,10 +4639,10 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, /*--- We need to evaluate some of the objective functions to write the value on the history file ---*/ if (((iExtIter % (config[val_iZone]->GetWrt_Sol_Freq())) == 0) || - ((!config[val_iZone]->GetFixed_CL_Mode()) && (iExtIter == (config[val_iZone]->GetnExtIter()-1))) || + ((!config[val_iZone]->GetFixed_CL_Mode()) && (iExtIter == (config[val_iZone]->GetnInner_Iter()-1))) || /*--- If CL mode we need to compute the complete solution at two very particular iterations ---*/ - ((config[val_iZone]->GetFixed_CL_Mode()) && (iExtIter == (config[val_iZone]->GetnExtIter()-2))) || - ((config[val_iZone]->GetFixed_CL_Mode()) && (config[val_iZone]->GetnExtIter()-config[val_iZone]->GetIter_dCL_dAlpha() - 1 == iExtIter))) { + ((config[val_iZone]->GetFixed_CL_Mode()) && (iExtIter == (config[val_iZone]->GetnInner_Iter()-2))) || + ((config[val_iZone]->GetFixed_CL_Mode()) && (config[val_iZone]->GetnInner_Iter()-config[val_iZone]->GetIter_dCL_dAlpha() - 1 == iExtIter))) { if ((rank == MASTER_NODE) && output_files) cout << endl << "------------------------ Evaluate Special Output ------------------------"; @@ -4694,7 +4684,7 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, /*--- Output a file with the forces breakdown. ---*/ - if (config[val_iZone]->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config[val_iZone]->GetTime_Marching() == HARMONIC_BALANCE) { SpecialOutput_HarmonicBalance(solver_container, geometry, config, val_iInst, nInst, output_files); } @@ -4731,8 +4721,8 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, } unsigned long ExtIter_OffSet = config[val_iZone]->GetExtIter_OffSet(); - if (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST || - config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST || + config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND) ExtIter_OffSet = 0; /*--- WARNING: These buffers have hard-coded lengths. Note that you @@ -5244,8 +5234,8 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, /*--- Header frequency ---*/ - bool Unsteady = ((config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config[val_iZone]->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool Unsteady = ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)); bool In_NoDualTime = (!DualTime_Iteration && (iExtIter % config[val_iZone]->GetWrt_Con_Freq() == 0)); bool In_DualTime_0 = (DualTime_Iteration && (iIntIter % config[val_iZone]->GetWrt_Con_Freq_DualTime() == 0)); bool In_DualTime_1 = (!DualTime_Iteration && Unsteady); @@ -5257,7 +5247,7 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, /*--- We maintain the name, as it is an input of the function ---*/ /*--- The function GetWrt_Con_Freq_DualTime should be modified to be able to define different frequencies ---*/ /*--- dynamic determines if the problem is, or not, time dependent ---*/ - bool dynamic = (config[val_iZone]->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool dynamic = (config[val_iZone]->GetTime_Domain()); // Dynamic simulations. bool In_NoDynamic = (!DualTime_Iteration && (iExtIter % config[val_iZone]->GetWrt_Con_Freq() == 0)); bool In_Dynamic_0 = (DualTime_Iteration && (iIntIter % config[val_iZone]->GetWrt_Con_Freq_DualTime() == 0)); bool In_Dynamic_1 = (!DualTime_Iteration && nonlinear_analysis); @@ -5268,7 +5258,7 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, if (Unsteady) write_heads = (iIntIter == 0); else write_heads = (((iExtIter % (config[val_iZone]->GetWrt_Con_Freq()*40)) == 0)); - bool write_turbo = (((iExtIter % (config[val_iZone]->GetWrt_Con_Freq()*40)) == 0) || (iExtIter == (config[val_iZone]->GetnExtIter() -1))); + bool write_turbo = (((iExtIter % (config[val_iZone]->GetWrt_Con_Freq()*40)) == 0) || (iExtIter == (config[val_iZone]->GetnInner_Iter() -1))); /*--- Analogous for dynamic problems (as of now I separate the problems, it may be worthy to do all together later on ---*/ bool write_heads_FEM; @@ -5557,7 +5547,7 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, ) { if (!fem) { - if (!Unsteady && (config[val_iZone]->GetUnsteady_Simulation() != TIME_STEPPING)) { + if (!Unsteady && (config[val_iZone]->GetTime_Marching() != TIME_STEPPING)) { switch (config[val_iZone]->GetKind_Solver()) { case EULER : case NAVIER_STOKES: case RANS: case INC_EULER : case INC_NAVIER_STOKES: case INC_RANS: @@ -5643,10 +5633,10 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, } else { if (flow) { - if ((config[val_iZone]->GetUnsteady_Simulation() == TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()== 0.0)) + if ((config[val_iZone]->GetTime_Marching() == TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()== 0.0)) { cout << endl << "Min DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMin_Delta_Time()<< ".Max DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMax_Delta_Time() << ".Time step: " << config[val_iZone]->GetDelta_UnstTimeND() << "."; - } else if ((config[val_iZone]->GetUnsteady_Simulation() == TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()!= 0.0)) { + } else if ((config[val_iZone]->GetTime_Marching() == TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()!= 0.0)) { cout << endl << "Min DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMin_Delta_Time()<< ".Max DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMax_Delta_Time() << ". Time step: " << solver_container[val_iZone][val_iInst][config[val_iZone]->GetFinestMesh()][FLOW_SOL]->GetMin_Delta_Time() << ". CFL: " << config[val_iZone]->GetUnst_CFL()<<"."; } else { cout << endl << "Min DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMin_Delta_Time()<< ".Max DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMax_Delta_Time() << ".Dual Time step: " << config[val_iZone]->GetDelta_UnstTimeND() << "."; @@ -6378,8 +6368,7 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, delete [] residual_adjflow; delete [] residual_adjturbulent; - delete [] residual_adjheat; - + delete [] Surface_CL; delete [] Surface_CD; delete [] Surface_CSF; @@ -6396,13 +6385,13 @@ void COutput::SetConvHistory_Body(ofstream *ConvHist_file, } } -void COutput::SetCFL_Number(CSolver *****solver_container, CConfig **config, unsigned short val_iZone) { +void COutputLegacy::SetCFL_Number(CSolver *****solver_container, CConfig **config, unsigned short val_iZone) { su2double CFLFactor = 1.0, power = 1.0, CFL = 0.0, CFLMin = 0.0, CFLMax = 0.0, Div = 1.0, Diff = 0.0, MGFactor[100]; unsigned short iMesh; unsigned short FinestMesh = config[val_iZone]->GetFinestMesh(); - unsigned long ExtIter = config[val_iZone]->GetExtIter(); + unsigned long ExtIter = config[val_iZone]->GetInnerIter(); unsigned short nVar = 1; bool energy = config[val_iZone]->GetEnergy_Equation(); @@ -6492,7 +6481,7 @@ void COutput::SetCFL_Number(CSolver *****solver_container, CConfig **config, uns } -void COutput::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short val_iZone, bool output) { +void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short val_iZone, bool output) { char cstr[200]; unsigned short iDim, iMarker_Monitoring; @@ -6500,7 +6489,7 @@ void COutput::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****g bool compressible = (config[val_iZone]->GetKind_Regime() == COMPRESSIBLE); bool incompressible = (config[val_iZone]->GetKind_Regime() == INCOMPRESSIBLE); - bool unsteady = (config[val_iZone]->GetUnsteady_Simulation() != NO); + bool unsteady = (config[val_iZone]->GetTime_Marching() != NO); bool viscous = config[val_iZone]->GetViscous(); bool dynamic_grid = config[val_iZone]->GetDynamic_Grid(); bool gravity = config[val_iZone]->GetGravityForce(); @@ -6845,7 +6834,7 @@ void COutput::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****g Breakdown_file << "\n" <<"-------------------------------------------------------------------------" << "\n"; Breakdown_file <<"| ___ _ _ ___ |" << "\n"; - Breakdown_file <<"| / __| | | |_ ) Release 6.2.0 \"Falcon\" |" << "\n"; + Breakdown_file <<"| / __| | | |_ ) Release 6.1.0 \"Falcon\" |" << "\n"; Breakdown_file <<"| \\__ \\ |_| |/ / |" << "\n"; Breakdown_file <<"| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << "\n"; Breakdown_file << "| |" << "\n"; @@ -6865,7 +6854,7 @@ void COutput::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****g Breakdown_file << "| - Prof. Edwin van der Weide's group at the University of Twente. |" << "\n"; Breakdown_file << "| - Lab. of New Concepts in Aeronautics at Tech. Inst. of Aeronautics. |" << "\n"; Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; - Breakdown_file << "| Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, |" << "\n"; + Breakdown_file << "| Copyright 2012-2018, Francisco D. Palacios, Thomas D. Economon, |" << "\n"; Breakdown_file << "| Tim Albring, and the SU2 contributors. |" << "\n"; Breakdown_file << "| |" << "\n"; Breakdown_file << "| SU2 is free software; you can redistribute it and/or |" << "\n"; @@ -8327,7 +8316,7 @@ void COutput::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****g } -void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geometry, CConfig **config, +void COutputLegacy::SetResult_Files(CSolver *****solver_container, CGeometry ****geometry, CConfig **config, unsigned long iExtIter, unsigned short val_nZone) { unsigned short iZone; @@ -8372,7 +8361,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome /*--- Get the file output format ---*/ - unsigned short FileFormat = config[iZone]->GetOutput_FileFormat(); + unsigned short FileFormat = config[iZone]->GetTabular_FileFormat(); /*--- Merge the node coordinates and connectivity, if necessary. This is only performed if a volume solution file is requested, and it @@ -8393,8 +8382,8 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome if ((rank == MASTER_NODE) && (Wrt_Vol || Wrt_Srf)) { if (FileFormat == TECPLOT_BINARY) { if (rank == MASTER_NODE) cout << "Writing Tecplot binary volume and surface mesh files." << endl; - SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); - SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); +// SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); +// SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); if (!wrote_base_file) DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], false); if (!wrote_surf_file) @@ -8427,42 +8416,27 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file volume solution file." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][INST_0][MESH_0], solver_container[iZone][INST_0][MESH_0], iZone, val_nZone, false); +// SetTecplotASCII(config[iZone], geometry[iZone][INST_0][MESH_0], solver_container[iZone][INST_0][MESH_0], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], false); break; - case FIELDVIEW: - - /*--- Write a FieldView ASCII file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView ASCII file volume solution file." << endl; - SetFieldViewASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone); - DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], false); - break; + case TECPLOT_BINARY: /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot binary volume solution file." << endl; - SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); - break; - - case FIELDVIEW_BINARY: - - /*--- Write a FieldView binary file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView binary file volume solution file." << endl; - SetFieldViewBinary(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone); - DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], false); +// SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); break; + case PARAVIEW: /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII volume solution file." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], false); break; @@ -8472,7 +8446,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome if (rank == MASTER_NODE) cout << "ParaView binary volume files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII volume solution file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], false); break; @@ -8491,7 +8465,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII surface solution file." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][INST_0][MESH_0], solver_container[iZone][INST_0][MESH_0] , iZone, val_nZone, true); +// SetTecplotASCII(config[iZone], geometry[iZone][INST_0][MESH_0], solver_container[iZone][INST_0][MESH_0] , iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], true); break; @@ -8500,7 +8474,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot binary surface solution file." << endl; - SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); +// SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][INST_0][MESH_0], iZone); break; case PARAVIEW: @@ -8508,7 +8482,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII surface solution file." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], true); break; @@ -8518,7 +8492,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome if (rank == MASTER_NODE) cout << "ParaView binary surface files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII surface solution file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][INST_0][MESH_0], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][INST_0][MESH_0], true); break; @@ -8546,7 +8520,7 @@ void COutput::SetResult_Files(CSolver *****solver_container, CGeometry ****geome } } -void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, CConfig **config, +void COutputLegacy::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, CConfig **config, unsigned long iExtIter, unsigned short val_nZone) { unsigned short iZone, iInst, nInst; @@ -8567,7 +8541,7 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, /*--- Get the file output format ---*/ - unsigned short FileFormat = config[iZone]->GetOutput_FileFormat(); + unsigned short FileFormat = config[iZone]->GetTabular_FileFormat(); /*--- Merge the node coordinates and connectivity if necessary. This is only performed if a volume solution file is requested, and it @@ -8601,16 +8575,7 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file (volume grid)." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, false); - DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); - break; - - case FIELDVIEW: - - /*--- Write a FieldView ASCII file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView ASCII file (volume grid)." << endl; - SetFieldViewASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone); +// SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); break; @@ -8619,25 +8584,17 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot Binary file (volume grid)." << endl; - SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][iInst], iZone); - SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][iInst], iZone); break; - case FIELDVIEW_BINARY: - - /*--- Write a binary binary file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView ASCII file (volume grid)." << endl; - SetFieldViewBinary(config[iZone], geometry[iZone][iInst], iZone, val_nZone); - DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); - break; case PARAVIEW: /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII file (volume grid)." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); break; @@ -8647,7 +8604,7 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, if (rank == MASTER_NODE) cout << "ParaView binary volume files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII volume solution file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); break; @@ -8666,7 +8623,7 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file (surface grid)." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, true); +// SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], true); break; @@ -8675,8 +8632,8 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot Binary file (surface grid)." << endl; - SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][iInst], iZone); - SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][iInst], iZone); break; case PARAVIEW: @@ -8684,7 +8641,7 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII file (surface grid)." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], true); break; @@ -8694,20 +8651,15 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, if (rank == MASTER_NODE) cout << "ParaView binary surface files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII surface solution file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], true); break; default: break; } - } - - if (config[iZone]->GetWrt_Projected_Sensitivity()) { - WriteProjectedSensitivity(config[iZone], geometry[iZone][iInst], iZone, val_nZone); - } - + if (FileFormat == TECPLOT_BINARY) { if (!wrote_base_file) DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); @@ -8733,7 +8685,7 @@ void COutput::SetBaselineResult_Files(CSolver ***solver, CGeometry ***geometry, } } -void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned short val_nZone, bool new_file, bool su2_file) { +void COutputLegacy::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned short val_nZone, bool new_file, bool su2_file) { char cstr[MAX_STRING_SIZE], out_file[MAX_STRING_SIZE]; unsigned short iZone; @@ -8761,7 +8713,7 @@ void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned sho bool Wrt_Vol = config[iZone]->GetVisualize_Volume_Def(); bool Wrt_Srf = config[iZone]->GetVisualize_Surface_Def(); - bool Wrt_Crd = config[iZone]->GetWrt_Crd_Sol(); + //bool Wrt_Crd = config[iZone]->GetWrt_Crd_Sol(); /*--- Merge the node coordinates and connectivity if necessary. This is only performed if a volume solution file is requested, and it @@ -8787,18 +8739,18 @@ void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned sho if (rank == MASTER_NODE) cout <<"Writing volume mesh file." << endl; - /*--- Write a Tecplot ASCII file ---*/ +// /*--- Write a Tecplot ASCII file ---*/ - if (config[iZone]->GetOutput_FileFormat() == PARAVIEW) SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, false, new_file); - else if (config[iZone]->GetOutput_FileFormat() == PARAVIEW_BINARY) { - if (rank == MASTER_NODE) cout <<"Writing ASCII paraview volume mesh file by default." << endl; - SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, false, new_file); - } - else if (config[iZone]->GetOutput_FileFormat() == TECPLOT) SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, false, new_file); - else if (config[iZone]->GetOutput_FileFormat() == TECPLOT_BINARY) { - if (rank == MASTER_NODE) cout <<"Writing ASCII tecplot volume mesh file by default." << endl; - SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, false, new_file); - } +//// if (config[iZone]->GetOutput_FileFormat() == PARAVIEW) SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, false, new_file); +// else if (config[iZone]->GetTabular_FileFormat() == PARAVIEW_BINARY) { +// if (rank == MASTER_NODE) cout <<"Writing ASCII paraview volume mesh file by default." << endl; +//// SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, false, new_file); +// } +//// else if (config[iZone]->GetOutput_FileFormat() == TECPLOT) SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, false, new_file); +// else if (config[iZone]->GetTabular_FileFormat() == TECPLOT_BINARY) { +// if (rank == MASTER_NODE) cout <<"Writing ASCII tecplot volume mesh file by default." << endl; +//// SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, false, new_file); +// } } @@ -8808,16 +8760,16 @@ void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned sho /*--- Write a Tecplot ASCII file ---*/ - if (config[iZone]->GetOutput_FileFormat() == PARAVIEW) SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, true, new_file); - else if (config[iZone]->GetOutput_FileFormat() == PARAVIEW_BINARY) { - if (rank == MASTER_NODE) cout <<"Writing ASCII paraview surface mesh file by default." << endl; - SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, true, new_file); - } - else if (config[iZone]->GetOutput_FileFormat() == TECPLOT) SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, true, new_file); - else if (config[iZone]->GetOutput_FileFormat() == TECPLOT_BINARY) { - if (rank == MASTER_NODE) cout <<"Writing ASCII tecplot surface mesh file by default." << endl; - SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, true, new_file); - } +// if (config[iZone]->GetOutput_FileFormat() == PARAVIEW) SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, true, new_file); +// else if (config[iZone]->GetOutput_FileFormat() == PARAVIEW_BINARY) { +// if (rank == MASTER_NODE) cout <<"Writing ASCII paraview surface mesh file by default." << endl; +// SetParaview_MeshASCII(config[iZone], geometry[iZone], iZone, val_nZone, true, new_file); +// } +// else if (config[iZone]->GetOutput_FileFormat() == TECPLOT) SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, true, new_file); +// else if (config[iZone]->GetOutput_FileFormat() == TECPLOT_BINARY) { +// if (rank == MASTER_NODE) cout <<"Writing ASCII tecplot surface mesh file by default." << endl; +// SetTecplotASCII_Mesh(config[iZone], geometry[iZone], iZone, true, new_file); +// } } @@ -8827,22 +8779,22 @@ void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned sho if (rank == MASTER_NODE) cout <<"Writing .su2 file." << endl; - SetSU2_MeshASCII(config[iZone], geometry[iZone], iZone, output_file); +// SetSU2_MeshASCII(config[iZone], geometry[iZone], iZone, output_file); /*--- Write an stl surface file ---*/ if (rank == MASTER_NODE) cout <<"Writing .stl surface file." << endl; - SetSTL_MeshASCII(config[iZone], geometry[iZone]); +// SetSTL_MeshASCII(config[iZone], geometry[iZone]); } /*--- Write a binary file with the grid coordinates alone. ---*/ - if (Wrt_Crd) { - if (rank == MASTER_NODE) cout <<"Writing .dat binary coordinates file." << endl; - WriteCoordinates_Binary(config[iZone], geometry[iZone], iZone); - } +// if (Wrt_Crd) { +// if (rank == MASTER_NODE) cout <<"Writing .dat binary coordinates file." << endl; +// WriteCoordinates_Binary(config[iZone], geometry[iZone], iZone); +// } /*--- Deallocate connectivity ---*/ @@ -8864,7 +8816,7 @@ void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned sho if (rank == MASTER_NODE) cout <<"Writing .csv surface file." << endl; - if (su2_file) SetCSV_MeshASCII(config[iZone], geometry[iZone]); +// if (su2_file) SetCSV_MeshASCII(config[iZone], geometry[iZone]); } @@ -8875,7 +8827,7 @@ void COutput::SetMesh_Files(CGeometry **geometry, CConfig **config, unsigned sho } } -void COutput::SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { +void COutputLegacy::SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { short iSection, nSection; unsigned long iVertex, iPoint, Trailing_Point; @@ -9247,7 +9199,7 @@ void COutput::SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConf ofstream Load_File; if (iSection == 0) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { + if ((config->GetTabular_FileFormat() == TAB_CSV)) { Load_File.open("load_distribution.csv", ios::out); Load_File << "\"Percent Semispan\",\"Sectional C_L\",\"Spanload (c C_L / c_ref) \",\"Elliptic Spanload\"" << endl; } @@ -9258,14 +9210,14 @@ void COutput::SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConf Load_File << "ZONE T=\"Wing load distribution\"" << endl; } } else { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) Load_File.open("load_distribution.csv", ios::app); + if ((config->GetTabular_FileFormat() == TAB_CSV)) Load_File.open("load_distribution.csv", ios::app); else Load_File.open("load_distribution.dat", ios::app); } /*--- CL and spanload ---*/ - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) + if ((config->GetTabular_FileFormat() == TAB_CSV)) Load_File << 100.0*Ycoord_Airfoil[0]/(0.5*B) << ", " << CL_Inv << ", " << Chord*CL_Inv / RefLength <<", " << Elliptic_Spanload << endl; else Load_File << 100.0*Ycoord_Airfoil[0]/(0.5*B) << " " << CL_Inv << " " << Chord*CL_Inv / RefLength <<" " << Elliptic_Spanload << endl; @@ -9291,7 +9243,7 @@ void COutput::SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConf } -void COutput::SetCp_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, unsigned long iExtIter) { +void COutputLegacy::SetCp_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, unsigned long iExtIter) { unsigned short iMarker, icommas, Boundary, iDim; unsigned long iVertex, iPoint, (*Point2Vertex)[2], nPointLocal = 0, nPointGlobal = 0; @@ -9350,8 +9302,8 @@ void COutput::SetCp_InverseDesign(CSolver *solver_container, CGeometry *geometry /*--- Write file name with extension if unsteady or steady ---*/ - if ((config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) || - (config->GetUnsteady_Simulation() == HARMONIC_BALANCE)) { + if ((config->GetTime_Marching() && config->GetTime_Domain()) || + (config->GetTime_Marching() == HARMONIC_BALANCE)) { if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(iExtIter)); @@ -9442,7 +9394,7 @@ void COutput::SetCp_InverseDesign(CSolver *solver_container, CGeometry *geometry } -void COutput::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, unsigned long iExtIter) { +void COutputLegacy::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, unsigned long iExtIter) { unsigned short iMarker, icommas, Boundary, iDim; unsigned long iVertex, iPoint, (*Point2Vertex)[2], nPointLocal = 0, nPointGlobal = 0; @@ -9501,8 +9453,8 @@ void COutput::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeometry *ge /*--- Write file name with extension if unsteady or steady ---*/ - if ((config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) || - (config->GetUnsteady_Simulation() == HARMONIC_BALANCE)) { + if ((config->GetTime_Marching() && config->GetTime_Domain()) || + (config->GetTime_Marching() == HARMONIC_BALANCE)) { if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(iExtIter)); @@ -9593,7 +9545,7 @@ void COutput::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeometry *ge } -void COutput::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { +void COutputLegacy::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { ofstream EquivArea_file, FuncGrad_file; unsigned short iMarker = 0, iDim; @@ -10221,7 +10173,7 @@ void COutput::SpecialOutput_SonicBoom(CSolver *solver, CGeometry *geometry, CCon } -void COutput::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { +void COutputLegacy::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { unsigned short iMarker, iDim, iMarker_Analyze; unsigned long iPoint, iVertex; @@ -10262,14 +10214,14 @@ void COutput::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CCo if (output && (rank == MASTER_NODE)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) strcpy (cstr, "surface_analysis.vtk"); + if ((config->GetTabular_FileFormat() == TAB_CSV)) strcpy (cstr, "surface_analysis.vtk"); else strcpy (cstr, "surface_analysis.dat"); SurfFlow_file.precision(15); SurfFlow_file.open(cstr, ios::out); - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { + if ((config->GetTabular_FileFormat() == TAB_CSV)) { SurfFlow_file << "# vtk DataFile Version 3.0" << endl; SurfFlow_file << "vtk output" << endl; SurfFlow_file << "ASCII" << endl; @@ -11087,7 +11039,7 @@ void COutput::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CCo if (output) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || (config->GetOutput_FileFormat() == PARAVIEW_BINARY)) { + if (config->GetTabular_FileFormat() == TAB_CSV) { SurfFlow_file << "\nDATASET UNSTRUCTURED_GRID" << endl; SurfFlow_file <<"POINTS " << nAngle*nStation << " float" << endl; @@ -11324,7 +11276,7 @@ void COutput::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CCo } -void COutput::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, CSolver *****solver_container, +void COutputLegacy::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, CSolver *****solver_container, CConfig **config, CIntegration ****integration, unsigned long iExtIter, unsigned short ZONE_FLOW, unsigned short ZONE_STRUCT, bool header) { @@ -11346,11 +11298,11 @@ void COutput::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, unsigned short direct_diff = config[ZONE_FLOW]->GetDirectDiff(); /*--- Write file name with extension ---*/ - string filename = config[ZONE_FLOW]->GetConv_FileName_FSI(); - strcpy (cstr, filename.data()); +// string filename = config[ZONE_FLOW]->GetConv_FileName_FSI(); +// strcpy (cstr, filename.data()); - if (config[ZONE_FLOW]->GetWrt_Unsteady() && config[ZONE_FLOW]->GetRestart()) { - long iExtIter = config[ZONE_FLOW]->GetUnst_RestartIter(); + if (config[ZONE_FLOW]->GetTime_Domain() && config[ZONE_FLOW]->GetRestart()) { + long iExtIter = config[ZONE_FLOW]->GetRestart_Iter(); if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d", SU2_TYPE::Int(iExtIter)); if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d", SU2_TYPE::Int(iExtIter)); @@ -11359,11 +11311,8 @@ void COutput::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, strcat(cstr, buffer); } - if ((config[ZONE_FLOW]->GetOutput_FileFormat() == TECPLOT) || - (config[ZONE_FLOW]->GetOutput_FileFormat() == FIELDVIEW)) SPRINTF (buffer, ".dat"); - else if ((config[ZONE_FLOW]->GetOutput_FileFormat() == TECPLOT_BINARY) || - (config[ZONE_FLOW]->GetOutput_FileFormat() == FIELDVIEW_BINARY)) SPRINTF (buffer, ".plt"); - else if ((config[ZONE_FLOW]->GetOutput_FileFormat() == PARAVIEW) || (config[ZONE_FLOW]->GetOutput_FileFormat() == PARAVIEW_BINARY)) SPRINTF (buffer, ".vtk"); + if ((config[ZONE_FLOW]->GetTabular_FileFormat() == TAB_TECPLOT)) SPRINTF (buffer, ".dat"); + else if ((config[ZONE_FLOW]->GetTabular_FileFormat() == TAB_CSV)) SPRINTF (buffer, ".vtk"); strcat(cstr, buffer); FSIHist_file->open(cstr, ios::out); @@ -11394,10 +11343,8 @@ void COutput::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, char end[]= ",\"Time(min)\"\n"; - if ((config[ZONE_FLOW]->GetOutput_FileFormat() == TECPLOT) || - (config[ZONE_FLOW]->GetOutput_FileFormat() == TECPLOT_BINARY) || - (config[ZONE_FLOW]->GetOutput_FileFormat() == FIELDVIEW) || - (config[ZONE_FLOW]->GetOutput_FileFormat() == FIELDVIEW_BINARY)) { + if ((config[ZONE_FLOW]->GetTabular_FileFormat() == TECPLOT) || + (config[ZONE_FLOW]->GetTabular_FileFormat() == TECPLOT_BINARY)) { FSIHist_file[0] << "TITLE = \"SU2 FSI Simulation\"" << endl; FSIHist_file[0] << "VARIABLES = "; } @@ -11490,7 +11437,7 @@ void COutput::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, unsigned short nDim = geometry[ZONE_STRUCT][INST_0][MESH_0]->GetnDim(); - unsigned long iExtIter = config[ZONE_STRUCT]->GetExtIter(); + unsigned long iExtIter = config[ZONE_STRUCT]->GetInnerIter(); unsigned long ExtIter_OffSet = config[ZONE_STRUCT]->GetExtIter_OffSet(); unsigned long iOuterIter = config[ZONE_STRUCT]->GetOuterIter(); su2double dummy = 0.0; @@ -11636,7 +11583,7 @@ void COutput::SpecialOutput_FSI(ofstream *FSIHist_file, CGeometry ****geometry, } -void COutput::SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned short val_nZone) { +void COutputLegacy::SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned short val_nZone) { unsigned short iMarker,iDim, nDim, iVar, nMarker, nVar; unsigned long iVertex, iPoint, nPoint, nVertex; @@ -11737,7 +11684,7 @@ void COutput::SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsi delete [] solver; } -void COutput::WriteTurboPerfConvHistory(CConfig *config){ +void COutputLegacy::WriteTurboPerfConvHistory(CConfig *config){ unsigned short iMarker_Monitoring; string inMarker_Tag, outMarker_Tag, inMarkerTag_Mix; @@ -11985,7 +11932,7 @@ void COutput::WriteTurboPerfConvHistory(CConfig *config){ } -void COutput::SpecialOutput_Turbo(CSolver *****solver, CGeometry ****geometry, CConfig **config, +void COutputLegacy::SpecialOutput_Turbo(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short val_iZone, bool output) { string inMarker_Tag, outMarker_Tag, inMarkerTag_Mix; @@ -11993,7 +11940,7 @@ void COutput::SpecialOutput_Turbo(CSolver *****solver, CGeometry ****geometry, C unsigned short iDim, iSpan; - unsigned long iExtIter = config[val_iZone]->GetExtIter(); + unsigned long iExtIter = config[val_iZone]->GetInnerIter(); su2double* SpanWiseValuesIn, *SpanWiseValuesOut; ofstream myfile; string spanwise_performance_filename; @@ -12238,7 +12185,7 @@ void COutput::SpecialOutput_Turbo(CSolver *****solver, CGeometry ****geometry, C } } -void COutput::SpecialOutput_HarmonicBalance(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iInst, unsigned short val_nInst, bool output) { +void COutputLegacy::SpecialOutput_HarmonicBalance(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iInst, unsigned short val_nInst, bool output) { /*--- Write file with flow quantities for harmonic balance HB ---*/ ofstream HB_output_file; @@ -12250,7 +12197,7 @@ void COutput::SpecialOutput_HarmonicBalance(CSolver *****solver, CGeometry ****g /*--- Other variables ---*/ unsigned short iVar, kInst; unsigned short nVar_output = 5; - unsigned long current_iter = config[ZONE_0]->GetExtIter(); + unsigned long current_iter = config[ZONE_0]->GetInnerIter(); /*--- Allocate memory for send buffer ---*/ sbuf_var = new su2double[nVar_output]; @@ -12329,7 +12276,7 @@ void COutput::SpecialOutput_HarmonicBalance(CSolver *****solver, CGeometry ****g delete [] averages; } -void COutput::SetSpecial_Output(CSolver *****solver_container, +void COutputLegacy::SetSpecial_Output(CSolver *****solver_container, CGeometry ****geometry, CConfig **config, unsigned long iExtIter, @@ -12350,7 +12297,7 @@ void COutput::SetSpecial_Output(CSolver *****solver_container, } -void COutput::SetResult_Files_Parallel(CSolver *****solver_container, +void COutputLegacy::SetResult_Files_Parallel(CSolver *****solver_container, CGeometry ****geometry, CConfig **config, unsigned long iExtIter, @@ -12372,7 +12319,7 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Get the file output format ---*/ - unsigned short FileFormat = config[iZone]->GetOutput_FileFormat(); + unsigned short FileFormat = config[iZone]->GetTabular_FileFormat(); nInst = config[iZone]->GetnTimeInstances(); for (iInst = 0; iInst < nInst; iInst++){ @@ -12392,11 +12339,11 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, #ifdef HAVE_MPI /*--- Do not merge the connectivity or write the visualization files - if we are running in parallel, unless we are using ParaView or Tecplot binary. + if we are running in parallel, unless we are using ParaView binary. Force the use of SU2_SOL to merge and write the viz. files in this case to save overhead. ---*/ - if ((size > SINGLE_NODE) && (FileFormat != PARAVIEW_BINARY) && (FileFormat != TECPLOT_BINARY)) { + if ((size > SINGLE_NODE) && (FileFormat != PARAVIEW_BINARY)) { Wrt_Vol = false; Wrt_Srf = false; } @@ -12476,7 +12423,7 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Store the solution to be used on the final iteration with cte. lift mode. ---*/ if ((!cont_adj) && (!disc_adj) && (config[iZone]->GetFixed_CL_Mode()) && - (config[iZone]->GetnExtIter()-config[iZone]->GetIter_dCL_dAlpha() -1 == iExtIter)) { + (config[iZone]->GetnInner_Iter()-config[iZone]->GetIter_dCL_dAlpha() -1 == iExtIter)) { if (rank == MASTER_NODE) cout << "Storing solution output data locally on each rank (cte. CL mode)." << endl; @@ -12497,7 +12444,7 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Recover the solution to be used on the final iteration with cte. lift mode. ---*/ if ((!cont_adj) && (!disc_adj) && (config[iZone]->GetFixed_CL_Mode()) && - (config[iZone]->GetnExtIter() - 1 == iExtIter) && (Local_Data_Copy != NULL)) { + (config[iZone]->GetnInner_Iter() - 1 == iExtIter) && (Local_Data_Copy != NULL)) { if (rank == MASTER_NODE) cout << "Recovering solution output data locally on each rank (cte. CL mode)." << endl; @@ -12557,10 +12504,8 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, if (fem_solver) SortConnectivity_FEM(config[iZone], geometry[iZone][iInst][MESH_0], iZone); - else if (FileFormat == TECPLOT_BINARY) - SortConnectivity(config[iZone], geometry[iZone][iInst][MESH_0], iZone, false); else - SortConnectivity(config[iZone], geometry[iZone][iInst][MESH_0], iZone, true); + SortConnectivity(config[iZone], geometry[iZone][iInst][MESH_0], iZone); /*--- Sort the surface data and renumber if for writing. ---*/ if (Wrt_Srf){ @@ -12580,43 +12525,32 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file volume solution file." << endl; - WriteTecplotASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, false); +// WriteTecplotASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, false); break; - case FIELDVIEW: - - /*--- We do not yet have a version of FieldView ASCII for new parallel output. ---*/ - - if (rank == MASTER_NODE) cout << "FieldView ASCII volume files not available in serial with SU2_CFD." << endl; - if (rank == MASTER_NODE) cout << " Run SU2_SOL to generate FieldView ASCII." << endl; - - break; + case TECPLOT_BINARY: /*--- Write a Tecplot ASCII file instead for now in serial. ---*/ - if (rank == MASTER_NODE) cout << "Writing Tecplot binary volume solution file." << endl; - WriteTecplotBinary_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - iZone, val_nZone, false); + if (rank == MASTER_NODE) cout << "Tecplot binary volume files not available in serial with SU2_CFD." << endl; + if (rank == MASTER_NODE) cout << " Run SU2_SOL to generate Tecplot binary." << endl; + if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file volume solution file instead." << endl; +// WriteTecplotASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, false); break; - case FIELDVIEW_BINARY: - - /*--- FieldView binary files not yet available for parallel output. ---*/ - - if (rank == MASTER_NODE) cout << "FieldView ASCII volume files not available in serial with SU2_CFD." << endl; - if (rank == MASTER_NODE) cout << " Run SU2_SOL to generate FieldView ASCII." << endl; - break; + case PARAVIEW: /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII volume solution file." << endl; - WriteParaViewASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, false); +// WriteParaViewASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, false); break; case PARAVIEW_BINARY: @@ -12624,8 +12558,8 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Write a Paraview binary file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview binary volume solution file." << endl; - WriteParaViewBinary_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - solver_container[iZone][iInst][MESH_0], iZone, val_nZone, false); +// WriteParaViewBinary_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, false); break; default: @@ -12643,17 +12577,19 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file surface solution file." << endl; - WriteTecplotASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, true); +// WriteTecplotASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, true); break; case TECPLOT_BINARY: - /*--- Write a Tecplot binary file ---*/ + /*--- Write a Tecplot ASCII file instead for now in serial. ---*/ - if (rank == MASTER_NODE) cout << "Writing Tecplot binary surface solution file." << endl; - WriteTecplotBinary_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - iZone, val_nZone, true); + if (rank == MASTER_NODE) cout << "Tecplot binary surface files not available in serial with SU2_CFD." << endl; + if (rank == MASTER_NODE) cout << " Run SU2_SOL to generate Tecplot binary." << endl; + if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file surface solution file instead." << endl; +// WriteTecplotASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, true); break; case PARAVIEW: @@ -12661,8 +12597,8 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII surface solution file." << endl; - WriteParaViewASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, true); +// WriteParaViewASCII_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, iInst, nInst, true); break; case PARAVIEW_BINARY: @@ -12670,8 +12606,8 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, /*--- Write a Paraview binary file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview binary surface solution file." << endl; - WriteParaViewBinary_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], - solver_container[iZone][iInst][MESH_0], iZone, val_nZone, true); +// WriteParaViewBinary_Parallel(config[iZone], geometry[iZone][iInst][MESH_0], +// solver_container[iZone][iInst][MESH_0], iZone, val_nZone, true); break; @@ -12704,7 +12640,7 @@ void COutput::SetResult_Files_Parallel(CSolver *****solver_container, } } -void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short iDim; unsigned short Kind_Solver = config->GetKind_Solver(); @@ -12803,209 +12739,203 @@ void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver * /*--- If requested, register the limiter and residuals for all of the equations in the current flow problem. ---*/ - if (!config->GetLow_MemoryOutput()) { - - /*--- Add the limiters ---*/ - - if (config->GetWrt_Limiters()) { - nVar_Par += nVar_Consv_Par; - - Variable_Names.push_back("Limiter_Density"); - Variable_Names.push_back("Limiter_Momentum_x"); - Variable_Names.push_back("Limiter_Momentum_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Limiter_Momentum_z"); - Variable_Names.push_back("Limiter_Energy"); - - if (SecondIndex != NONE) { - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { - Variable_Names.push_back("Limiter_TKE"); - Variable_Names.push_back("Limiter_Omega"); - } else { - /*--- S-A variants ---*/ - Variable_Names.push_back("Limiter_Nu_Tilde"); - } - } - } + /*--- Add the limiters ---*/ + + if (config->GetWrt_Limiters()) { + nVar_Par += nVar_Consv_Par; - /*--- Add the residuals ---*/ + Variable_Names.push_back("Limiter_Density"); + Variable_Names.push_back("Limiter_Momentum_x"); + Variable_Names.push_back("Limiter_Momentum_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Limiter_Momentum_z"); + Variable_Names.push_back("Limiter_Energy"); - if (config->GetWrt_Residuals()) { - nVar_Par += nVar_Consv_Par; - - Variable_Names.push_back("Residual_Density"); - Variable_Names.push_back("Residual_Momentum_x"); - Variable_Names.push_back("Residual_Momentum_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Residual_Momentum_z"); - Variable_Names.push_back("Residual_Energy"); - - if (SecondIndex != NONE) { - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { - Variable_Names.push_back("Residual_TKE"); - Variable_Names.push_back("Residual_Omega"); - } else { - /*--- S-A variants ---*/ - Variable_Names.push_back("Residual_Nu_Tilde"); - } + if (SecondIndex != NONE) { + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { + Variable_Names.push_back("Limiter_TKE"); + Variable_Names.push_back("Limiter_Omega"); + } else { + /*--- S-A variants ---*/ + Variable_Names.push_back("Limiter_Nu_Tilde"); } } + } + + /*--- Add the residuals ---*/ + + if (config->GetWrt_Residuals()) { + nVar_Par += nVar_Consv_Par; - /*--- Add the grid velocity. ---*/ - - if (dynamic_grid) { - if (geometry->GetnDim() == 2) nVar_Par += 2; - else if (geometry->GetnDim() == 3) nVar_Par += 3; - - Variable_Names.push_back("Grid_Velocity_x"); - Variable_Names.push_back("Grid_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Grid_Velocity_z"); - } - - - /*--- Add Pressure, Temperature, Cp, Mach. ---*/ - - nVar_Par += 1; - Variable_Names.push_back("Pressure"); - - nVar_Par += 2; - Variable_Names.push_back("Temperature"); - Variable_Names.push_back("Mach"); - - nVar_Par += 1; - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - Variable_Names.push_back("Pressure_Coefficient"); - } else { - Variable_Names.push_back("Cp"); - } - - /*--- Add Laminar Viscosity, Skin Friction, Heat Flux, & yPlus to the restart file ---*/ + Variable_Names.push_back("Residual_Density"); + Variable_Names.push_back("Residual_Momentum_x"); + Variable_Names.push_back("Residual_Momentum_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Residual_Momentum_z"); + Variable_Names.push_back("Residual_Energy"); - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - nVar_Par += 1; Variable_Names.push_back("Laminar_Viscosity"); - nVar_Par += 2; - Variable_Names.push_back("Skin_Friction_Coefficient_x"); - Variable_Names.push_back("Skin_Friction_Coefficient_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; Variable_Names.push_back("Skin_Friction_Coefficient_z"); - } - nVar_Par += 1; - Variable_Names.push_back("Heat_Flux"); + if (SecondIndex != NONE) { + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { + Variable_Names.push_back("Residual_TKE"); + Variable_Names.push_back("Residual_Omega"); } else { - nVar_Par += 1; Variable_Names.push_back("m"); - nVar_Par += 2; - Variable_Names.push_back("Cf_x"); - Variable_Names.push_back("Cf_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; Variable_Names.push_back("Cf_z"); - } - if (config->GetBuffet_Monitoring() || config->GetKind_ObjFunc() == BUFFET_SENSOR){ - Variable_Names.push_back("Buffet_Sensor"); - nVar_Par += 1; - } - nVar_Par += 1; - Variable_Names.push_back("h"); + /*--- S-A variants ---*/ + Variable_Names.push_back("Residual_Nu_Tilde"); } } + } + + /*--- Add the grid velocity. ---*/ + + if (dynamic_grid) { + if (geometry->GetnDim() == 2) nVar_Par += 2; + else if (geometry->GetnDim() == 3) nVar_Par += 3; - /*--- Add Eddy Viscosity. ---*/ - - if (Kind_Solver == RANS) { + Variable_Names.push_back("Grid_Velocity_x"); + Variable_Names.push_back("Grid_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Grid_Velocity_z"); + } + + + /*--- Add Pressure, Temperature, Cp, Mach. ---*/ + + nVar_Par += 1; + Variable_Names.push_back("Pressure"); + + nVar_Par += 2; + Variable_Names.push_back("Temperature"); + Variable_Names.push_back("Mach"); + + nVar_Par += 1; + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + Variable_Names.push_back("Pressure_Coefficient"); + } else { + Variable_Names.push_back("Cp"); + } + + /*--- Add Laminar Viscosity, Skin Friction, Heat Flux, & yPlus to the restart file ---*/ + + if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + nVar_Par += 1; Variable_Names.push_back("Laminar_Viscosity"); nVar_Par += 2; - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - Variable_Names.push_back("Y_Plus"); - Variable_Names.push_back("Eddy_Viscosity"); - } else { - Variable_Names.push_back("y+"); - Variable_Names.push_back("mt"); + Variable_Names.push_back("Skin_Friction_Coefficient_x"); + Variable_Names.push_back("Skin_Friction_Coefficient_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; Variable_Names.push_back("Skin_Friction_Coefficient_z"); } - } - - /*--- Add the distance to the nearest sharp edge if requested. ---*/ - - if (config->GetWrt_SharpEdges()) { - nVar_Par += 1; - Variable_Names.push_back("Sharp_Edge_Dist"); - } - - /*--- Add the intermittency for the BC trans. model. ---*/ - - if (transition) { nVar_Par += 1; - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - Variable_Names.push_back("gamma_BC"); - } else { - Variable_Names.push_back("gBC"); - } - } - - if (config->GetKind_HybridRANSLES()!=NO_HYBRIDRANSLES){ - nVar_Par +=1; - Variable_Names.push_back("DES_LengthScale"); - nVar_Par +=1; - Variable_Names.push_back("Wall_Distance"); - } - - if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ - nVar_Par +=1; - Variable_Names.push_back("Roe_Dissipation"); - } - - if (solver[FLOW_SOL]->VerificationSolution) { - if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - nVar_Par += 2*nVar_Consv_Par; - Variable_Names.push_back("Verification_Density"); - Variable_Names.push_back("Verification_Momentum_x"); - Variable_Names.push_back("Verification_Momentum_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Verification_Momentum_z"); - Variable_Names.push_back("Verification_Energy"); - Variable_Names.push_back("Error_Density"); - Variable_Names.push_back("Error_Momentum_x"); - Variable_Names.push_back("Error_Momentum_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Error_Momentum_z"); - Variable_Names.push_back("Error_Energy"); - } - } - - /*--- New variables get registered here before the end of the loop. ---*/ - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { + Variable_Names.push_back("Heat_Flux"); + } else { + nVar_Par += 1; Variable_Names.push_back("m"); nVar_Par += 2; - Variable_Names.push_back("Vorticity_x"); - Variable_Names.push_back("Vorticity_y"); + Variable_Names.push_back("Cf_x"); + Variable_Names.push_back("Cf_y"); if (geometry->GetnDim() == 3) { - nVar_Par += 1; Variable_Names.push_back("Vorticity_z"); + nVar_Par += 1; Variable_Names.push_back("Cf_z"); } - - if (geometry->GetnDim() == 3) { - nVar_Par +=1; - Variable_Names.push_back("Q_Criterion"); + if (config->GetBuffet_Monitoring() || config->GetKind_ObjFunc() == BUFFET_SENSOR){ + Variable_Names.push_back("Buffet_Sensor"); + nVar_Par += 1; } + nVar_Par += 1; + Variable_Names.push_back("h"); } - - if (rotating_frame) { - nVar_Par += 2; - Variable_Names.push_back("Relative_Velocity_x"); - Variable_Names.push_back("Relative_Velocity_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; Variable_Names.push_back("Relative_Velocity_z"); - } + } + + /*--- Add Eddy Viscosity. ---*/ + + if (Kind_Solver == RANS) { + nVar_Par += 2; + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + Variable_Names.push_back("Y_Plus"); + Variable_Names.push_back("Eddy_Viscosity"); + } else { + Variable_Names.push_back("y+"); + Variable_Names.push_back("mt"); + } + } + + /*--- Add the distance to the nearest sharp edge if requested. ---*/ + + if (config->GetWrt_SharpEdges()) { + nVar_Par += 1; + Variable_Names.push_back("Sharp_Edge_Dist"); + } + + /*--- Add the intermittency for the BC trans. model. ---*/ + + if (transition) { + nVar_Par += 1; + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + Variable_Names.push_back("gamma_BC"); + } else { + Variable_Names.push_back("gBC"); + } + } + + if (config->GetKind_HybridRANSLES()!=NO_HYBRIDRANSLES){ + nVar_Par +=1; + Variable_Names.push_back("DES_LengthScale"); + nVar_Par +=1; + Variable_Names.push_back("Wall_Distance"); + } + + if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS){ + nVar_Par +=1; + Variable_Names.push_back("Roe_Dissipation"); + } + + if (solver[FLOW_SOL]->VerificationSolution) { + if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { + nVar_Par += 2*nVar_Consv_Par; + Variable_Names.push_back("Verification_Density"); + Variable_Names.push_back("Verification_Momentum_x"); + Variable_Names.push_back("Verification_Momentum_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Verification_Momentum_z"); + Variable_Names.push_back("Verification_Energy"); + Variable_Names.push_back("Error_Density"); + Variable_Names.push_back("Error_Momentum_x"); + Variable_Names.push_back("Error_Momentum_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Error_Momentum_z"); + Variable_Names.push_back("Error_Energy"); + } + } + + /*--- New variables get registered here before the end of the loop. ---*/ + + if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { + nVar_Par += 2; + Variable_Names.push_back("Vorticity_x"); + Variable_Names.push_back("Vorticity_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; Variable_Names.push_back("Vorticity_z"); } - if (config->GetWrt_MeshQuality()) { - nVar_Par +=1; - Variable_Names.push_back("Orthogonality"); - nVar_Par +=1; - Variable_Names.push_back("Aspect_Ratio"); + if (geometry->GetnDim() == 3) { nVar_Par +=1; - Variable_Names.push_back("Volume_Ratio"); + Variable_Names.push_back("Q_Criterion"); } - } + if (rotating_frame) { + nVar_Par += 2; + Variable_Names.push_back("Relative_Velocity_x"); + Variable_Names.push_back("Relative_Velocity_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; Variable_Names.push_back("Relative_Velocity_z"); + } + } + + if (config->GetWrt_MeshQuality()) { + nVar_Par +=1; + Variable_Names.push_back("Orthogonality"); + nVar_Par +=1; + Variable_Names.push_back("Aspect_Ratio"); + nVar_Par +=1; + Variable_Names.push_back("Volume_Ratio"); + } + + + /*--- Auxiliary vectors for variables defined on surfaces only. ---*/ if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { @@ -13128,7 +13058,6 @@ void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver * } /*--- If limiters and/or residuals are requested. ---*/ - if (!config->GetLow_MemoryOutput()) { /*--- Limiters ---*/ if (config->GetWrt_Limiters()) { @@ -13161,9 +13090,8 @@ void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver * } } } - } - if (!config->GetLow_MemoryOutput()) { + /*--- Load buffers with the three grid velocity components. ---*/ @@ -13236,37 +13164,37 @@ void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver * if (solver[FLOW_SOL]->VerificationSolution) { if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - + /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); - + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + /* Set the pointers to the coordinates and solution of this DOF. */ const su2double *coor = geometry->node[iPoint]->GetCoord(); su2double *solDOF = solver[FLOW_SOL]->node[iPoint]->GetSolution(); su2double mmsSol[5] = {0.0,0.0,0.0,0.0,0.0}; su2double error[5] = {0.0,0.0,0.0,0.0,0.0}; - + /* Get the verification solution. */ solver[FLOW_SOL]->VerificationSolution->GetSolution(coor, time, mmsSol); for (jVar = 0; jVar < nVar_First; jVar++) { Local_Data[jPoint][iVar] = mmsSol[jVar]; iVar++; } - + /* Get local error from the verification solution class. */ solver[FLOW_SOL]->VerificationSolution->GetLocalError(coor, time, solDOF, error); for (jVar = 0; jVar < nVar_First; jVar++) { Local_Data[jPoint][iVar] = error[jVar]; iVar++; } - + } } /*--- New variables can be loaded to the Local_Data structure here, assuming they were registered above correctly. ---*/ - + if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[0]; iVar++; Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[1]; iVar++; @@ -13322,16 +13250,16 @@ void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver * Local_Data[jPoint][iVar] = geometry->Volume_Ratio[iPoint]; iVar++; } - } - - /*--- Increment the point counter, as there may have been halos we - skipped over during the data loading. ---*/ - - jPoint++; - } + + /*--- Increment the point counter, as there may have been halos we + skipped over during the data loading. ---*/ + + jPoint++; + } + /*--- Free memory for auxiliary vectors. ---*/ if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { @@ -13347,7 +13275,7 @@ void COutput::LoadLocalData_Flow(CConfig *config, CGeometry *geometry, CSolver * } -void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short iDim; unsigned short Kind_Solver = config->GetKind_Solver(); @@ -13463,194 +13391,189 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve /*--- If requested, register the limiter and residuals for all of the equations in the current flow problem. ---*/ - if (!config->GetLow_MemoryOutput()) { - - /*--- Add the limiters ---*/ - - if (config->GetWrt_Limiters()) { - nVar_Par += nVar_Consv_Par; - - Variable_Names.push_back("Limiter_Pressure"); - Variable_Names.push_back("Limiter_Velocity_x"); - Variable_Names.push_back("Limiter_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Limiter_Velocity_z"); - if (energy || weakly_coupled_heat) - Variable_Names.push_back("Limiter_Temperature"); - - if (SecondIndex != NONE) { - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { - Variable_Names.push_back("Limiter_TKE"); - Variable_Names.push_back("Limiter_Omega"); - } else { - /*--- S-A variants ---*/ - Variable_Names.push_back("Limiter_Nu_Tilde"); - } - } - } - - /*--- Add the residuals ---*/ - - if (config->GetWrt_Residuals()) { - nVar_Par += nVar_Consv_Par; - - Variable_Names.push_back("Residual_Pressure"); - Variable_Names.push_back("Residual_Velocity_x"); - Variable_Names.push_back("Residual_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Residual_Velocity_z"); - if (energy || weakly_coupled_heat) - Variable_Names.push_back("Residual_Temperature"); - if (SecondIndex != NONE) { - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { - Variable_Names.push_back("Residual_TKE"); - Variable_Names.push_back("Residual_Omega"); - } else { - /*--- S-A variants ---*/ - Variable_Names.push_back("Residual_Nu_Tilde"); - } + /*--- Add the limiters ---*/ + + if (config->GetWrt_Limiters()) { + nVar_Par += nVar_Consv_Par; + + Variable_Names.push_back("Limiter_Pressure"); + Variable_Names.push_back("Limiter_Velocity_x"); + Variable_Names.push_back("Limiter_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Limiter_Velocity_z"); + if (energy || weakly_coupled_heat) + Variable_Names.push_back("Limiter_Temperature"); + + if (SecondIndex != NONE) { + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { + Variable_Names.push_back("Limiter_TKE"); + Variable_Names.push_back("Limiter_Omega"); + } else { + /*--- S-A variants ---*/ + Variable_Names.push_back("Limiter_Nu_Tilde"); } } - - /*--- Add the grid velocity. ---*/ - - if (dynamic_grid) { - if (geometry->GetnDim() == 2) nVar_Par += 2; - else if (geometry->GetnDim() == 3) nVar_Par += 3; - - Variable_Names.push_back("Grid_Velocity_x"); - Variable_Names.push_back("Grid_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Grid_Velocity_z"); - } - - /*--- Add Cp. ---*/ - - nVar_Par += 1; - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - Variable_Names.push_back("Pressure_Coefficient"); - } else { - Variable_Names.push_back("Cp"); - } - - /*--- Add Laminar Viscosity, Skin Friction, and Heat Flux to the restart file ---*/ - - if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - nVar_Par += 1; Variable_Names.push_back("Laminar_Viscosity"); - nVar_Par += 2; - Variable_Names.push_back("Skin_Friction_Coefficient_x"); - Variable_Names.push_back("Skin_Friction_Coefficient_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; Variable_Names.push_back("Skin_Friction_Coefficient_z"); - } - if (energy || weakly_coupled_heat) { - nVar_Par += 1; - Variable_Names.push_back("Heat_Flux"); - } + } + + /*--- Add the residuals ---*/ + + if (config->GetWrt_Residuals()) { + nVar_Par += nVar_Consv_Par; + + Variable_Names.push_back("Residual_Pressure"); + Variable_Names.push_back("Residual_Velocity_x"); + Variable_Names.push_back("Residual_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Residual_Velocity_z"); + if (energy || weakly_coupled_heat) + Variable_Names.push_back("Residual_Temperature"); + + if (SecondIndex != NONE) { + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { + Variable_Names.push_back("Residual_TKE"); + Variable_Names.push_back("Residual_Omega"); } else { - nVar_Par += 1; Variable_Names.push_back("m"); - nVar_Par += 2; - Variable_Names.push_back("Cf_x"); - Variable_Names.push_back("Cf_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; Variable_Names.push_back("Cf_z"); - } - if (energy || weakly_coupled_heat) { - nVar_Par += 1; - Variable_Names.push_back("h"); - } + /*--- S-A variants ---*/ + Variable_Names.push_back("Residual_Nu_Tilde"); } } - - /*--- Add Y+ and Eddy Viscosity. ---*/ - - if (Kind_Solver == INC_RANS) { + } + + /*--- Add the grid velocity. ---*/ + + if (dynamic_grid) { + if (geometry->GetnDim() == 2) nVar_Par += 2; + else if (geometry->GetnDim() == 3) nVar_Par += 3; + + Variable_Names.push_back("Grid_Velocity_x"); + Variable_Names.push_back("Grid_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Grid_Velocity_z"); + } + + /*--- Add Cp. ---*/ + + nVar_Par += 1; + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + Variable_Names.push_back("Pressure_Coefficient"); + } else { + Variable_Names.push_back("Cp"); + } + + /*--- Add Laminar Viscosity, Skin Friction, and Heat Flux to the restart file ---*/ + + if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + nVar_Par += 1; Variable_Names.push_back("Laminar_Viscosity"); nVar_Par += 2; - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - Variable_Names.push_back("Y_Plus"); - Variable_Names.push_back("Eddy_Viscosity"); - } else { - Variable_Names.push_back("y+"); - Variable_Names.push_back("mt"); + Variable_Names.push_back("Skin_Friction_Coefficient_x"); + Variable_Names.push_back("Skin_Friction_Coefficient_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; Variable_Names.push_back("Skin_Friction_Coefficient_z"); + } + if (energy || weakly_coupled_heat) { + nVar_Par += 1; + Variable_Names.push_back("Heat_Flux"); + } + } else { + nVar_Par += 1; Variable_Names.push_back("m"); + nVar_Par += 2; + Variable_Names.push_back("Cf_x"); + Variable_Names.push_back("Cf_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; Variable_Names.push_back("Cf_z"); + } + if (energy || weakly_coupled_heat) { + nVar_Par += 1; + Variable_Names.push_back("h"); } } - - /*--- Add the distance to the nearest sharp edge if requested. ---*/ - - if (config->GetWrt_SharpEdges()) { - nVar_Par += 1; - Variable_Names.push_back("Sharp_Edge_Dist"); - } - - /*--- Add the intermittency for the BC trans. model. ---*/ - - if (transition) { - nVar_Par += 1; - if ((config->GetOutput_FileFormat() == PARAVIEW) || - (config->GetOutput_FileFormat() == PARAVIEW_BINARY)){ - Variable_Names.push_back("gamma_BC"); - } else { - Variable_Names.push_back("gBC"); - } - } - - if (variable_density) { - nVar_Par += 1; - Variable_Names.push_back("Density"); - } - - if (wrt_cp) { - nVar_Par += 1; - Variable_Names.push_back("Specific_Heat"); - } - - if (wrt_kt) { - nVar_Par += 1; - Variable_Names.push_back("Thermal_Conductivity"); + } + + /*--- Add Y+ and Eddy Viscosity. ---*/ + + if (Kind_Solver == INC_RANS) { + nVar_Par += 2; + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + Variable_Names.push_back("Y_Plus"); + Variable_Names.push_back("Eddy_Viscosity"); + } else { + Variable_Names.push_back("y+"); + Variable_Names.push_back("mt"); } - - if (solver[FLOW_SOL]->VerificationSolution) { - if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - nVar_Par += 2*nVar_Consv_Par; - Variable_Names.push_back("Verification_Pressure"); - Variable_Names.push_back("Verification_Velocity_x"); - Variable_Names.push_back("Verification_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Verification_Velocity_z"); - if (energy || weakly_coupled_heat) Variable_Names.push_back("Verification_Temperature"); - Variable_Names.push_back("Error_Pressure"); - Variable_Names.push_back("Error_Velocity_x"); - Variable_Names.push_back("Error_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Error_Velocity_z"); - if (energy || weakly_coupled_heat) Variable_Names.push_back("Error_Temperature"); - } + } + + /*--- Add the distance to the nearest sharp edge if requested. ---*/ + + if (config->GetWrt_SharpEdges()) { + nVar_Par += 1; + Variable_Names.push_back("Sharp_Edge_Dist"); + } + + /*--- Add the intermittency for the BC trans. model. ---*/ + + if (transition) { + nVar_Par += 1; + if ((config->GetTabular_FileFormat() == TAB_CSV)){ + Variable_Names.push_back("gamma_BC"); + } else { + Variable_Names.push_back("gBC"); } - - if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - nVar_Par += 2; - Variable_Names.push_back("Vorticity_x"); - Variable_Names.push_back("Vorticity_y"); - nVar_Par += 1; Variable_Names.push_back("Vorticity_z"); - - if (geometry->GetnDim() == 3) { - nVar_Par +=1; - Variable_Names.push_back("Q_Criterion"); - } + } + + if (variable_density) { + nVar_Par += 1; + Variable_Names.push_back("Density"); + } + + if (wrt_cp) { + nVar_Par += 1; + Variable_Names.push_back("Specific_Heat"); + } + + if (wrt_kt) { + nVar_Par += 1; + Variable_Names.push_back("Thermal_Conductivity"); + } + + if (solver[FLOW_SOL]->VerificationSolution) { + if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { + nVar_Par += 2*nVar_Consv_Par; + Variable_Names.push_back("Verification_Pressure"); + Variable_Names.push_back("Verification_Velocity_x"); + Variable_Names.push_back("Verification_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Verification_Velocity_z"); + if (energy || weakly_coupled_heat) Variable_Names.push_back("Verification_Temperature"); + Variable_Names.push_back("Error_Pressure"); + Variable_Names.push_back("Error_Velocity_x"); + Variable_Names.push_back("Error_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Error_Velocity_z"); + if (energy || weakly_coupled_heat) Variable_Names.push_back("Error_Temperature"); } + } + + if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { + nVar_Par += 2; + Variable_Names.push_back("Vorticity_x"); + Variable_Names.push_back("Vorticity_y"); + nVar_Par += 1; Variable_Names.push_back("Vorticity_z"); - if (config->GetWrt_MeshQuality()) { - nVar_Par +=1; - Variable_Names.push_back("Orthogonality"); - nVar_Par +=1; - Variable_Names.push_back("Aspect_Ratio"); + if (geometry->GetnDim() == 3) { nVar_Par +=1; - Variable_Names.push_back("Volume_Ratio"); + Variable_Names.push_back("Q_Criterion"); } - - /*--- New variables get registered here before the end of the loop. ---*/ - } + + if (config->GetWrt_MeshQuality()) { + nVar_Par +=1; + Variable_Names.push_back("Orthogonality"); + nVar_Par +=1; + Variable_Names.push_back("Aspect_Ratio"); + nVar_Par +=1; + Variable_Names.push_back("Volume_Ratio"); + } + + /*--- New variables get registered here before the end of the loop. ---*/ + + /*--- Auxiliary vectors for variables defined on surfaces only. ---*/ @@ -13776,197 +13699,195 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } /*--- If limiters and/or residuals are requested. ---*/ - if (!config->GetLow_MemoryOutput()) { - - /*--- Limiters ---*/ - if (config->GetWrt_Limiters()) { - /*--- Mean Flow Limiters ---*/ - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetLimiter_Primitive(jVar); - iVar++; - } - /*--- RANS Limiters ---*/ - if (SecondIndex != NONE) { - for (jVar = 0; jVar < nVar_Second; jVar++) { - Local_Data[jPoint][iVar] = solver[SecondIndex]->node[iPoint]->GetLimiter_Primitive(jVar); - iVar++; - } - } + + /*--- Limiters ---*/ + if (config->GetWrt_Limiters()) { + /*--- Mean Flow Limiters ---*/ + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetLimiter_Primitive(jVar); + iVar++; } - - /*--- Residuals ---*/ - if (config->GetWrt_Residuals()) { - /*--- Mean Flow Residuals ---*/ - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); + /*--- RANS Limiters ---*/ + if (SecondIndex != NONE) { + for (jVar = 0; jVar < nVar_Second; jVar++) { + Local_Data[jPoint][iVar] = solver[SecondIndex]->node[iPoint]->GetLimiter_Primitive(jVar); iVar++; } - /*--- RANS Residuals ---*/ - if (SecondIndex != NONE) { - for (jVar = 0; jVar < nVar_Second; jVar++) { - Local_Data[jPoint][iVar] = solver[SecondIndex]->LinSysRes.GetBlock(iPoint, jVar); - iVar++; - } - } } } - - if (!config->GetLow_MemoryOutput()) { - - /*--- Load buffers with the three grid velocity components. ---*/ - - if (dynamic_grid) { - Grid_Vel = geometry->node[iPoint]->GetGridVel(); - Local_Data[jPoint][iVar] = Grid_Vel[0]; iVar++; - Local_Data[jPoint][iVar] = Grid_Vel[1]; iVar++; - if (geometry->GetnDim() == 3) { - Local_Data[jPoint][iVar] = Grid_Vel[2]; - iVar++; - } + + /*--- Residuals ---*/ + if (config->GetWrt_Residuals()) { + /*--- Mean Flow Residuals ---*/ + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); + iVar++; } - - /*--- Load data for Cp and Mach variables. ---*/ - - Local_Data[jPoint][iVar] = (solver[FLOW_SOL]->node[iPoint]->GetPressure() - RefPressure)*factor*RefArea; iVar++; - - if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - - /*--- Load data for the laminar viscosity. ---*/ - - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetLaminarViscosity(); iVar++; - - /*--- Load data for the skin friction, heat flux, and y-plus. ---*/ - - Local_Data[jPoint][iVar] = Aux_Frict_x[iPoint]; iVar++; - Local_Data[jPoint][iVar] = Aux_Frict_y[iPoint]; iVar++; - if (geometry->GetnDim() == 3) { - Local_Data[jPoint][iVar] = Aux_Frict_z[iPoint]; + /*--- RANS Residuals ---*/ + if (SecondIndex != NONE) { + for (jVar = 0; jVar < nVar_Second; jVar++) { + Local_Data[jPoint][iVar] = solver[SecondIndex]->LinSysRes.GetBlock(iPoint, jVar); iVar++; } - - if (energy || weakly_coupled_heat) { - Local_Data[jPoint][iVar] = Aux_Heat[iPoint]; iVar++; - } - - } - - /*--- Load data for the Eddy viscosity for RANS. ---*/ - - if (Kind_Solver == INC_RANS) { - Local_Data[jPoint][iVar] = Aux_yPlus[iPoint]; iVar++; - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetEddyViscosity(); iVar++; } - - /*--- Load data for the distance to the nearest sharp edge. ---*/ - - if (config->GetWrt_SharpEdges()) { - Local_Data[jPoint][iVar] = geometry->node[iPoint]->GetSharpEdge_Distance(); iVar++; - } - - /*--- Load data for the intermittency of the BC trans. model. ---*/ - - if (transition) { - Local_Data[jPoint][iVar] = solver[TURB_SOL]->node[iPoint]->GetGammaBC(); iVar++; + } + + + + /*--- Load buffers with the three grid velocity components. ---*/ + + if (dynamic_grid) { + Grid_Vel = geometry->node[iPoint]->GetGridVel(); + Local_Data[jPoint][iVar] = Grid_Vel[0]; iVar++; + Local_Data[jPoint][iVar] = Grid_Vel[1]; iVar++; + if (geometry->GetnDim() == 3) { + Local_Data[jPoint][iVar] = Grid_Vel[2]; + iVar++; } - - /*--- Load density if we are solving a variable density problem. ---*/ + } + + /*--- Load data for Cp and Mach variables. ---*/ + + Local_Data[jPoint][iVar] = (solver[FLOW_SOL]->node[iPoint]->GetPressure() - RefPressure)*factor*RefArea; iVar++; + + if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - if (variable_density) { - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetDensity(); iVar++; - } + /*--- Load data for the laminar viscosity. ---*/ + + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetLaminarViscosity(); iVar++; - /*--- Load Cp and conductivity if they are temperature-dependent. ---*/ - if (wrt_cp) { - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetSpecificHeatCp(); iVar++; + /*--- Load data for the skin friction, heat flux, and y-plus. ---*/ + + Local_Data[jPoint][iVar] = Aux_Frict_x[iPoint]; iVar++; + Local_Data[jPoint][iVar] = Aux_Frict_y[iPoint]; iVar++; + if (geometry->GetnDim() == 3) { + Local_Data[jPoint][iVar] = Aux_Frict_z[iPoint]; + iVar++; } - if (wrt_kt) { - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetThermalConductivity(); iVar++; + if (energy || weakly_coupled_heat) { + Local_Data[jPoint][iVar] = Aux_Heat[iPoint]; iVar++; } - if (solver[FLOW_SOL]->VerificationSolution) { - if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - - /*--- Get the physical time if necessary. ---*/ - su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + } + + /*--- Load data for the Eddy viscosity for RANS. ---*/ + + if (Kind_Solver == INC_RANS) { + Local_Data[jPoint][iVar] = Aux_yPlus[iPoint]; iVar++; + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetEddyViscosity(); iVar++; + } + + /*--- Load data for the distance to the nearest sharp edge. ---*/ + + if (config->GetWrt_SharpEdges()) { + Local_Data[jPoint][iVar] = geometry->node[iPoint]->GetSharpEdge_Distance(); iVar++; + } + + /*--- Load data for the intermittency of the BC trans. model. ---*/ + + if (transition) { + Local_Data[jPoint][iVar] = solver[TURB_SOL]->node[iPoint]->GetGammaBC(); iVar++; + } + + /*--- Load density if we are solving a variable density problem. ---*/ + + if (variable_density) { + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetDensity(); iVar++; + } + + /*--- Load Cp and conductivity if they are temperature-dependent. ---*/ + if (wrt_cp) { + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetSpecificHeatCp(); iVar++; + } + + if (wrt_kt) { + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetThermalConductivity(); iVar++; + } + + if (solver[FLOW_SOL]->VerificationSolution) { + if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - /* Set the pointers to the coordinates and solution of this DOF. */ - const su2double *coor = geometry->node[iPoint]->GetCoord(); - su2double *solDOF = solver[FLOW_SOL]->node[iPoint]->GetSolution(); - su2double mmsSol[5] = {0.0,0.0,0.0,0.0,0.0}; - su2double error[5] = {0.0,0.0,0.0,0.0,0.0}; + /*--- Get the physical time if necessary. ---*/ + su2double time = 0.0; + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); - /* Get the verification solution. */ - solver[FLOW_SOL]->VerificationSolution->GetSolution(coor, time, mmsSol); - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = mmsSol[jVar]; - iVar++; - } + /* Set the pointers to the coordinates and solution of this DOF. */ + const su2double *coor = geometry->node[iPoint]->GetCoord(); + su2double *solDOF = solver[FLOW_SOL]->node[iPoint]->GetSolution(); + su2double mmsSol[5] = {0.0,0.0,0.0,0.0,0.0}; + su2double error[5] = {0.0,0.0,0.0,0.0,0.0}; - /* Get local error from the verification solution class. */ - solver[FLOW_SOL]->VerificationSolution->GetLocalError(coor, time, solDOF, error); - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = error[jVar]; - iVar++; - } - + /* Get the verification solution. */ + solver[FLOW_SOL]->VerificationSolution->GetSolution(coor, time, mmsSol); + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = mmsSol[jVar]; + iVar++; } - } - - if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[0]; iVar++; - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[1]; iVar++; - Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[2]; iVar++; - - if (nDim == 3){ - for (iDim = 0; iDim < nDim; iDim++) { - for (unsigned short jDim = 0; jDim < nDim; jDim++) { - Grad_Vel[iDim][jDim] = solver[FLOW_SOL]->node[iPoint]->GetGradient_Primitive(iDim+1, jDim); - } - } - - /*--- Q Criterion Eq 1.2 of---*/ - /*--- HALLER, G. (2005). An objective definition of a vortex. Journal of Fluid Mechanics, 525, 1-26. doi:10.1017/S0022112004002526 ---*/ - - su2double s11 = Grad_Vel[0][0]; - su2double s12 = 0.5 * (Grad_Vel[0][1] + Grad_Vel[1][0]); - su2double s13 = 0.5 * (Grad_Vel[0][2] + Grad_Vel[2][0]); - su2double s22 = Grad_Vel[1][1]; - su2double s23 = 0.5 * (Grad_Vel[1][2] + Grad_Vel[2][1]); - su2double s33 = Grad_Vel[2][2]; - su2double omega12 = 0.5 * (Grad_Vel[0][1] - Grad_Vel[1][0]); - su2double omega13 = 0.5 * (Grad_Vel[0][2] - Grad_Vel[2][0]); - su2double omega23 = 0.5 * (Grad_Vel[1][2] - Grad_Vel[2][1]); - - Q = 2. * pow( omega12, 2.) + 2. * pow( omega13, 2.) + 2. * pow( omega23, 2.) - \ - pow( s11, 2.) - pow( s22, 2.) - pow( s33, 2.0) - 2. * pow( s12, 2.) - 2. * pow( s13, 2.) - 2. * pow( s23, 2.0); - - Local_Data[jPoint][iVar] = Q; iVar++; + /* Get local error from the verification solution class. */ + solver[FLOW_SOL]->VerificationSolution->GetLocalError(coor, time, solDOF, error); + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = error[jVar]; + iVar++; } + } + } + + if ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - /*--- Output the mesh quality metrics. ---*/ + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[0]; iVar++; + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[1]; iVar++; + Local_Data[jPoint][iVar] = solver[FLOW_SOL]->node[iPoint]->GetVorticity()[2]; iVar++; - if (config->GetWrt_MeshQuality()) { - Local_Data[jPoint][iVar] = geometry->Orthogonality[iPoint]; iVar++; - Local_Data[jPoint][iVar] = geometry->Aspect_Ratio[iPoint]; iVar++; - Local_Data[jPoint][iVar] = geometry->Volume_Ratio[iPoint]; iVar++; + if (nDim == 3){ + for (iDim = 0; iDim < nDim; iDim++) { + for (unsigned short jDim = 0; jDim < nDim; jDim++) { + Grad_Vel[iDim][jDim] = solver[FLOW_SOL]->node[iPoint]->GetGradient_Primitive(iDim+1, jDim); + } + } + + /*--- Q Criterion Eq 1.2 of---*/ + /*--- HALLER, G. (2005). An objective definition of a vortex. Journal of Fluid Mechanics, 525, 1-26. doi:10.1017/S0022112004002526 ---*/ + + su2double s11 = Grad_Vel[0][0]; + su2double s12 = 0.5 * (Grad_Vel[0][1] + Grad_Vel[1][0]); + su2double s13 = 0.5 * (Grad_Vel[0][2] + Grad_Vel[2][0]); + su2double s22 = Grad_Vel[1][1]; + su2double s23 = 0.5 * (Grad_Vel[1][2] + Grad_Vel[2][1]); + su2double s33 = Grad_Vel[2][2]; + su2double omega12 = 0.5 * (Grad_Vel[0][1] - Grad_Vel[1][0]); + su2double omega13 = 0.5 * (Grad_Vel[0][2] - Grad_Vel[2][0]); + su2double omega23 = 0.5 * (Grad_Vel[1][2] - Grad_Vel[2][1]); + + Q = 2. * pow( omega12, 2.) + 2. * pow( omega13, 2.) + 2. * pow( omega23, 2.) - \ + pow( s11, 2.) - pow( s22, 2.) - pow( s33, 2.0) - 2. * pow( s12, 2.) - 2. * pow( s13, 2.) - 2. * pow( s23, 2.0); + + Local_Data[jPoint][iVar] = Q; iVar++; } - - /*--- New variables can be loaded to the Local_Data structure here, - assuming they were registered above correctly. ---*/ - } - - /*--- Increment the point counter, as there may have been halos we - skipped over during the data loading. ---*/ - - jPoint++; - + + /*--- Output the mesh quality metrics. ---*/ + + if (config->GetWrt_MeshQuality()) { + Local_Data[jPoint][iVar] = geometry->Orthogonality[iPoint]; iVar++; + Local_Data[jPoint][iVar] = geometry->Aspect_Ratio[iPoint]; iVar++; + Local_Data[jPoint][iVar] = geometry->Volume_Ratio[iPoint]; iVar++; + } + + /*--- New variables can be loaded to the Local_Data structure here, + assuming they were registered above correctly. ---*/ + } + + /*--- Increment the point counter, as there may have been halos we + skipped over during the data loading. ---*/ + + jPoint++; + } + /*--- Free memory for auxiliary vectors. ---*/ @@ -13982,7 +13903,7 @@ void COutput::LoadLocalData_IncFlow(CConfig *config, CGeometry *geometry, CSolve } -void COutput::LoadLocalData_AdjFlow(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::LoadLocalData_AdjFlow(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short iDim; unsigned short Kind_Solver = config->GetKind_Solver(); @@ -14092,98 +14013,96 @@ void COutput::LoadLocalData_AdjFlow(CConfig *config, CGeometry *geometry, CSolve /*--- If requested, register the limiter and residuals for all of the equations in the current flow problem. ---*/ - if (!config->GetLow_MemoryOutput()) { - - /*--- Add the limiters ---*/ - - if (config->GetWrt_Limiters()) { - nVar_Par += nVar_Consv_Par; - if (incompressible) { - Variable_Names.push_back("Limiter_Adjoint_Pressure"); - Variable_Names.push_back("Limiter_Adjoint_Velocity_x"); - Variable_Names.push_back("Limiter_Adjoint_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Limiter_Adjoint_Velocity_z"); - Variable_Names.push_back("Limiter_Adjoint_Temperature"); - } else { - Variable_Names.push_back("Limiter_Adjoint_Density"); - Variable_Names.push_back("Limiter_Adjoint_Momentum_x"); - Variable_Names.push_back("Limiter_Adjoint_Momentum_y"); - if (geometry->GetnDim() == 3) - Variable_Names.push_back("Limiter_Adjoint_Momentum_z"); - Variable_Names.push_back("Limiter_Adjoint_Energy"); - } - if (SecondIndex != NONE) { - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { - Variable_Names.push_back("Limiter_Adjoint_TKE"); - Variable_Names.push_back("Limiter_Adjoint_Omega"); - } else { - /*--- S-A variants ---*/ - Variable_Names.push_back("Limiter_Adjoint_Nu_Tilde"); - } - } + /*--- Add the limiters ---*/ + + if (config->GetWrt_Limiters()) { + nVar_Par += nVar_Consv_Par; + if (incompressible) { + Variable_Names.push_back("Limiter_Adjoint_Pressure"); + Variable_Names.push_back("Limiter_Adjoint_Velocity_x"); + Variable_Names.push_back("Limiter_Adjoint_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Limiter_Adjoint_Velocity_z"); + Variable_Names.push_back("Limiter_Adjoint_Temperature"); + } else { + Variable_Names.push_back("Limiter_Adjoint_Density"); + Variable_Names.push_back("Limiter_Adjoint_Momentum_x"); + Variable_Names.push_back("Limiter_Adjoint_Momentum_y"); + if (geometry->GetnDim() == 3) + Variable_Names.push_back("Limiter_Adjoint_Momentum_z"); + Variable_Names.push_back("Limiter_Adjoint_Energy"); } - - /*--- Add the residuals ---*/ - - if (config->GetWrt_Residuals()) { - nVar_Par += nVar_Consv_Par; - if (incompressible) { - Variable_Names.push_back("Residual_Adjoint_Pressure"); - Variable_Names.push_back("Residual_Adjoint_Velocity_x"); - Variable_Names.push_back("Residual_Adjoint_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Residual_Adjoint_Velocity_z"); - Variable_Names.push_back("Residual_Adjoint_Temperature"); + if (SecondIndex != NONE) { + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { + Variable_Names.push_back("Limiter_Adjoint_TKE"); + Variable_Names.push_back("Limiter_Adjoint_Omega"); } else { - Variable_Names.push_back("Residual_Adjoint_Density"); - Variable_Names.push_back("Residual_Adjoint_Momentum_x"); - Variable_Names.push_back("Residual_Adjoint_Momentum_y"); - if (geometry->GetnDim() == 3) - Variable_Names.push_back("Residual_Adjoint_Momentum_z"); - Variable_Names.push_back("Residual_Adjoint_Energy"); - } - if (SecondIndex != NONE) { - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { - Variable_Names.push_back("Residual_Adjoint_TKE"); - Variable_Names.push_back("Residual_Adjoint_Omega"); - } else { - /*--- S-A variants ---*/ - Variable_Names.push_back("Residual_Adjoint_Nu_Tilde"); - } + /*--- S-A variants ---*/ + Variable_Names.push_back("Limiter_Adjoint_Nu_Tilde"); } } - - /*--- Add the grid velocity. ---*/ - - if (dynamic_grid) { - if (geometry->GetnDim() == 2) nVar_Par += 2; - else if (geometry->GetnDim() == 3) nVar_Par += 3; - Variable_Names.push_back("Grid_Velocity_x"); - Variable_Names.push_back("Grid_Velocity_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Grid_Velocity_z"); + } + + /*--- Add the residuals ---*/ + + if (config->GetWrt_Residuals()) { + nVar_Par += nVar_Consv_Par; + if (incompressible) { + Variable_Names.push_back("Residual_Adjoint_Pressure"); + Variable_Names.push_back("Residual_Adjoint_Velocity_x"); + Variable_Names.push_back("Residual_Adjoint_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Residual_Adjoint_Velocity_z"); + Variable_Names.push_back("Residual_Adjoint_Temperature"); + } else { + Variable_Names.push_back("Residual_Adjoint_Density"); + Variable_Names.push_back("Residual_Adjoint_Momentum_x"); + Variable_Names.push_back("Residual_Adjoint_Momentum_y"); + if (geometry->GetnDim() == 3) + Variable_Names.push_back("Residual_Adjoint_Momentum_z"); + Variable_Names.push_back("Residual_Adjoint_Energy"); } - - /*--- All adjoint solvers write the surface sensitivity. ---*/ - - nVar_Par += 1; Variable_Names.push_back("Surface_Sensitivity"); - - /*--- For the continouus adjoint, we write either convective scheme's - dissipation sensor (centered) or limiter (uwpind) for adj. density. ---*/ - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS )) { - nVar_Par += 1; - if (config->GetKind_ConvNumScheme() == SPACE_CENTERED) { - Variable_Names.push_back("Dissipation_Sensor"); + if (SecondIndex != NONE) { + if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) { + Variable_Names.push_back("Residual_Adjoint_TKE"); + Variable_Names.push_back("Residual_Adjoint_Omega"); } else { - Variable_Names.push_back("Limiter_Adjoint_Density"); + /*--- S-A variants ---*/ + Variable_Names.push_back("Residual_Adjoint_Nu_Tilde"); } } - - /*--- New variables get registered here before the end of the loop. ---*/ - } + /*--- Add the grid velocity. ---*/ + + if (dynamic_grid) { + if (geometry->GetnDim() == 2) nVar_Par += 2; + else if (geometry->GetnDim() == 3) nVar_Par += 3; + Variable_Names.push_back("Grid_Velocity_x"); + Variable_Names.push_back("Grid_Velocity_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Grid_Velocity_z"); + } + + /*--- All adjoint solvers write the surface sensitivity. ---*/ + + nVar_Par += 1; Variable_Names.push_back("Surface_Sensitivity"); + + /*--- For the continouus adjoint, we write either convective scheme's + dissipation sensor (centered) or limiter (uwpind) for adj. density. ---*/ + + if (( Kind_Solver == ADJ_EULER ) || + ( Kind_Solver == ADJ_NAVIER_STOKES ) || + ( Kind_Solver == ADJ_RANS )) { + nVar_Par += 1; + if (config->GetKind_ConvNumScheme() == SPACE_CENTERED) { + Variable_Names.push_back("Dissipation_Sensor"); + } else { + Variable_Names.push_back("Limiter_Adjoint_Density"); + } + } + + /*--- New variables get registered here before the end of the loop. ---*/ + + + /*--- Auxiliary vectors for variables defined on surfaces only. ---*/ Aux_Sens = new su2double[geometry->GetnPoint()]; @@ -14310,84 +14229,82 @@ void COutput::LoadLocalData_AdjFlow(CConfig *config, CGeometry *geometry, CSolve } } - if (!config->GetLow_MemoryOutput()) { - - if (config->GetWrt_Limiters()) { - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetLimiter(jVar); - iVar++; - } - if (SecondIndex != NONE) { - for (jVar = 0; jVar < nVar_Second; jVar++) { - Local_Data[jPoint][iVar] = solver[SecondIndex]->node[iPoint]->GetLimiter(jVar); - iVar++; - } - } - } - - if (config->GetWrt_Residuals()) { - for (jVar = 0; jVar < nVar_First; jVar++) { - if (!config->GetDiscrete_Adjoint()) { - Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); - } else { - Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetSolution(jVar) - - solver[FirstIndex]->node[iPoint]->GetSolution_Old(jVar); - } - iVar++; - } - if (SecondIndex != NONE) { - for (jVar = 0; jVar < nVar_Second; jVar++) { - if (!config->GetDiscrete_Adjoint()) { - Local_Data[jPoint][iVar] = solver[SecondIndex]->LinSysRes.GetBlock(iPoint, jVar); - } else { - Local_Data[jPoint][iVar] = solver[SecondIndex]->node[iPoint]->GetSolution(jVar) - - solver[SecondIndex]->node[iPoint]->GetSolution_Old(jVar); - } - iVar++; - } - } - } - - /*--- Load buffers with the three grid velocity components. ---*/ - - if (dynamic_grid) { - Grid_Vel = geometry->node[iPoint]->GetGridVel(); - Local_Data[jPoint][iVar] = Grid_Vel[0]; iVar++; - Local_Data[jPoint][iVar] = Grid_Vel[1]; iVar++; - if (geometry->GetnDim() == 3) { - Local_Data[jPoint][iVar] = Grid_Vel[2]; + if (config->GetWrt_Limiters()) { + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetLimiter(jVar); + iVar++; + } + if (SecondIndex != NONE) { + for (jVar = 0; jVar < nVar_Second; jVar++) { + Local_Data[jPoint][iVar] = solver[SecondIndex]->node[iPoint]->GetLimiter(jVar); iVar++; } } - - /*--- Load data for the surface sensitivity. ---*/ - - Local_Data[iPoint][iVar] = Aux_Sens[iPoint]; iVar++; - - /*--- Load data for the convective scheme sensor. ---*/ - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS )) { - if (config->GetKind_ConvNumScheme() == SPACE_CENTERED) { - Local_Data[jPoint][iVar] = solver[ADJFLOW_SOL]->node[iPoint]->GetSensor(iPoint); iVar++; + } + + if (config->GetWrt_Residuals()) { + for (jVar = 0; jVar < nVar_First; jVar++) { + if (!config->GetDiscrete_Adjoint()) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); } else { - Local_Data[jPoint][iVar] = solver[ADJFLOW_SOL]->node[iPoint]->GetLimiter(0); iVar++; + Local_Data[jPoint][iVar] = solver[FirstIndex]->node[iPoint]->GetSolution(jVar) - + solver[FirstIndex]->node[iPoint]->GetSolution_Old(jVar); + } + iVar++; + } + if (SecondIndex != NONE) { + for (jVar = 0; jVar < nVar_Second; jVar++) { + if (!config->GetDiscrete_Adjoint()) { + Local_Data[jPoint][iVar] = solver[SecondIndex]->LinSysRes.GetBlock(iPoint, jVar); + } else { + Local_Data[jPoint][iVar] = solver[SecondIndex]->node[iPoint]->GetSolution(jVar) - + solver[SecondIndex]->node[iPoint]->GetSolution_Old(jVar); + } + iVar++; } } - - /*--- New variables can be loaded to the Local_Data structure here, - assuming they were registered above correctly. ---*/ - } - - /*--- Increment the point counter, as there may have been halos we - skipped over during the data loading. ---*/ - - jPoint++; + + /*--- Load buffers with the three grid velocity components. ---*/ + + if (dynamic_grid) { + Grid_Vel = geometry->node[iPoint]->GetGridVel(); + Local_Data[jPoint][iVar] = Grid_Vel[0]; iVar++; + Local_Data[jPoint][iVar] = Grid_Vel[1]; iVar++; + if (geometry->GetnDim() == 3) { + Local_Data[jPoint][iVar] = Grid_Vel[2]; + iVar++; + } + } + + /*--- Load data for the surface sensitivity. ---*/ + + Local_Data[iPoint][iVar] = Aux_Sens[iPoint]; iVar++; + + /*--- Load data for the convective scheme sensor. ---*/ + + if (( Kind_Solver == ADJ_EULER ) || + ( Kind_Solver == ADJ_NAVIER_STOKES ) || + ( Kind_Solver == ADJ_RANS )) { + if (config->GetKind_ConvNumScheme() == SPACE_CENTERED) { + Local_Data[jPoint][iVar] = solver[ADJFLOW_SOL]->node[iPoint]->GetSensor(iPoint); iVar++; + } else { + Local_Data[jPoint][iVar] = solver[ADJFLOW_SOL]->node[iPoint]->GetLimiter(0); iVar++; + } + } + + /*--- New variables can be loaded to the Local_Data structure here, + assuming they were registered above correctly. ---*/ + } + + /*--- Increment the point counter, as there may have been halos we + skipped over during the data loading. ---*/ + + jPoint++; } + /*--- Free memory for auxiliary vectors. ---*/ delete [] Aux_Sens; @@ -14395,7 +14312,7 @@ void COutput::LoadLocalData_AdjFlow(CConfig *config, CGeometry *geometry, CSolve } -void COutput::LoadLocalData_Elasticity(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::LoadLocalData_Elasticity(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short iDim; @@ -14457,66 +14374,65 @@ void COutput::LoadLocalData_Elasticity(CConfig *config, CGeometry *geometry, CSo /*--- If requested, register the limiter and residuals for all of the equations in the current flow problem. ---*/ - if (!config->GetLow_MemoryOutput()) { - /*--- Add the residuals ---*/ - - if (config->GetWrt_Residuals()) { - nVar_Par += nVar_Consv_Par; - Variable_Names.push_back("Residual_Displacement_x"); - Variable_Names.push_back("Residual_Displacement_y"); - if (geometry->GetnDim() == 3) - Variable_Names.push_back("Residual_Displacement_z"); + /*--- Add the residuals ---*/ + + if (config->GetWrt_Residuals()) { + nVar_Par += nVar_Consv_Par; + Variable_Names.push_back("Residual_Displacement_x"); + Variable_Names.push_back("Residual_Displacement_y"); + if (geometry->GetnDim() == 3) + Variable_Names.push_back("Residual_Displacement_z"); + } + + /*--- If the analysis is dynamic... ---*/ + if (config->GetTime_Domain()) { + + /*--- Velocities ---*/ + nVar_Par += 2; + Variable_Names.push_back("Velocity_x"); + Variable_Names.push_back("Velocity_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; + Variable_Names.push_back("Velocity_z"); } - /*--- If the analysis is dynamic... ---*/ - if (config->GetDynamic_Analysis() == DYNAMIC) { - - /*--- Velocities ---*/ - nVar_Par += 2; - Variable_Names.push_back("Velocity_x"); - Variable_Names.push_back("Velocity_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; - Variable_Names.push_back("Velocity_z"); - } - - /*--- Accelerations ---*/ - nVar_Par += 2; - Variable_Names.push_back("Acceleration_x"); - Variable_Names.push_back("Acceleration_y"); - if (geometry->GetnDim() == 3) { - nVar_Par += 1; - Variable_Names.push_back("Acceleration_z"); - } + /*--- Accelerations ---*/ + nVar_Par += 2; + Variable_Names.push_back("Acceleration_x"); + Variable_Names.push_back("Acceleration_y"); + if (geometry->GetnDim() == 3) { + nVar_Par += 1; + Variable_Names.push_back("Acceleration_z"); } + } + + if (!(config->GetDiscrete_Adjoint())) { - if (!(config->GetDiscrete_Adjoint())) { - - /*--- Add the stresses. ---*/ + /*--- Add the stresses. ---*/ + nVar_Par += 3; + Variable_Names.push_back("Sxx"); + Variable_Names.push_back("Syy"); + Variable_Names.push_back("Sxy"); + if (geometry->GetnDim() == 3) { nVar_Par += 3; - Variable_Names.push_back("Sxx"); - Variable_Names.push_back("Syy"); - Variable_Names.push_back("Sxy"); - if (geometry->GetnDim() == 3) { - nVar_Par += 3; - Variable_Names.push_back("Szz"); - Variable_Names.push_back("Sxz"); - Variable_Names.push_back("Syz"); - } - - /*--- Add the Von Mises Stress. ---*/ - - nVar_Par += 1; - Variable_Names.push_back("Von_Mises_Stress"); - + Variable_Names.push_back("Szz"); + Variable_Names.push_back("Sxz"); + Variable_Names.push_back("Syz"); } - /*--- New variables get registered here before the end of the loop. ---*/ + /*--- Add the Von Mises Stress. ---*/ + + nVar_Par += 1; + Variable_Names.push_back("Von_Mises_Stress"); } + /*--- New variables get registered here before the end of the loop. ---*/ + + + /*--- Allocate the local data structure now that we know how many variables are in the output. ---*/ @@ -14591,75 +14507,73 @@ void COutput::LoadLocalData_Elasticity(CConfig *config, CGeometry *geometry, CSo iVar++; } - if (!config->GetLow_MemoryOutput()) { - if (config->GetWrt_Residuals()) { - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); - iVar++; - } + if (config->GetWrt_Residuals()) { + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); + iVar++; } } - if (!config->GetLow_MemoryOutput()) { + + + /*--- Load the velocities and accelerations (dynamic calculations). ---*/ + + if (config->GetTime_Domain()) { - /*--- Load the velocities and accelerations (dynamic calculations). ---*/ + /*--- Velocities ---*/ - if (config->GetDynamic_Analysis() == DYNAMIC) { - - /*--- Velocities ---*/ - - Node_Vel = solver[FEA_SOL]->node[iPoint]->GetSolution_Vel(); - Local_Data[jPoint][iVar] = Node_Vel[0]; iVar++; - Local_Data[jPoint][iVar] = Node_Vel[1]; iVar++; - if (geometry->GetnDim() == 3) { - Local_Data[jPoint][iVar] = Node_Vel[2]; - iVar++; - } - - /*--- Accelerations ---*/ - - Node_Accel = solver[FEA_SOL]->node[iPoint]->GetSolution_Accel(); - Local_Data[jPoint][iVar] = Node_Accel[0]; iVar++; - Local_Data[jPoint][iVar] = Node_Accel[1]; iVar++; - if (geometry->GetnDim() == 3) { - Local_Data[jPoint][iVar] = Node_Accel[2]; - iVar++; - } + Node_Vel = solver[FEA_SOL]->node[iPoint]->GetSolution_Vel(); + Local_Data[jPoint][iVar] = Node_Vel[0]; iVar++; + Local_Data[jPoint][iVar] = Node_Vel[1]; iVar++; + if (geometry->GetnDim() == 3) { + Local_Data[jPoint][iVar] = Node_Vel[2]; + iVar++; } - if (!(config->GetDiscrete_Adjoint())) { - - /*--- Add the stresses. ---*/ + /*--- Accelerations ---*/ - Stress = solver[FEA_SOL]->node[iPoint]->GetStress_FEM(); + Node_Accel = solver[FEA_SOL]->node[iPoint]->GetSolution_Accel(); + Local_Data[jPoint][iVar] = Node_Accel[0]; iVar++; + Local_Data[jPoint][iVar] = Node_Accel[1]; iVar++; + if (geometry->GetnDim() == 3) { + Local_Data[jPoint][iVar] = Node_Accel[2]; + iVar++; + } + } + + if (!(config->GetDiscrete_Adjoint())) { - /*--- Sigma xx ---*/ - Local_Data[jPoint][iVar] = Stress[0]; iVar++; - /*--- Sigma yy ---*/ - Local_Data[jPoint][iVar] = Stress[1]; iVar++; - /*--- Sigma xy ---*/ - Local_Data[jPoint][iVar] = Stress[2]; iVar++; + /*--- Add the stresses. ---*/ - if (geometry->GetnDim() == 3) { - /*--- Sigma zz ---*/ - Local_Data[jPoint][iVar] = Stress[3]; iVar++; - /*--- Sigma xz ---*/ - Local_Data[jPoint][iVar] = Stress[4]; iVar++; - /*--- Sigma yz ---*/ - Local_Data[jPoint][iVar] = Stress[5]; iVar++; - } + Stress = solver[FEA_SOL]->node[iPoint]->GetStress_FEM(); + + /*--- Sigma xx ---*/ + Local_Data[jPoint][iVar] = Stress[0]; iVar++; + /*--- Sigma yy ---*/ + Local_Data[jPoint][iVar] = Stress[1]; iVar++; + /*--- Sigma xy ---*/ + Local_Data[jPoint][iVar] = Stress[2]; iVar++; + + if (geometry->GetnDim() == 3) { + /*--- Sigma zz ---*/ + Local_Data[jPoint][iVar] = Stress[3]; iVar++; + /*--- Sigma xz ---*/ + Local_Data[jPoint][iVar] = Stress[4]; iVar++; + /*--- Sigma yz ---*/ + Local_Data[jPoint][iVar] = Stress[5]; iVar++; + } - /*--- Add the Von Mises Stress. ---*/ + /*--- Add the Von Mises Stress. ---*/ - Local_Data[iPoint][iVar] = solver[FEA_SOL]->node[iPoint]->GetVonMises_Stress(); iVar++; + Local_Data[iPoint][iVar] = solver[FEA_SOL]->node[iPoint]->GetVonMises_Stress(); iVar++; - /*--- New variables can be loaded to the Local_Data structure here, + /*--- New variables can be loaded to the Local_Data structure here, assuming they were registered above correctly. ---*/ - - } - + } + + /*--- Increment the point counter, as there may have been halos we skipped over during the data loading. ---*/ @@ -14674,7 +14588,7 @@ void COutput::LoadLocalData_Elasticity(CConfig *config, CGeometry *geometry, CSo } -void COutput::LoadLocalData_Base(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::LoadLocalData_Base(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short iDim; @@ -14729,23 +14643,22 @@ void COutput::LoadLocalData_Base(CConfig *config, CGeometry *geometry, CSolver * /*--- If requested, register the residuals for all of the equations in the current problem. ---*/ - if (!config->GetLow_MemoryOutput()) { - - /*--- Add the residuals ---*/ - - if (config->GetWrt_Residuals()) { - nVar_Par += nVar_Consv_Par; - for (iVar = 0; iVar < nVar_Consv_Par; iVar++) { - varname << "Residual_" << iVar+1; - Variable_Names.push_back(varname.str()); - varname.str(""); - } + + /*--- Add the residuals ---*/ + + if (config->GetWrt_Residuals()) { + nVar_Par += nVar_Consv_Par; + for (iVar = 0; iVar < nVar_Consv_Par; iVar++) { + varname << "Residual_" << iVar+1; + Variable_Names.push_back(varname.str()); + varname.str(""); } - - /*--- New variables get registered here before the end of the loop. ---*/ - } + /*--- New variables get registered here before the end of the loop. ---*/ + + + /*--- Allocate the local data structure now that we know how many variables are in the output. ---*/ @@ -14820,15 +14733,14 @@ void COutput::LoadLocalData_Base(CConfig *config, CGeometry *geometry, CSolver * iVar++; } - if (!config->GetLow_MemoryOutput()) { - if (config->GetWrt_Residuals()) { - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); - iVar++; - } + if (config->GetWrt_Residuals()) { + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = solver[FirstIndex]->LinSysRes.GetBlock(iPoint, jVar); + iVar++; } } + /*--- New variables can be loaded to the Local_Data structure here, assuming they were registered above correctly. ---*/ @@ -14846,7 +14758,7 @@ void COutput::LoadLocalData_Base(CConfig *config, CGeometry *geometry, CSolver * } -void COutput::SortConnectivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone, bool val_sort) { +void COutputLegacy::SortConnectivity(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { /*--- Flags identifying the types of files to be written. ---*/ @@ -14864,12 +14776,12 @@ void COutput::SortConnectivity(CConfig *config, CGeometry *geometry, unsigned sh if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) cout <<"Sorting volumetric grid connectivity." << endl; - SortVolumetricConnectivity(config, geometry, TRIANGLE, val_sort); - SortVolumetricConnectivity(config, geometry, QUADRILATERAL, val_sort); - SortVolumetricConnectivity(config, geometry, TETRAHEDRON, val_sort); - SortVolumetricConnectivity(config, geometry, HEXAHEDRON, val_sort); - SortVolumetricConnectivity(config, geometry, PRISM, val_sort); - SortVolumetricConnectivity(config, geometry, PYRAMID, val_sort); + SortVolumetricConnectivity(config, geometry, TRIANGLE ); + SortVolumetricConnectivity(config, geometry, QUADRILATERAL); + SortVolumetricConnectivity(config, geometry, TETRAHEDRON ); + SortVolumetricConnectivity(config, geometry, HEXAHEDRON ); + SortVolumetricConnectivity(config, geometry, PRISM ); + SortVolumetricConnectivity(config, geometry, PYRAMID ); } @@ -14900,10 +14812,7 @@ void COutput::SortConnectivity(CConfig *config, CGeometry *geometry, unsigned sh } -void COutput::SortVolumetricConnectivity(CConfig *config, - CGeometry *geometry, - unsigned short Elem_Type, - bool val_sort) { +void COutputLegacy::SortVolumetricConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { unsigned long iProcessor; unsigned short NODES_PER_ELEMENT = 0; @@ -15170,23 +15079,15 @@ void COutput::SortVolumetricConnectivity(CConfig *config, if (newID < Global_Index) Global_Index = newID; } - /*--- Search for the processor that owns this point. If we are - sorting the elements, we use the linear partitioning to find - the rank, otherwise, we simply have the current rank load its - own elements into the connectivity data structure. ---*/ + /*--- Search for the processor that owns this point ---*/ - if (val_sort) { - iProcessor = Global_Index/npoint_procs[0]; - if (iProcessor >= (unsigned long)size) - iProcessor = (unsigned long)size-1; - if (Global_Index >= nPoint_Linear[iProcessor]) - while(Global_Index >= nPoint_Linear[iProcessor+1]) iProcessor++; - else - while(Global_Index < nPoint_Linear[iProcessor]) iProcessor--; - } else { - iProcessor = rank; - } - + iProcessor = Global_Index/npoint_procs[0]; + if (iProcessor >= (unsigned long)size) + iProcessor = (unsigned long)size-1; + if (Global_Index >= nPoint_Linear[iProcessor]) + while(Global_Index >= nPoint_Linear[iProcessor+1]) iProcessor++; + else + while(Global_Index < nPoint_Linear[iProcessor]) iProcessor--; /*--- If we have not visited this element yet, increment our number of elements that must be sent to a particular proc. ---*/ @@ -15271,24 +15172,17 @@ void COutput::SortVolumetricConnectivity(CConfig *config, unsigned long newID = geometry->node[jPoint]->GetGlobalIndex(); if (newID < Global_Index) Global_Index = newID; } - - /*--- Search for the processor that owns this point. If we are - sorting the elements, we use the linear partitioning to find - the rank, otherwise, we simply have the current rank load its - own elements into the connectivity data structure. ---*/ - - if (val_sort) { - iProcessor = Global_Index/npoint_procs[0]; - if (iProcessor >= (unsigned long)size) - iProcessor = (unsigned long)size-1; - if (Global_Index >= nPoint_Linear[iProcessor]) - while(Global_Index >= nPoint_Linear[iProcessor+1]) iProcessor++; - else - while(Global_Index < nPoint_Linear[iProcessor]) iProcessor--; - } else { - iProcessor = rank; - } - + + /*--- Search for the processor that owns this point ---*/ + + iProcessor = Global_Index/npoint_procs[0]; + if (iProcessor >= (unsigned long)size) + iProcessor = (unsigned long)size-1; + if (Global_Index >= nPoint_Linear[iProcessor]) + while(Global_Index >= nPoint_Linear[iProcessor+1]) iProcessor++; + else + while(Global_Index < nPoint_Linear[iProcessor]) iProcessor--; + /*--- Load connectivity into the buffer for sending ---*/ if (nElem_Flag[iProcessor] != ii) { @@ -15511,7 +15405,7 @@ void COutput::SortVolumetricConnectivity(CConfig *config, } -void COutput::SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { unsigned long iProcessor; unsigned short NODES_PER_ELEMENT; @@ -16097,7 +15991,7 @@ void COutput::SortSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsi } -void COutput::SortOutputData(CConfig *config, CGeometry *geometry) { +void COutputLegacy::SortOutputData(CConfig *config, CGeometry *geometry) { unsigned short iMarker; unsigned long iProcessor; @@ -16502,7 +16396,7 @@ void COutput::SortOutputData(CConfig *config, CGeometry *geometry) { } -void COutput::SortOutputData_Surface(CConfig *config, CGeometry *geometry) { +void COutputLegacy::SortOutputData_Surface(CConfig *config, CGeometry *geometry) { unsigned short iMarker; unsigned long iProcessor; @@ -17905,19 +17799,17 @@ void COutput::SortOutputData_Surface(CConfig *config, CGeometry *geometry) { } -void COutput::WriteRestart_Parallel_ASCII(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_iInst) { +void COutputLegacy::WriteRestart_Parallel_ASCII(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_iInst) { /*--- Local variables ---*/ unsigned short nZone = geometry->GetnZone(), nInst = config->GetnTimeInstances(); unsigned short iVar; - unsigned long iPoint, iExtIter = config->GetExtIter(); + unsigned long iPoint, iExtIter = config->GetInnerIter(); bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); bool disc_adj_fem = (config->GetKind_Solver() == DISC_ADJ_FEM); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); ofstream restart_file; string filename; @@ -17925,32 +17817,32 @@ void COutput::WriteRestart_Parallel_ASCII(CConfig *config, CGeometry *geometry, /*--- Retrieve filename from config ---*/ - if ((config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint())) { - filename = config->GetRestart_AdjFileName(); - filename = config->GetObjFunc_Extension(filename); - } else if (fem) { - filename = config->GetRestart_FEMFileName(); - } else if (disc_adj_fem){ - filename = config->GetRestart_AdjFEMFileName(); - } else { - filename = config->GetRestart_FlowFileName(); - } +// if ((config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint())) { +// filename = config->GetRestart_AdjFileName(); +// filename = config->GetObjFunc_Extension(filename); +// } else if (fem) { +// filename = config->GetRestart_FEMFileName(); +// } else if (disc_adj_fem){ +// filename = config->GetRestart_AdjFEMFileName(); +// } else { +// filename = config->GetRestart_FileName(); +// } /*--- Append the zone number if multizone problems ---*/ if (nZone > 1) - filename= config->GetMultizone_FileName(filename, val_iZone); + filename= config->GetMultizone_FileName(filename, val_iZone, ".dat"); /*--- Append the zone number if multiple instance problems ---*/ if (nInst > 1) - filename= config->GetMultiInstance_FileName(filename, val_iInst); + filename= config->GetMultiInstance_FileName(filename, val_iInst, ".dat"); /*--- Unsteady problems require an iteration number to be appended. ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(val_iInst)); - } else if (config->GetWrt_Unsteady()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + if (config->GetTime_Marching() == HARMONIC_BALANCE) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(val_iInst), ".dat"); + } else if (config->GetTime_Domain()) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter), ".dat"); } else if ((fem || disc_adj_fem) && (config->GetWrt_Dynamic())) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter), ".dat"); } /*--- Only the master node writes the header. ---*/ @@ -18016,10 +17908,10 @@ void COutput::WriteRestart_Parallel_ASCII(CConfig *config, CGeometry *geometry, /*--- Write the metadata (master rank alone) ----*/ if (rank == MASTER_NODE) { - if (dual_time) - restart_file <<"EXT_ITER= " << config->GetExtIter() + 1 << endl; - else - restart_file <<"EXT_ITER= " << config->GetExtIter() + config->GetExtIter_OffSet() + 1 << endl; +// if (dual_time) + restart_file <<"EXT_ITER= " << config->GetInnerIter() + 1 << endl; +// else +// restart_file <<"EXT_ITER= " << config->GetInnerIter() + config->GetInnerIter_OffSet() + 1 << endl; restart_file <<"AOA= " << config->GetAoA() - config->GetAoA_Offset() << endl; restart_file <<"SIDESLIP_ANGLE= " << config->GetAoS() - config->GetAoS_Offset() << endl; restart_file <<"INITIAL_BCTHRUST= " << config->GetInitial_BCThrust() << endl; @@ -18044,17 +17936,17 @@ void COutput::WriteRestart_Parallel_ASCII(CConfig *config, CGeometry *geometry, } -void COutput::WriteRestart_Parallel_Binary(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_iInst) { +void COutputLegacy::WriteRestart_Parallel_Binary(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_iInst) { /*--- Local variables ---*/ unsigned short iVar, nZone = geometry->GetnZone(), nInst = config->GetnTimeInstances(); - unsigned long iPoint, iExtIter = config->GetExtIter(); + unsigned long iPoint, iExtIter = config->GetInnerIter(); bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool wrt_perf = config->GetWrt_Performance(); ofstream restart_file; string filename; @@ -18063,30 +17955,30 @@ void COutput::WriteRestart_Parallel_Binary(CConfig *config, CGeometry *geometry, /*--- Retrieve filename from config ---*/ - if ((config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint())) { - filename = config->GetRestart_AdjFileName(); - filename = config->GetObjFunc_Extension(filename); - } else if (fem) { - filename = config->GetRestart_FEMFileName(); - } else { - filename = config->GetRestart_FlowFileName(); - } +// if ((config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint())) { +// filename = config->GetRestart_AdjFileName(); +// filename = config->GetObjFunc_Extension(filename); +// } else if (fem) { +// filename = config->GetRestart_FEMFileName(); +// } else { +// filename = config->GetRestart_FileName(); +// } /*--- Append the zone number if multizone problems ---*/ if (nZone > 1) - filename= config->GetMultizone_FileName(filename, val_iZone); + filename= config->GetMultizone_FileName(filename, val_iZone, ".dat"); /*--- Append the zone number if multiple instance problems ---*/ if (nInst > 1) - filename= config->GetMultiInstance_FileName(filename, val_iInst); + filename= config->GetMultiInstance_FileName(filename, val_iInst, ".dat"); /*--- Unsteady problems require an iteration number to be appended. ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(val_iInst)); - } else if (config->GetWrt_Unsteady()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + if (config->GetTime_Marching() == HARMONIC_BALANCE) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(val_iInst), ".dat"); + } else if (config->GetTime_Domain()) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter), ".dat"); } else if ((fem) && (config->GetWrt_Dynamic())) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter), ".dat"); } strcpy(fname, filename.c_str()); @@ -18115,9 +18007,9 @@ void COutput::WriteRestart_Parallel_Binary(CConfig *config, CGeometry *geometry, int Restart_ExtIter; if (dual_time) - Restart_ExtIter= (int)config->GetExtIter() + 1; + Restart_ExtIter= (int)config->GetInnerIter() + 1; else - Restart_ExtIter = (int)config->GetExtIter() + (int)config->GetExtIter_OffSet() + 1; + Restart_ExtIter = (int)config->GetInnerIter() + (int)config->GetExtIter_OffSet() + 1; passivedouble Restart_Metadata[8] = { SU2_TYPE::GetValue(config->GetAoA() - config->GetAoA_Offset()), @@ -18339,7 +18231,7 @@ void COutput::WriteRestart_Parallel_Binary(CConfig *config, CGeometry *geometry, } -void COutput::WriteCSV_Slice(CConfig *config, CGeometry *geometry, +void COutputLegacy::WriteCSV_Slice(CConfig *config, CGeometry *geometry, CSolver *FlowSolver, unsigned long iExtIter, unsigned short val_iZone, unsigned short val_direction) { @@ -18590,7 +18482,7 @@ void COutput::WriteCSV_Slice(CConfig *config, CGeometry *geometry, } -void COutput::DeallocateConnectivity_Parallel(CConfig *config, CGeometry *geometry, bool surf_sol) { +void COutputLegacy::DeallocateConnectivity_Parallel(CConfig *config, CGeometry *geometry, bool surf_sol) { /*--- Deallocate memory for connectivity data on each processor. ---*/ @@ -18610,7 +18502,7 @@ void COutput::DeallocateConnectivity_Parallel(CConfig *config, CGeometry *geomet } -void COutput::DeallocateData_Parallel(CConfig *config, CGeometry *geometry) { +void COutputLegacy::DeallocateData_Parallel(CConfig *config, CGeometry *geometry) { /*--- Deallocate memory for solution data ---*/ @@ -18631,7 +18523,7 @@ void COutput::DeallocateData_Parallel(CConfig *config, CGeometry *geometry) { } -void COutput::DeallocateSurfaceData_Parallel(CConfig *config, CGeometry *geometry) { +void COutputLegacy::DeallocateSurfaceData_Parallel(CConfig *config, CGeometry *geometry) { /*--- Deallocate memory for surface solution data ---*/ @@ -18642,7 +18534,7 @@ void COutput::DeallocateSurfaceData_Parallel(CConfig *config, CGeometry *geometr } -void COutput::MergeInletCoordinates(CConfig *config, CGeometry *geometry) { +void COutputLegacy::MergeInletCoordinates(CConfig *config, CGeometry *geometry) { /*--- Local variables needed on all processors ---*/ @@ -18919,7 +18811,7 @@ void COutput::MergeInletCoordinates(CConfig *config, CGeometry *geometry) { } -void COutput::Write_InletFile_Flow(CConfig *config, CGeometry *geometry, CSolver **solver) { +void COutputLegacy::Write_InletFile_Flow(CConfig *config, CGeometry *geometry, CSolver **solver) { unsigned short iMarker, iDim, iVar; unsigned long iPoint; @@ -19015,7 +18907,7 @@ void COutput::Write_InletFile_Flow(CConfig *config, CGeometry *geometry, CSolver } -void COutput::DeallocateInletCoordinates(CConfig *config, CGeometry *geometry) { +void COutputLegacy::DeallocateInletCoordinates(CConfig *config, CGeometry *geometry) { unsigned short iDim, nDim = geometry->GetnDim(); @@ -19038,7 +18930,7 @@ void COutput::DeallocateInletCoordinates(CConfig *config, CGeometry *geometry) { } -void COutput::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { +void COutputLegacy::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) { unsigned short iDim, iMarker, iMarker_Analyze; unsigned long iVertex, iPoint; @@ -19550,7 +19442,7 @@ void COutput::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, } -void COutput::MergeConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { +void COutputLegacy::MergeConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { /*--- Flags identifying the types of files to be written. ---*/ @@ -19620,7 +19512,7 @@ void COutput::MergeConnectivity_FEM(CConfig *config, CGeometry *geometry, unsign } -void COutput::MergeCoordinates_FEM(CConfig *config, CGeometry *geometry) { +void COutputLegacy::MergeCoordinates_FEM(CConfig *config, CGeometry *geometry) { /*--- Local variables needed on all processors ---*/ @@ -19848,7 +19740,7 @@ void COutput::MergeCoordinates_FEM(CConfig *config, CGeometry *geometry) { } -void COutput::MergeVolumetricConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::MergeVolumetricConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { int iProcessor; unsigned short NODES_PER_ELEMENT = 0; @@ -20139,7 +20031,7 @@ void COutput::MergeVolumetricConnectivity_FEM(CConfig *config, CGeometry *geomet } -void COutput::MergeSurfaceConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::MergeSurfaceConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { unsigned short NODES_PER_ELEMENT = 0; @@ -20397,7 +20289,7 @@ void COutput::MergeSurfaceConnectivity_FEM(CConfig *config, CGeometry *geometry, } } -void COutput::MergeSolution_FEM(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::MergeSolution_FEM(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short Kind_Solver = config->GetKind_Solver(); unsigned short iVar = 0, FirstIndex = NONE, SecondIndex = NONE, ThirdIndex = NONE; @@ -20579,7 +20471,7 @@ void COutput::MergeSolution_FEM(CConfig *config, CGeometry *geometry, CSolver ** } -void COutput::MergeBaselineSolution_FEM(CConfig *config, CGeometry *geometry, CSolver *solver, unsigned short val_iZone) { +void COutputLegacy::MergeBaselineSolution_FEM(CConfig *config, CGeometry *geometry, CSolver *solver, unsigned short val_iZone) { /*--- Local variables needed on all processors ---*/ unsigned short iVar; @@ -20747,7 +20639,7 @@ void COutput::MergeBaselineSolution_FEM(CConfig *config, CGeometry *geometry, CS } -void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geometry, CConfig **config, +void COutputLegacy::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geometry, CConfig **config, unsigned long iExtIter, unsigned short val_nZone) { unsigned short iZone; @@ -20765,7 +20657,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo /*--- Get the file output format ---*/ - unsigned short FileFormat = config[iZone]->GetOutput_FileFormat(); + unsigned short FileFormat = config[iZone]->GetTabular_FileFormat(); /*--- Merge the node coordinates and connectivity, if necessary. This is only performed if a volume solution file is requested, and it @@ -20786,8 +20678,8 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo if ((rank == MASTER_NODE) && (Wrt_Vol || Wrt_Srf)) { if (FileFormat == TECPLOT_BINARY) { if (rank == MASTER_NODE) cout << "Writing Tecplot binary volume and surface mesh files." << endl; - SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][MESH_0], iZone); - SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][MESH_0], iZone); +// SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][MESH_0], iZone); +// SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][MESH_0], iZone); } } @@ -20816,43 +20708,27 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file volume solution file." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][MESH_0], solver_container[iZone][MESH_0], iZone, val_nZone, false); +// SetTecplotASCII(config[iZone], geometry[iZone][MESH_0], solver_container[iZone][MESH_0], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], false); break; - case FIELDVIEW: - - /*--- Write a FieldView ASCII file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView ASCII file volume solution file." << endl; - SetFieldViewASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone); - DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], false); - break; case TECPLOT_BINARY: /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot binary volume solution file." << endl; - SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][MESH_0], iZone); - DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], false); - break; - - case FIELDVIEW_BINARY: - - /*--- Write a FieldView binary file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView binary file volume solution file." << endl; - SetFieldViewBinary(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone); +// SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][MESH_0], iZone); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], false); break; + case PARAVIEW: /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII volume solution file." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], false); break; @@ -20862,7 +20738,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo if (rank == MASTER_NODE) cout << "ParaView binary volume files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII volume solution file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], false); break; @@ -20881,7 +20757,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII surface solution file." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][MESH_0], solver_container[iZone][MESH_0] , iZone, val_nZone, true); +// SetTecplotASCII(config[iZone], geometry[iZone][MESH_0], solver_container[iZone][MESH_0] , iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], true); break; @@ -20890,7 +20766,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot binary surface solution file." << endl; - SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][MESH_0], iZone); +// SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][MESH_0], iZone); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], true); break; @@ -20899,7 +20775,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII surface solution file." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], true); break; @@ -20909,7 +20785,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo if (rank == MASTER_NODE) cout << "ParaView binary surface files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII surface solution file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][MESH_0], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][MESH_0], true); break; @@ -20940,7 +20816,7 @@ void COutput::SetResult_Files_FEM(CSolver ****solver_container, CGeometry ***geo } } -void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geometry, CConfig **config, +void COutputLegacy::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geometry, CConfig **config, unsigned long iExtIter, unsigned short val_nZone) { unsigned short iZone, iInst, nInst; @@ -20960,7 +20836,7 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet /*--- Get the file output format ---*/ - unsigned short FileFormat = config[iZone]->GetOutput_FileFormat(); + unsigned short FileFormat = config[iZone]->GetTabular_FileFormat(); /*--- Merge the node coordinates and connectivity if necessary. This is only performed if a volume solution file is requested, and it @@ -20993,43 +20869,27 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file (volume grid)." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, false); +// SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); break; - case FIELDVIEW: - - /*--- Write a FieldView ASCII file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView ASCII file (volume grid)." << endl; - SetFieldViewASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone); - DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); - break; case TECPLOT_BINARY: /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot Binary file (volume grid)." << endl; - SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][iInst], iZone); - SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_DomainMesh(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_DomainSolution(config[iZone], geometry[iZone][iInst], iZone); break; - case FIELDVIEW_BINARY: - - /*--- Write a binary binary file ---*/ - - if (rank == MASTER_NODE) cout << "Writing FieldView ASCII file (volume grid)." << endl; - SetFieldViewBinary(config[iZone], geometry[iZone][iInst], iZone, val_nZone); - DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); - break; case PARAVIEW: /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII file (volume grid)." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); break; @@ -21039,7 +20899,7 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet if (rank == MASTER_NODE) cout << "ParaView binary (volume grid) files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, false); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], false); break; @@ -21058,7 +20918,7 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet /*--- Write a Tecplot ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot ASCII file (surface grid)." << endl; - SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, true); +// SetTecplotASCII(config[iZone], geometry[iZone][iInst], &solver[iZone][iInst], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], true); break; @@ -21067,8 +20927,8 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet /*--- Write a Tecplot binary solution file ---*/ if (rank == MASTER_NODE) cout << "Writing Tecplot Binary file (surface grid)." << endl; - SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][iInst], iZone); - SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_SurfaceMesh(config[iZone], geometry[iZone][iInst], iZone); +// SetTecplotBinary_SurfaceSolution(config[iZone], geometry[iZone][iInst], iZone); break; case PARAVIEW: @@ -21076,7 +20936,7 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet /*--- Write a Paraview ASCII file ---*/ if (rank == MASTER_NODE) cout << "Writing Paraview ASCII file (surface grid)." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], true); break; @@ -21086,7 +20946,7 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet if (rank == MASTER_NODE) cout << "ParaView binary (surface grid) files not available in this mode." << endl; if (rank == MASTER_NODE) cout << " Writing ParaView ASCII file instead." << endl; - SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); +// SetParaview_ASCII(config[iZone], geometry[iZone][iInst], iZone, val_nZone, true); DeallocateConnectivity(config[iZone], geometry[iZone][iInst], true); break; @@ -21116,7 +20976,7 @@ void COutput::SetBaselineResult_Files_FEM(CSolver ***solver, CGeometry ***geomet } } -void COutput::LoadLocalData_FEM(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { +void COutputLegacy::LoadLocalData_FEM(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone) { unsigned short iDim; unsigned short Kind_Solver = config->GetKind_Solver(); @@ -21172,49 +21032,48 @@ void COutput::LoadLocalData_FEM(CConfig *config, CGeometry *geometry, CSolver ** /*--- Eventually, turbulence model from second container goes here. ---*/ - if (!config->GetLow_MemoryOutput()) { - - /*--- Add Pressure, Temperature, Cp, Mach. ---*/ - + + /*--- Add Pressure, Temperature, Cp, Mach. ---*/ + + nVar_Par += 1; + Variable_Names.push_back("Pressure"); + + nVar_Par += 3; + Variable_Names.push_back("Temperature"); + if (config->GetTabular_FileFormat() == TAB_CSV){ + Variable_Names.push_back("Pressure_Coefficient"); + } else { + Variable_Names.push_back("Cp"); + } + Variable_Names.push_back("Mach"); + + if ((Kind_Solver == FEM_NAVIER_STOKES) || (Kind_Solver == FEM_LES)){ nVar_Par += 1; - Variable_Names.push_back("Pressure"); - - nVar_Par += 3; - Variable_Names.push_back("Temperature"); - if (config->GetOutput_FileFormat() == PARAVIEW){ - Variable_Names.push_back("Pressure_Coefficient"); - } else { - Variable_Names.push_back("Cp"); - } - Variable_Names.push_back("Mach"); - - if ((Kind_Solver == FEM_NAVIER_STOKES) || (Kind_Solver == FEM_LES)){ - nVar_Par += 1; - Variable_Names.push_back("Laminar_Viscosity"); - } - if ((Kind_Solver == FEM_LES) && (config->GetKind_SGS_Model() != IMPLICIT_LES)){ - nVar_Par += 1; - Variable_Names.push_back("Eddy_Viscosity"); - } - - if (solver[FLOW_SOL]->VerificationSolution) { - if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - nVar_Par += 2*nVar_Consv_Par; - Variable_Names.push_back("Verification_Density"); - Variable_Names.push_back("Verification_Momentum_x"); - Variable_Names.push_back("Verification_Momentum_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Verification_Momentum_z"); - Variable_Names.push_back("Verification_Energy"); - Variable_Names.push_back("Error_Density"); - Variable_Names.push_back("Error_Momentum_x"); - Variable_Names.push_back("Error_Momentum_y"); - if (geometry->GetnDim() == 3) Variable_Names.push_back("Error_Momentum_z"); - Variable_Names.push_back("Error_Energy"); - } + Variable_Names.push_back("Laminar_Viscosity"); + } + if ((Kind_Solver == FEM_LES) && (config->GetKind_SGS_Model() != IMPLICIT_LES)){ + nVar_Par += 1; + Variable_Names.push_back("Eddy_Viscosity"); + } + + if (solver[FLOW_SOL]->VerificationSolution) { + if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { + nVar_Par += 2*nVar_Consv_Par; + Variable_Names.push_back("Verification_Density"); + Variable_Names.push_back("Verification_Momentum_x"); + Variable_Names.push_back("Verification_Momentum_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Verification_Momentum_z"); + Variable_Names.push_back("Verification_Energy"); + Variable_Names.push_back("Error_Density"); + Variable_Names.push_back("Error_Momentum_x"); + Variable_Names.push_back("Error_Momentum_y"); + if (geometry->GetnDim() == 3) Variable_Names.push_back("Error_Momentum_z"); + Variable_Names.push_back("Error_Energy"); } - - /*--- New variables get registered here before the end of the loop. ---*/ } + + /*--- New variables get registered here before the end of the loop. ---*/ + /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ @@ -21259,99 +21118,97 @@ void COutput::LoadLocalData_FEM(CConfig *config, CGeometry *geometry, CSolver ** const unsigned long offset = nVar_First*volElem[l].offsetDOFsSolLocal; su2double *solDOFs = solver[FirstIndex]->GetVecSolDOFs() + offset; - + for(unsigned short j=0; jGetLow_MemoryOutput()) { - - /*--- Prepare the primitive states. ---*/ - - const su2double DensityInv = 1.0/U[0]; - su2double vel[3], Velocity2 = 0.0; - for(iDim=0; iDimSetTDState_rhoe(U[0], StaticEnergy); - - /*--- Load data for the pressure, temperature, Cp, and Mach variables. ---*/ - - Local_Data[jPoint][iVar] = DGFluidModel->GetPressure(); iVar++; - Local_Data[jPoint][iVar] = DGFluidModel->GetTemperature(); iVar++; - Local_Data[jPoint][iVar] = DGFluidModel->GetCp(); iVar++; - Local_Data[jPoint][iVar] = sqrt(Velocity2)/DGFluidModel->GetSoundSpeed(); iVar++; - - if ((Kind_Solver == FEM_NAVIER_STOKES) || (Kind_Solver == FEM_LES)){ - Local_Data[jPoint][iVar] = DGFluidModel->GetLaminarViscosity(); iVar++; - } - if ((Kind_Solver == FEM_LES) && (config->GetKind_SGS_Model() != IMPLICIT_LES)){ - // todo: Export Eddy instead of Laminar viscosity - Local_Data[jPoint][iVar] = DGFluidModel->GetLaminarViscosity(); iVar++; - } - - if (solver[FLOW_SOL]->VerificationSolution) { - if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { - - /*--- Get the physical time if necessary. ---*/ - su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); - - /* Get the verification solution. */ - su2double mmsSol[5]; - solver[FLOW_SOL]->VerificationSolution->GetSolution(coor, time, mmsSol); - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = mmsSol[jVar]; - iVar++; - } - - /* Get local error from the verification solution class. */ - su2double error[5]; - solver[FLOW_SOL]->VerificationSolution->GetLocalError(coor, time, U, error); - for (jVar = 0; jVar < nVar_First; jVar++) { - Local_Data[jPoint][iVar] = error[jVar]; - iVar++; - } + + /*--- Prepare the primitive states. ---*/ + + const su2double DensityInv = 1.0/U[0]; + su2double vel[3], Velocity2 = 0.0; + for(iDim=0; iDimSetTDState_rhoe(U[0], StaticEnergy); + + /*--- Load data for the pressure, temperature, Cp, and Mach variables. ---*/ + + Local_Data[jPoint][iVar] = DGFluidModel->GetPressure(); iVar++; + Local_Data[jPoint][iVar] = DGFluidModel->GetTemperature(); iVar++; + Local_Data[jPoint][iVar] = DGFluidModel->GetCp(); iVar++; + Local_Data[jPoint][iVar] = sqrt(Velocity2)/DGFluidModel->GetSoundSpeed(); iVar++; + + if ((Kind_Solver == FEM_NAVIER_STOKES) || (Kind_Solver == FEM_LES)){ + Local_Data[jPoint][iVar] = DGFluidModel->GetLaminarViscosity(); iVar++; + } + if ((Kind_Solver == FEM_LES) && (config->GetKind_SGS_Model() != IMPLICIT_LES)){ + // todo: Export Eddy instead of Laminar viscosity + Local_Data[jPoint][iVar] = DGFluidModel->GetLaminarViscosity(); iVar++; + } + + if (solver[FLOW_SOL]->VerificationSolution) { + if (solver[FLOW_SOL]->VerificationSolution->ExactSolutionKnown()) { + + /*--- Get the physical time if necessary. ---*/ + su2double time = 0.0; + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + + /* Get the verification solution. */ + su2double mmsSol[5]; + solver[FLOW_SOL]->VerificationSolution->GetSolution(coor, time, mmsSol); + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = mmsSol[jVar]; + iVar++; + } + + /* Get local error from the verification solution class. */ + su2double error[5]; + solver[FLOW_SOL]->VerificationSolution->GetLocalError(coor, time, U, error); + for (jVar = 0; jVar < nVar_First; jVar++) { + Local_Data[jPoint][iVar] = error[jVar]; + iVar++; } } - - /*--- New variables can be loaded to the Local_Data structure here, - assuming they were registered above correctly. ---*/ - } - - /*--- Increment the point counter. ---*/ - - jPoint++; + + /*--- New variables can be loaded to the Local_Data structure here, + assuming they were registered above correctly. ---*/ + } + + /*--- Increment the point counter. ---*/ + + jPoint++; } + } -void COutput::PrepareOffsets(CConfig *config, CGeometry *geometry) { +void COutputLegacy::PrepareOffsets(CConfig *config, CGeometry *geometry) { unsigned long iPoint; @@ -21497,7 +21354,7 @@ void COutput::PrepareOffsets(CConfig *config, CGeometry *geometry) { } -void COutput::SortConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { +void COutputLegacy::SortConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { /*--- Flags identifying the types of files to be written. ---*/ @@ -21551,7 +21408,7 @@ void COutput::SortConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigne } -void COutput::SortVolumetricConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::SortVolumetricConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { /* Determine the number of nodes for this element type. */ unsigned short NODES_PER_ELEMENT = 0; @@ -21681,7 +21538,7 @@ void COutput::SortVolumetricConnectivity_FEM(CConfig *config, CGeometry *geometr } } -void COutput::SortSurfaceConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { +void COutputLegacy::SortSurfaceConnectivity_FEM(CConfig *config, CGeometry *geometry, unsigned short Elem_Type) { /* Determine the number of nodes for this element type. */ unsigned short NODES_PER_ELEMENT = 0; @@ -21794,7 +21651,7 @@ void COutput::SortSurfaceConnectivity_FEM(CConfig *config, CGeometry *geometry, } } -void COutput::SortOutputData_FEM(CConfig *config, CGeometry *geometry) { +void COutputLegacy::SortOutputData_FEM(CConfig *config, CGeometry *geometry) { unsigned long iProcessor; unsigned long iPoint, Global_Index; @@ -22132,7 +21989,7 @@ void COutput::SortOutputData_FEM(CConfig *config, CGeometry *geometry) { } -void COutput::SortOutputData_Surface_FEM(CConfig *config, CGeometry *geometry) { +void COutputLegacy::SortOutputData_Surface_FEM(CConfig *config, CGeometry *geometry) { const int VARS_PER_POINT = nVar_Par; diff --git a/SU2_CFD/src/output_cgns.cpp b/SU2_CFD/src/output_cgns.cpp deleted file mode 100644 index 58fdbd319545..000000000000 --- a/SU2_CFD/src/output_cgns.cpp +++ /dev/null @@ -1,517 +0,0 @@ -/*! - * \file output_cgns.cpp - * \brief Main subroutines for output solver information - * \author T. Economon, M. Colonno - * \version 6.2.0 "Falcon" - * - * The current SU2 release has been coordinated by the - * SU2 International Developers Society - * with selected contributions from the open-source community. - * - * The main research teams contributing to the current release are: - * - Prof. Juan J. Alonso's group at Stanford University. - * - Prof. Piero Colonna's group at Delft University of Technology. - * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. - * - Prof. Alberto Guardone's group at Polytechnic University of Milan. - * - Prof. Rafael Palacios' group at Imperial College London. - * - Prof. Vincent Terrapon's group at the University of Liege. - * - Prof. Edwin van der Weide's group at the University of Twente. - * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. - * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, - * Tim Albring, and the SU2 contributors. - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../include/output_structure.hpp" - -void COutput::SetCGNS_Coordinates(CConfig *config, CGeometry *geometry, unsigned short iZone) { - -#ifdef HAVE_CGNS - - /*--- local CGNS variables ---*/ - int cgns_file, cgns_coord, element_dims, physical_dims, cgns_err; - unsigned long iExtIter = config->GetExtIter(); - string base_file, buffer, elements_name; - stringstream name, results_file; - bool unsteady = config->GetUnsteady_Simulation(); - cgsize_t isize[3][1]; - - /*--- Create CGNS base file name ---*/ - base_file = config->GetFlow_FileName(); - - /*--- Add CGNS extension. ---*/ - base_file = base_file.append(".cgns"); - - /*--- Create CGNS results file name ---*/ - if (unsteady) { - - buffer = config->GetFlow_FileName(); - - results_file.str(string()); results_file << buffer; - if (((int)iExtIter >= 0) && ((int)iExtIter < 10)) results_file << "_0000" << iExtIter; - if (((int)iExtIter >= 10) && ((int)iExtIter < 100)) results_file << "_000" << iExtIter; - if (((int)iExtIter >= 100) && ((int)iExtIter < 1000)) results_file << "_00" << iExtIter; - if (((int)iExtIter >= 1000) && ((int)iExtIter < 10000)) results_file << "_0" << iExtIter; - if ((int)iExtIter >= 10000) results_file << iExtIter; - results_file << ".cgns"; - } - - /*--- Write base file if not already done ---*/ - if (!wrote_base_file) { - - /*--- Write base file ---*/ - cgns_err = cg_open((char *)base_file.c_str(), CG_MODE_MODIFY, &cgns_file); - if (cgns_err) cg_error_print(); - - element_dims = geometry->GetnDim(); // Currently (release 2.0) only all-2D or all-3D zones permitted - physical_dims = element_dims; - - isize[0][0] = (cgsize_t)nGlobal_Poin; // vertex size - isize[1][0] = (cgsize_t)nGlobal_Elem; // cell size - isize[2][0] = 0; // boundary vertex size (zero if elements not sorted) - - cgns_err = cg_goto(cgns_file, cgns_base,"Zone_t", cgns_zone,"end"); - if (cgns_err) cg_error_print(); - - - /*--- write CGNS node coordinates ---*/ - cgns_err = cg_coord_write(cgns_file, cgns_base, cgns_zone, RealDouble,"CoordinateX", Coords[0], &cgns_coord); - if (cgns_err) cg_error_print(); - cgns_err = cg_coord_write(cgns_file, cgns_base, cgns_zone, RealDouble,"CoordinateY", Coords[1], &cgns_coord); - if (cgns_err) cg_error_print(); - if (geometry->GetnDim() == 3) { - cgns_err = cg_coord_write(cgns_file, cgns_base, cgns_zone, RealDouble,"CoordinateZ", Coords[2], &cgns_coord); - if (cgns_err) cg_error_print(); - } - - cgns_err = cg_close(cgns_file); - if (cgns_err) cg_error_print(); - - wrote_base_file = true; - - } - - /*--- Set up results file for this time step if necessary ---*/ - if (unsteady) { - - cgns_err = cg_open((char *)results_file.str().c_str(), CG_MODE_WRITE, &cgns_file); - - element_dims = geometry->GetnDim(); // Currently only all-2D or all-3D zones permitted - physical_dims = element_dims; - - /*--- write CGNS base data (one base assumed currently) ---*/ - cgns_err = cg_base_write(cgns_file,"SU2 Base", element_dims, physical_dims, &cgns_base_results); - if (cgns_err) cg_error_print(); - - isize[0][0] = (cgsize_t)geometry->GetGlobal_nPointDomain(); // vertex size - isize[1][0] = (cgsize_t)nGlobal_Elem; // cell size - isize[2][0] = 0; // boundary vertex size (zero if elements not sorted) - - /*--- write CGNS zone data ---*/ - cgns_err = cg_zone_write(cgns_file, cgns_base_results,"SU2 Zone", isize[0],Unstructured, &cgns_zone_results); - if (cgns_err) cg_error_print(); - - cgns_err = cg_goto(cgns_file, cgns_base_results,"Zone_t", cgns_zone_results,"end"); - if (cgns_err) cg_error_print(); - - /*--- Write CGNS node coordinates, if appliciable ---*/ - if (config->GetGrid_Movement()) { - - /*--- write CGNS node coordinates ---*/ - cgns_err = cg_coord_write(cgns_file, cgns_base_results, cgns_zone_results, RealDouble,"x", Coords[0], &cgns_coord); - if (cgns_err) cg_error_print(); - cgns_err = cg_coord_write(cgns_file, cgns_base_results, cgns_zone_results, RealDouble,"y", Coords[1], &cgns_coord); - if (cgns_err) cg_error_print(); - if (geometry->GetnDim() == 3) { - cgns_err = cg_coord_write(cgns_file, cgns_base_results, cgns_zone_results, RealDouble,"z", Coords[2], &cgns_coord); - if (cgns_err) cg_error_print(); - } - } - else { - /*--- Write a CGNS link for the node coordinates ---*/ - cgns_err = cg_link_write("GridCoordinates",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/GridCoordinates"); - if (cgns_err) cg_error_print(); - } - - /*--- Write a CGNS link for each element type connectivity ---*/ - if (nGlobal_Tria > 0) cgns_err = cg_link_write("Triangle Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Triangle Elements"); - if (nGlobal_Quad > 0) cgns_err = cg_link_write("Quadrilateral Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Quadrilateral Elements"); - if (nGlobal_Tetr > 0) cgns_err = cg_link_write("Tetrahedral Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Tetrahedral Elements"); - if (nGlobal_Hexa > 0) cgns_err = cg_link_write("Hexahedral Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Hexahedral Elements"); - if (nGlobal_Pyra > 0) cgns_err = cg_link_write("Pyramid Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Pyramid Elements"); - if (nGlobal_Pris > 0) cgns_err = cg_link_write("Prism Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Prism Elements"); - if (nGlobal_Line > 0) cgns_err = cg_link_write("Line Elements",(char *)base_file.c_str(),"/SU2 Base/SU2 Zone/Line Elements"); - if (cgns_err) cg_error_print(); - - - /*--- Close CGNS file ---*/ - cgns_err = cg_close(cgns_file); - if (cgns_err) cg_error_print(); - - } - - - -#else // Not built with CGNS support - - cout << "CGNS file requested but SU2 was built without CGNS support. No file written" << "\n"; - -#endif - -} - -void COutput::SetCGNS_Connectivity(CConfig *config, CGeometry *geometry, unsigned short iZone) { - -#ifdef HAVE_CGNS - - /*--- local CGNS variables ---*/ - int cgns_file, element_dims, physical_dims, cgns_err; - int cgns_section; - unsigned long iExtIter = config->GetExtIter(); - string base_file, buffer, elements_name; - stringstream name, results_file; - bool unsteady = config->GetUnsteady_Simulation(); - cgsize_t isize[3][1], elem_start, elem_end; - - /*--- Create CGNS base file name ---*/ - base_file = config->GetFlow_FileName(); - - /*--- Add CGNS extension. ---*/ - base_file = base_file.append(".cgns"); - - /*--- Create CGNS results file name ---*/ - if (unsteady) { - - buffer = config->GetFlow_FileName(); - - results_file.str(string()); results_file << buffer; - if (((int)iExtIter >= 0) && ((int)iExtIter < 10)) results_file << "_0000" << iExtIter; - if (((int)iExtIter >= 10) && ((int)iExtIter < 100)) results_file << "_000" << iExtIter; - if (((int)iExtIter >= 100) && ((int)iExtIter < 1000)) results_file << "_00" << iExtIter; - if (((int)iExtIter >= 1000) && ((int)iExtIter < 10000)) results_file << "_0" << iExtIter; - if ((int)iExtIter >= 10000) results_file << iExtIter; - results_file << ".cgns"; - } - - /*--- Write base file if not already done ---*/ - if (!wrote_base_file) { - - /*--- Write base file ---*/ - cgns_err = cg_open((char *)base_file.c_str(), CG_MODE_WRITE, &cgns_file); - if (cgns_err) cg_error_print(); - - element_dims = geometry->GetnDim(); // Currently only all-2D or all-3D zones permitted - physical_dims = element_dims; - - /*--- write CGNS base data (one base assumed currently) ---*/ - cgns_err = cg_base_write(cgns_file,"SU2 Base", element_dims, physical_dims, &cgns_base); - if (cgns_err) cg_error_print(); - - /*--- write CGNS descriptor data ---*/ - cgns_err = cg_goto(cgns_file, cgns_base,"end"); - if (cgns_err) cg_error_print(); - - cgns_err = cg_equationset_write(physical_dims); - if (cgns_err) cg_error_print(); - - /*--- Write governing equations to CGNS file ---*/ - cgns_err = cg_goto(cgns_file, cgns_base,"FlowEquationSet_t",1,"end"); - if (cgns_err) cg_error_print(); - switch (config->GetKind_Solver()) { - case EULER: - cgns_err = cg_governing_write(Euler); break; - case NAVIER_STOKES: - cgns_err = cg_governing_write(NSLaminar); break; - case RANS: - cgns_err = cg_governing_write(NSTurbulent); break; - default: - break; // cgns_err = cg_governing_write(CG_UserDefined); - } - if (cgns_err) cg_error_print(); - - if (unsteady) cgns_err = cg_simulation_type_write(cgns_file, cgns_base, TimeAccurate); - else cgns_err = cg_simulation_type_write(cgns_file, cgns_base, NonTimeAccurate); - if (cgns_err) cg_error_print(); - - cgns_err = cg_descriptor_write("Solver Information","SU2"); - if (cgns_err) cg_error_print(); - - isize[0][0] = (cgsize_t)geometry->GetGlobal_nPointDomain(); //; // vertex size - isize[1][0] = (cgsize_t)nGlobal_Elem; // cell size - isize[2][0] = 0; // boundary vertex size (zero if elements not sorted) - - /*--- write CGNS zone data ---*/ - cgns_err = cg_zone_write(cgns_file, cgns_base,"SU2 Zone", isize[0],Unstructured, &cgns_zone); - if (cgns_err) cg_error_print(); - - cgns_err = cg_goto(cgns_file, cgns_base,"Zone_t", cgns_zone,"end"); - if (cgns_err) cg_error_print(); - - /*--- Reference Note: CGNS element type list: - NODE, BAR_2, BAR_3, TRI_3, TRI_6, QUAD_4, QUAD_8, QUAD_9, TETRA_4, TETRA_10, PYRA_5, - PYRA_14, PENTA_6, PENTA_15, PENTA_18, HEXA_8, HEXA_20, HEXA_27, MIXED, PYRA_13, NGON_n, NFACE_n ---*/ - - /*--- Write a CGNS section for each element type ---*/ - // ier = cg_section_write(int fn, int B, int Z, char *ElementSectionName, ElementType_t type, - // cgsize_t start, cgsize_t end, int nbndry, cgsize_t *Elements, int *S); - - if (nGlobal_Tria > 0) { - elem_start = 1; elem_end = (int)nGlobal_Tria; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone, - "Triangle Elements", TRI_3, elem_start, elem_end, - 0,(cgsize_t *)Conn_Tria, &cgns_section); - } - if (nGlobal_Quad > 0) { - elem_start = 1; elem_end = (int)nGlobal_Quad; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone,"Quadrilateral Elements", QUAD_4, - elem_start, elem_end,0,(cgsize_t *)Conn_Quad, &cgns_section); - } - if (nGlobal_Tetr > 0) { - elem_start = 1; elem_end = (int)nGlobal_Tetr; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone,"Tetrahedral Elements", TETRA_4, - elem_start, elem_end,0,(cgsize_t *)Conn_Tetr, &cgns_section); - } - if (nGlobal_Hexa > 0) { - elem_start = 1; elem_end = (int)nGlobal_Hexa; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone,"Hexahedral Elements", HEXA_8, - elem_start, elem_end,0,(cgsize_t *)Conn_Hexa, &cgns_section); - } - if (nGlobal_Pyra > 0) { - elem_start = 1; elem_end = (int)nGlobal_Pyra; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone,"Pyramid Elements", PYRA_5, - elem_start, elem_end,0,(cgsize_t *)Conn_Pyra, &cgns_section); - } - if (nGlobal_Pris > 0) { - elem_start = 1; elem_end = (int)nGlobal_Pris; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone,"Prism Elements", PENTA_6, - elem_start, elem_end,0,(cgsize_t *)Conn_Pris, &cgns_section); - } - if (nGlobal_Line > 0) { - elem_start = 1; elem_end = (int)nGlobal_Line; - cgns_err = cg_section_write(cgns_file, cgns_base, cgns_zone,"Line Elements", BAR_2, - elem_start, elem_end,0,(cgsize_t *)Conn_Line, &cgns_section); - } - if (cgns_err) cg_error_print(); - - - cgns_err = cg_close(cgns_file); - if (cgns_err) cg_error_print(); - - } - -#else // Not built with CGNS support - - cout << "CGNS file requested but SU2 was built without CGNS support. No file written" << "\n"; - -#endif - -} - -void COutput::SetCGNS_Solution(CConfig *config, CGeometry *geometry, unsigned short iZone) { - -#ifdef HAVE_CGNS - - /*--- local CGNS variables ---*/ - int cgns_file, cgns_flow, cgns_field, cgns_err; -// int element_dims; - unsigned long jVar, iVar, iExtIter = config->GetExtIter(); - string base_file, buffer, elements_name; - stringstream name, results_file; - bool unsteady = config->GetUnsteady_Simulation(); - - bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); - - /*--- Create CGNS base file name ---*/ - base_file = config->GetFlow_FileName(); - - /*--- Add CGNS extension. ---*/ - base_file = base_file.append(".cgns"); - - /*--- Create CGNS results file name ---*/ - if (unsteady) { - - buffer = config->GetFlow_FileName(); - - results_file.str(string()); results_file << buffer; - if (((int)iExtIter >= 0) && ((int)iExtIter < 10)) results_file << "_0000" << iExtIter; - if (((int)iExtIter >= 10) && ((int)iExtIter < 100)) results_file << "_000" << iExtIter; - if (((int)iExtIter >= 100) && ((int)iExtIter < 1000)) results_file << "_00" << iExtIter; - if (((int)iExtIter >= 1000) && ((int)iExtIter < 10000)) results_file << "_0" << iExtIter; - if ((int)iExtIter >= 10000) results_file << iExtIter; - results_file << ".cgns"; - } - - if (!unsteady) { - - /*--- Write base file ---*/ - cgns_err = cg_open((char *)base_file.c_str(), CG_MODE_MODIFY, &cgns_file); - if (cgns_err) cg_error_print(); - -// element_dims = geometry->GetnDim(); // Currently (release 2.0) only all-2D or all-3D zones permitted - - /*--- write CGNS descriptor data ---*/ - cgns_err = cg_goto(cgns_file, cgns_base,"end"); - if (cgns_err) cg_error_print(); - - /*--- Create a CGNS solution node ---*/ - cgns_err = cg_sol_write(cgns_file, cgns_base, cgns_zone,"Solution", Vertex, &cgns_flow); - if (cgns_err) cg_error_print(); - - cgns_err = cg_goto(cgns_file, cgns_base,"Zone_t", cgns_zone,"FlowSolution_t", cgns_flow,"end"); - if (cgns_err) cg_error_print(); - - cgns_err = cg_gridlocation_write(Vertex); - if (cgns_err) cg_error_print(); - } - - - //wrote_CGNS_base = true; - else { - - /*--- Set up results file for this time step if necessary ---*/ - - cgns_err = cg_open((char *)results_file.str().c_str(), CG_MODE_MODIFY, &cgns_file); - -// element_dims = geometry->GetnDim(); // Currently (release 2.0) only all-2D or all-3D zones permitted -// -// /*--- write CGNS base data (one base assumed currently) ---*/ -// cgns_err = cg_base_write(cgns_file,"SU2 Base", element_dims, physical_dims, &cgns_base); -// if (cgns_err) cg_error_print(); - -// /*--- write CGNS zone data ---*/ -// cgns_err = cg_zone_write(cgns_file, cgns_base,"SU2 Zone", isize[0],Unstructured, &cgns_zone); -// if (cgns_err) cg_error_print(); - - cgns_err = cg_goto(cgns_file, cgns_base_results,"Zone_t", cgns_zone_results,"end"); - if (cgns_err) cg_error_print(); - - /*--- Write a CGNS solution node for this time step ---*/ - cgns_err = cg_sol_write(cgns_file, cgns_base_results, cgns_zone_results,"Solution", Vertex, &cgns_flow); - if (cgns_err) cg_error_print(); - - cgns_err = cg_goto(cgns_file, cgns_base_results,"Zone_t", cgns_zone_results,"FlowSolution_t", cgns_flow,"end"); - if (cgns_err) cg_error_print(); - - cgns_err = cg_gridlocation_write(Vertex); - if (cgns_err) cg_error_print(); - - cgns_base = cgns_base_results; - cgns_zone = cgns_zone_results; - } -// else { -// -// /*--- Open CGNS file for soltuion writing ---*/ -// cgns_err = cg_open((char *)base_file.c_str(), CG_MODE_MODIFY, &cgns_file); -// cgns_base = 1; cgns_zone = 1; cgns_flow = 1; // fix for multiple zones -// -// } - - /* Reference Note on solution variables: - index 0 --> (nVar_Consv-1) = Conservative Variables - nVar_Consv --> (2*nVar_Consv-1) = Conservative Variable Residuals - (2*nVar_Consv-1)+ = Additional p, M, T, laminar, eddy depending on solver used */ - - /*--- Write conservative variables to CGNS file ---*/ - for (iVar = 0; iVar < nVar_Consv; iVar++) { - name.str(string()); name << "Conservative Variable " << iVar+1; - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,(char *)name.str().c_str(), Data[iVar], &cgns_field); - if (cgns_err) cg_error_print(); - } - - /*--- Write primitive variable residuals to CGNS file ---*/ - if (config->GetWrt_Limiters()) { - for (jVar = 0; jVar < nVar_Consv; jVar++) { - name.str(string()); name << "Primitive Limiter " << jVar+1; - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,(char *)name.str().c_str(), Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - } - } - - /*--- Write conservative variable residuals to CGNS file ---*/ - if (config->GetWrt_Residuals()) { - for (jVar = 0; jVar < nVar_Consv; jVar++) { - name.str(string()); name << "Conservative Residual " << jVar+1; - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,(char *)name.str().c_str(), Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - } - } - - /*--- Write grid velocities to CGNS file, if applicable ---*/ - if (config->GetGrid_Movement()) { - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Grid Velocity X", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Grid Velocity Y", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - if (geometry->GetnDim() == 3) { - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Grid Velocity Z", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - } - } - - if (compressible) { - switch (config->GetKind_Solver()) { - - /*--- Write pressure and Mach data to CGNS file ---*/ - case EULER: - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Pressure", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Mach", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - break; - - /*--- Write temperature and laminar viscosity to CGNS file, if applicable ---*/ - case NAVIER_STOKES: - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Pressure", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Mach", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Temperature", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Viscosity", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - break; - - /*--- Write eddy viscosity to CGNS file, if applicable ---*/ - case RANS: - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Pressure", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Mach", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Temperature", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Viscosity", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - cgns_err = cg_field_write(cgns_file, cgns_base, cgns_zone, cgns_flow, RealDouble,"Eddy Viscosity", Data[iVar], &cgns_field); iVar++; - if (cgns_err) cg_error_print(); - break; - - default: - SU2_MPI::Error("Unrecognized equation type", CURRENT_FUNCTION); - break; - } - } - - /*--- Close CGNS file ---*/ - cgns_err = cg_close(cgns_file); - if (cgns_err) cg_error_print(); - -#else // Not built with CGNS support - - cout << "CGNS file requested but SU2 was built without CGNS support. No file written" << "\n"; - -#endif - -} diff --git a/SU2_CFD/src/output_fieldview.cpp b/SU2_CFD/src/output_fieldview.cpp deleted file mode 100644 index aae00826f164..000000000000 --- a/SU2_CFD/src/output_fieldview.cpp +++ /dev/null @@ -1,783 +0,0 @@ -/*! - * \file output_fieldview.cpp - * \brief Main subroutines for output solver information. - * \author F. Palacios, T. Economon, M. Colonno - * \version 6.2.0 "Falcon" - * - * The current SU2 release has been coordinated by the - * SU2 International Developers Society - * with selected contributions from the open-source community. - * - * The main research teams contributing to the current release are: - * - Prof. Juan J. Alonso's group at Stanford University. - * - Prof. Piero Colonna's group at Delft University of Technology. - * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. - * - Prof. Alberto Guardone's group at Polytechnic University of Milan. - * - Prof. Rafael Palacios' group at Imperial College London. - * - Prof. Vincent Terrapon's group at the University of Liege. - * - Prof. Edwin van der Weide's group at the University of Twente. - * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. - * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, - * Tim Albring, and the SU2 contributors. - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../include/output_structure.hpp" - -void COutput::SetFieldViewASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone) { - - unsigned short iDim, iVar, nDim = geometry->GetnDim(), ngrids = 1, nbvars, nvars; - unsigned short Kind_Solver = config->GetKind_Solver(); - - unsigned long iPoint, iElem, iNode, nbfaces; - - bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - - bool grid_movement = config->GetGrid_Movement(); - - char cstr[200], buffer[50]; - string filename, FieldName; - - /*--- Write file name with extension ---*/ - - if (adjoint) filename = config->GetAdj_FileName(); - else filename = config->GetFlow_FileName(); - - if (Kind_Solver == FEM_ELASTICITY) - filename = config->GetStructure_FileName().c_str(); - - if (Kind_Solver == HEAT_EQUATION_FVM) - filename = config->GetHeat_FileName().c_str(); - - - if (config->GetKind_SU2() == SU2_DOT) { - filename = config->GetVolSens_FileName().c_str(); - } - - strcpy (cstr, filename.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS) && - (val_nZone > 1) && (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } -// -// if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { -// -// if (config->GetKind_SU2() == SU2_SOL) { val_iZone = iExtIter; } -// -// if (SU2_TYPE::Int(val_iZone) < 10) SPRINTF (buffer, "_0000%d.uns", SU2_TYPE::Int(val_iZone)); -// if ((SU2_TYPE::Int(val_iZone) >= 10) && (SU2_TYPE::Int(val_iZone) < 100)) SPRINTF (buffer, "_000%d.uns", SU2_TYPE::Int(val_iZone)); -// if ((SU2_TYPE::Int(val_iZone) >= 100) && (SU2_TYPE::Int(val_iZone) < 1000)) SPRINTF (buffer, "_00%d.uns", SU2_TYPE::Int(val_iZone)); -// if ((SU2_TYPE::Int(val_iZone) >= 1000) && (SU2_TYPE::Int(val_iZone) < 10000)) SPRINTF (buffer, "_0%d.uns", SU2_TYPE::Int(val_iZone)); -// if (SU2_TYPE::Int(val_iZone) >= 10000) SPRINTF (buffer, "_%d.uns", SU2_TYPE::Int(val_iZone)); -// -// } -// else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { -// if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.uns", SU2_TYPE::Int(iExtIter)); -// if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.uns", SU2_TYPE::Int(iExtIter)); -// if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.uns", SU2_TYPE::Int(iExtIter)); -// if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.uns", SU2_TYPE::Int(iExtIter)); -// if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.uns", SU2_TYPE::Int(iExtIter)); -// } - else { SPRINTF (buffer, ".uns"); } - - strcat(cstr, buffer); - - /*--- Open FieldView ASCII file and write the header ---*/ - - ofstream FieldView_File; - FieldView_File.open(cstr, ios::out); - FieldView_File.precision(6); - - FieldView_File << "FIELDVIEW 3 0" << endl; - - /*--- Output constants for time, fsmach, alpha and re. ---*/ - - FieldView_File << "Constants" << endl; - FieldView_File << config->GetExtIter() <<"\t"<< config->GetMach() <<"\t"<< config->GetAoA() <<"\t"<< config->GetReynolds() << endl; - - /*--- Output the number of grids. ---*/ - - FieldView_File << "Grids\t" << ngrids << endl; - - /*--- Output the table of boundary types, starting with the number of types. - Note that this differs from the binary/unformatted specification. - Each boundary type name is preceded by 3 integer flags. - The first flag indicates whether this boundary type is a wall. - A flag value of 1 indicates a wall, and a value of 0 indicates - a non-wall. Walls are significant for streamline calculation. - The second flag indicates whether the boundary type has surface - results. A value of 1 means surface results will be present for - this boundary type (if any boundary variables are specified in the - Boundary Variable Names section below). A value of 0 means no surface - results will be present. - The third flag indicates whether boundary faces of this type have - consistent "clockness" for the purpose of calculating a surface - normal. A value of 1 means that all faces of this type are - written following a "right hand rule" for clockness. In other - words, if the vertices are written on counter-clockwise: - 4 --- 3 - | | - 1 --- 2 - then the normal to the face is pointing towards you (not away - from you). A value of 0 means that the faces do not have any - consistent clockness. The "clockness" of surface normals is - only used for calculating certain special surface integrals - that involve surface normals. If the surface normals flag - is 0, these special integrals will not be available. ---*/ - - FieldView_File << "Boundary Table\t1" << endl; - FieldView_File << "1\t0\t1\tMARKER_PLOTTING" << endl; - - /*--- Output the table of variable names, starting with the number of - variables. The number of variables can be zero. - Note that vector variables are specified by a ';' and vector name - following the first scalar name of 3 scalar components of the - vector. If writing 2-D results, the third component must still - be provided here, and its values must be written in the variables - section below (typically padded with zeros.) ---*/ - - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - - /*--- If SU2_SOL called this routine, we already have a set of output - variables with the appropriate string tags stored in the config class. ---*/ - - nvars = nVar_Total-nDim; - - FieldView_File << "Variable Names\t" << nvars << endl; - - for (unsigned short iField = 1+nDim; iField < config->fields.size(); iField++) { - - /*--- Remove all su2double-quote characters ---*/ - - FieldName = config->fields[iField]; - - FieldName.erase( - remove(FieldName.begin(), FieldName.end(), '\"' ), - FieldName.end() - ); - - FieldView_File << FieldName << endl; - } - - /*--- SU2 does not generate boundary variables ---*/ - - nbvars = 0; - FieldView_File << "Boundary Variable Names\t" << nbvars << endl; - - } - - else { - - nvars = nVar_Total; - - FieldView_File << "Variable Names\t" << nvars << endl; - - for (iVar = 0; iVar < nVar_Consv; iVar++) { - FieldView_File << "Conservative_" << iVar+1 << endl; - } - - /*--- Add names for any extra variables (this will need to be adjusted). ---*/ - - if (config->GetWrt_Limiters()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - FieldView_File << "Limiter_" << iVar+1 << endl; - } - } - - if (config->GetWrt_Residuals()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - FieldView_File << "Residual_" << iVar+1 << endl; - } - } - - if (grid_movement) { - if (nDim == 2) FieldView_File << "Grid_Velx\nGrid_Vely" << endl; - else FieldView_File << "Grid_Velx\nGrid_Vely\nGrid_Velz" << endl; - } - - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - FieldView_File << "Pressure\nTemperature\nPressure_Coefficient\nMach" << endl; - } - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - FieldView_File << "Laminar_Viscosity\nSkin_Friction_Coefficient\nHeat_Flux\nY_Plus" << endl; - } - - if (Kind_Solver == RANS) { - FieldView_File << "Eddy_Viscosity" << endl; - } - - if (config->GetWrt_SharpEdges()) { - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - FieldView_File << "Sharp_Edge_Dist" << endl; - } - } - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS ) ) { - FieldView_File << "Surface_Sensitivity\nSolution_Sensor" << endl; - } - - if (( Kind_Solver == DISC_ADJ_EULER ) || - ( Kind_Solver == DISC_ADJ_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_RANS ) ) { - if (nDim == 2) FieldView_File << "Surface_Sensitivity\nSensitivity_x\nSensitivity_y" << endl; - else FieldView_File << "Surface_Sensitivity\nSensitivity_x\nSensitivity_y\nSensitivity_z" << endl; - } - - /*--- SU2 does not generate boundary variables ---*/ - - nbvars = 0; - FieldView_File << "Boundary Variable Names\t" << nbvars << endl; - - } - - /*--- Output the node definition section for this grid - Output the X, Y, Z coordinates of successive nodes. - Note that this differs from the binary/unformatted specification. ---*/ - - if (nDim == 3) { - - FieldView_File << "Nodes\t" << nGlobal_Poin << endl; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Coords[iDim][iPoint] << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Data[iDim][iPoint] << "\t"; - } - FieldView_File << endl; - } - - } - - else { - - FieldView_File << "Nodes\t" << nGlobal_Poin*2 << endl; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Coords[iDim][iPoint] << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Data[iDim][iPoint] << "\t"; - } - FieldView_File << scientific << "0.0" << endl; - } - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Coords[iDim][iPoint] << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Data[iDim][iPoint] << "\t"; - } - FieldView_File << scientific << "-1E-10" << endl; - } - - } - - /*--- Output the boundary face definitions. - Note that this differs from the binary/unformatted specification. - Each face is preceded by an index into the boundary table at the - top of the file and the number of face vertices, 3 or 4. - All faces here have 4 vertices. If the face is triangular, - the last vertex should be zero. - TIP: FIELDVIEW assumes that boundary faces are not in random - order. It assumes that faces of the same type tend to occur - in groups. If your boundary faces are in random order, you - may want to output them one boundary type at a time. This - will give you better performance (less memory, greater speed) - in FIELDVIEW. ---*/ - - - if (nDim ==2) { - - nbfaces = nGlobal_Tria + nGlobal_Quad; - - FieldView_File << "Boundary Faces\t" << nbfaces << endl; - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - FieldView_File <<"1\t3\t"<< Conn_Tria[iNode+0] << "\t"; - FieldView_File << Conn_Tria[iNode+1] << "\t"; - FieldView_File << Conn_Tria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - FieldView_File <<"1\t4\t"<< Conn_Quad[iNode+0] << "\t"; - FieldView_File << Conn_Quad[iNode+1] << "\t"; - FieldView_File << Conn_Quad[iNode+2] << "\t"; - FieldView_File << Conn_Quad[iNode+3] << "\n"; - } - - } - - if (nDim ==3) { - - nbfaces = nGlobal_BoundTria + nGlobal_BoundQuad; - - FieldView_File << "Boundary Faces\t" << nbfaces << endl; - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - FieldView_File << "1\t3\t" << Conn_BoundTria[iNode+0] << "\t"; - FieldView_File << Conn_BoundTria[iNode+1] << "\t"; - FieldView_File << Conn_BoundTria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - FieldView_File << "1\t4\t" << Conn_BoundQuad[iNode+0] << "\t"; - FieldView_File << Conn_BoundQuad[iNode+1] << "\t"; - FieldView_File << Conn_BoundQuad[iNode+2] << "\t"; - FieldView_File << Conn_BoundQuad[iNode+3] << "\n"; - } - - } - - - /*--- Output the elements section for this grid. - Note that this differs from the binary/unformatted specification. - It contains the headers and node definitions of all elements. - In this example, each element starts with 2 for type 'hex', - with a subtype of 1 (the only subtype currently supported). - This is followed by the node indices for the element. ---*/ - - - FieldView_File << "Elements" << endl; - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - FieldView_File <<"3\t1\t"<< Conn_Tria[iNode+0] << "\t"; - FieldView_File << Conn_Tria[iNode+1] << "\t"; - FieldView_File << Conn_Tria[iNode+2] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Tria[iNode+0] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Tria[iNode+1] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Tria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - FieldView_File <<"2\t1\t"<< Conn_Quad[iNode+0] << "\t"; - FieldView_File << Conn_Quad[iNode+1] << "\t"; - FieldView_File << Conn_Quad[iNode+2] << "\t"; - FieldView_File << Conn_Quad[iNode+3] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Quad[iNode+0] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Quad[iNode+1] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Quad[iNode+2] << "\t"; - FieldView_File << nGlobal_Poin+Conn_Quad[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - FieldView_File <<"1\t1\t"<< Conn_Tetr[iNode+0] << "\t" << Conn_Tetr[iNode+1] << "\t"; - FieldView_File << Conn_Tetr[iNode+2] << "\t" << Conn_Tetr[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - FieldView_File <<"2\t1\t"<< Conn_Hexa[iNode+0] << "\t" << Conn_Hexa[iNode+1] << "\t"; - FieldView_File << Conn_Hexa[iNode+2] << "\t" << Conn_Hexa[iNode+3] << "\t"; - FieldView_File << Conn_Hexa[iNode+4] << "\t" << Conn_Hexa[iNode+5] << "\t"; - FieldView_File << Conn_Hexa[iNode+6] << "\t" << Conn_Hexa[iNode+7] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - FieldView_File <<"3\t1\t"<< Conn_Pris[iNode+0] << "\t" << Conn_Pris[iNode+1] << "\t"; - FieldView_File << Conn_Pris[iNode+2] << "\t" << Conn_Pris[iNode+3] << "\t"; - FieldView_File << Conn_Pris[iNode+4] << "\t" << Conn_Pris[iNode+5] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - FieldView_File <<"4\t1\t"<< Conn_Pyra[iNode+0] << "\t" << Conn_Pyra[iNode+1] << "\t"; - FieldView_File << Conn_Pyra[iNode+2] << "\t" << Conn_Pyra[iNode+3] << "\t"; - FieldView_File << Conn_Pyra[iNode+4] << "\n"; - } - - /*--- Output the variables data for this grid. - Note that all of the data for the first variable is output - before any of the data for the second variable. - You should skip this section if the number of variables is zero. - The variables must be in the same order as the "Variable Names" - section. ---*/ - - FieldView_File << "Variables" << endl; - - /*--- Loop over the vars/residuals and write the values to file ---*/ - - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iVar = 0; iVar < nvars; iVar++) { - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - FieldView_File << scientific << Data[iVar][iPoint] << endl; - } - if (nDim == 2) { - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - FieldView_File << scientific << Data[iVar][iPoint] << endl; - } - } - } - } - else { - for (iVar = 0; iVar < nvars; iVar++) { - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - FieldView_File << scientific << Data[iVar+nDim][iPoint] << endl; - } - if (nDim == 2) { - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - FieldView_File << scientific << Data[iVar+nDim][iPoint] << endl; - } - } - } - } - - /*--- Output the boundary variables data for this grid. - Note that all of the data for the first variable is output - before any of the data for the second variable. - Remember that the Boundary Table above has a "surface results - flag" indicating which boundary types have surface results. - The data should be written in the same order as the faces in - the Boundary Faces section, skipping over faces whose boundary - type has a surface results flag of zero (false). - For each variable, you should write one number per boundary face. - You should skip this section if the number of boundary - variables is zero. ---*/ - - FieldView_File << "Boundary Variables" << endl; - - - FieldView_File.close(); - -} - -void COutput::SetFieldViewASCII_Mesh(CConfig *config, CGeometry *geometry) { } - -void COutput::SetFieldViewBinary(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone) { - - unsigned short iDim, iVar, nDim = geometry->GetnDim(), ngrids = 1, nbvars, nvars; - unsigned short Kind_Solver = config->GetKind_Solver(); - - unsigned long iPoint, iElem, iNode, nbfaces; - unsigned long iExtIter = config->GetExtIter(); - bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - - char cstr[200], buffer[50]; - string filename; - - /*--- Write file name with extension ---*/ - - if (adjoint) filename = config->GetAdj_FileName(); - else filename = config->GetFlow_FileName(); - - if (Kind_Solver == FEM_ELASTICITY) - filename = config->GetStructure_FileName().c_str(); - - if (Kind_Solver == HEAT_EQUATION_FVM) - filename = config->GetHeat_FileName().c_str(); - - - strcpy (cstr, filename.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS) && - (val_nZone > 1) && (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - - if (config->GetKind_SU2() == SU2_SOL) { val_iZone = iExtIter; } - - if (SU2_TYPE::Int(val_iZone) < 10) SPRINTF (buffer, "_0000%d.uns", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 10) && (SU2_TYPE::Int(val_iZone) < 100)) SPRINTF (buffer, "_000%d.uns", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 100) && (SU2_TYPE::Int(val_iZone) < 1000)) SPRINTF (buffer, "_00%d.uns", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 1000) && (SU2_TYPE::Int(val_iZone) < 10000)) SPRINTF (buffer, "_0%d.uns", SU2_TYPE::Int(val_iZone)); - if (SU2_TYPE::Int(val_iZone) >= 10000) SPRINTF (buffer, "_%d.uns", SU2_TYPE::Int(val_iZone)); - - } - else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.uns", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.uns", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.uns", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.uns", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.uns", SU2_TYPE::Int(iExtIter)); - } - else { SPRINTF (buffer, ".uns"); } - - strcat(cstr, buffer); - - /*--- Open FieldView ASCII file and write the header ---*/ - - ofstream FieldView_File; - FieldView_File.open(cstr, ios::out); - FieldView_File.precision(6); - - FieldView_File << "FIELDVIEW 3 0" << endl; - - /*--- Output constants for time, fsmach, alpha and re. ---*/ - - FieldView_File << "Constants" << endl; - FieldView_File << config->GetExtIter() <<"\t"<< config->GetMach() <<"\t"<< config->GetAoA() <<"\t"<< config->GetReynolds() << endl; - - /*--- Output the number of grids. ---*/ - - FieldView_File << "Grids\t" << ngrids << endl; - - /*--- Output the table of boundary types, starting with the number of types. - Note that this differs from the binary/unformatted specification. - Each boundary type name is preceded by 3 integer flags. - The first flag indicates whether this boundary type is a wall. - A flag value of 1 indicates a wall, and a value of 0 indicates - a non-wall. Walls are significant for streamline calculation. - The second flag indicates whether the boundary type has surface - results. A value of 1 means surface results will be present for - this boundary type (if any boundary variables are specified in the - Boundary Variable Names section below). A value of 0 means no surface - results will be present. - The third flag indicates whether boundary faces of this type have - consistent "clockness" for the purpose of calculating a surface - normal. A value of 1 means that all faces of this type are - written following a "right hand rule" for clockness. In other - words, if the vertices are written on counter-clockwise: - 4 --- 3 - | | - 1 --- 2 - then the normal to the face is pointing towards you (not away - from you). A value of 0 means that the faces do not have any - consistent clockness. The "clockness" of surface normals is - only used for calculating certain special surface integrals - that involve surface normals. If the surface normals flag - is 0, these special integrals will not be available. ---*/ - - FieldView_File << "Boundary Table\t1" << endl; - FieldView_File << "1\t0\t1\tMARKER_PLOTTING" << endl; - - /*--- Output the table of variable names, starting with the number of - variables. The number of variables can be zero. - Note that vector variables are specified by a ';' and vector name - following the first scalar name of 3 scalar components of the - vector. If writing 2-D results, the third component must still - be provided here, and its values must be written in the variables - section below (typically padded with zeros.) ---*/ - - if (config->GetKind_SU2() == SU2_SOL) { - - /*--- If SU2_SOL called this routine, we already have a set of output - variables with the appropriate string tags stored in the config class. ---*/ - - nvars = config->fields.size() - 1 - nDim; - - FieldView_File << "Variable Names\t" << nvars << endl; - - for (unsigned short iField = 1+nDim; iField < config->fields.size(); iField++) { - FieldView_File << config->fields[iField] << endl; - } - - /*--- SU2 does not generate boundary variables ---*/ - - nbvars = 0; - FieldView_File << "Boundary Variable Names\t" << nbvars << endl; - - } - - else { - - nvars = nVar_Consv + nDim; - - FieldView_File << "Variable Names\t" << nvars-nDim << endl; - - for (iVar = 0; iVar < nVar_Consv; iVar++) { - FieldView_File << "Conservative_" << iVar+1 << endl; - } - - /*--- SU2 does not generate boundary variables ---*/ - - nbvars = 0; - FieldView_File << "Boundary Variable Names\t" << nbvars << endl; - - } - - /*--- Output the node definition section for this grid ---*/ - - FieldView_File << "Nodes\t" << nGlobal_Poin << endl; - - /*--- Output the X, Y, Z coordinates of successive nodes. - Note that this differs from the binary/unformatted specification. ---*/ - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - - if (config->GetKind_SU2() != SU2_SOL) { - for (iDim = 0; iDim < nDim; iDim++) - FieldView_File << scientific << Coords[iDim][iPoint] << "\t"; - } - else { - for (iVar = 0; iVar < nVar_Total; iVar++) - FieldView_File << scientific << Data[iVar][iPoint] << "\t"; - } - FieldView_File << endl; - - } - - /*--- Output the boundary face definitions. - Note that this differs from the binary/unformatted specification. - Each face is preceded by an index into the boundary table at the - top of the file and the number of face vertices, 3 or 4. - All faces here have 4 vertices. If the face is triangular, - the last vertex should be zero. - TIP: FIELDVIEW assumes that boundary faces are not in random - order. It assumes that faces of the same type tend to occur - in groups. If your boundary faces are in random order, you - may want to output them one boundary type at a time. This - will give you better performance (less memory, greater speed) - in FIELDVIEW. ---*/ - - nbfaces = nGlobal_Line + nGlobal_BoundTria + nGlobal_BoundQuad; - - FieldView_File << "Boundary Faces\t" << nbfaces << endl; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - FieldView_File << "1\t2\t" << Conn_Line[iNode+0] << "\t"; - FieldView_File << "1\t2\t" << Conn_Line[iNode+1] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - FieldView_File << "1\t3\t" << Conn_BoundTria[iNode+0] << "\t"; - FieldView_File << Conn_BoundTria[iNode+1] << "\t"; - FieldView_File << Conn_BoundTria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - FieldView_File << "1\t4\t" << Conn_BoundQuad[iNode+0] << "\t"; - FieldView_File << Conn_BoundQuad[iNode+1] << "\t"; - FieldView_File << Conn_BoundQuad[iNode+2] << "\t"; - FieldView_File << Conn_BoundQuad[iNode+3] << "\n"; - } - - /*--- Output the elements section for this grid. - Note that this differs from the binary/unformatted specification. - It contains the headers and node definitions of all elements. - In this example, each element starts with 2 for type 'hex', - with a subtype of 1 (the only subtype currently supported). - This is followed by the node indices for the element. ---*/ - - - FieldView_File << "Elements" << endl; - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - FieldView_File <<"2\t1\t"<< Conn_Tria[iNode+0] << "\t"; - FieldView_File << Conn_Tria[iNode+1] << "\t"; - FieldView_File << Conn_Tria[iNode+2] << "\t"; - FieldView_File << Conn_Tria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - FieldView_File <<"2\t1\t"<< Conn_Quad[iNode+0] << "\t"; - FieldView_File << Conn_Quad[iNode+1] << "\t"; - FieldView_File << Conn_Quad[iNode+2] << "\t"; - FieldView_File << Conn_Quad[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - FieldView_File <<"1\t1\t"<< Conn_Tetr[iNode+0] << "\t" << Conn_Tetr[iNode+1] << "\t"; - FieldView_File << Conn_Tetr[iNode+2] << "\t" << Conn_Tetr[iNode+2] << "\t"; - FieldView_File << Conn_Tetr[iNode+3] << "\t" << Conn_Tetr[iNode+3] << "\t"; - FieldView_File << Conn_Tetr[iNode+3] << "\t" << Conn_Tetr[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - FieldView_File <<"2\t1\t"<< Conn_Hexa[iNode+0] << "\t" << Conn_Hexa[iNode+1] << "\t"; - FieldView_File << Conn_Hexa[iNode+2] << "\t" << Conn_Hexa[iNode+3] << "\t"; - FieldView_File << Conn_Hexa[iNode+4] << "\t" << Conn_Hexa[iNode+5] << "\t"; - FieldView_File << Conn_Hexa[iNode+6] << "\t" << Conn_Hexa[iNode+7] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - FieldView_File <<"3\t1\t"<< Conn_Pris[iNode+0] << "\t" << Conn_Pris[iNode+1] << "\t"; - FieldView_File << Conn_Pris[iNode+1] << "\t" << Conn_Pris[iNode+2] << "\t"; - FieldView_File << Conn_Pris[iNode+3] << "\t" << Conn_Pris[iNode+4] << "\t"; - FieldView_File << Conn_Pris[iNode+4] << "\t" << Conn_Pris[iNode+5] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - FieldView_File <<"4\t1\t"<< Conn_Pyra[iNode+0] << "\t" << Conn_Pyra[iNode+1] << "\t"; - FieldView_File << Conn_Pyra[iNode+2] << "\t" << Conn_Pyra[iNode+3] << "\t"; - FieldView_File << Conn_Pyra[iNode+4] << "\t" << Conn_Pyra[iNode+4] << "\t"; - FieldView_File << Conn_Pyra[iNode+4] << "\t" << Conn_Pyra[iNode+4] << "\n"; - } - - /*--- Output the variables data for this grid. - Note that all of the data for the first variable is output - before any of the data for the second variable. - You should skip this section if the number of variables is zero. - The variables must be in the same order as the "Variable Names" - section. ---*/ - - FieldView_File << "Variables" << endl; - - /*--- Loop over the vars/residuals and write the values to file ---*/ - for (iVar = nDim; iVar < nVar_Total; iVar++) { - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - FieldView_File << scientific << Data[iVar][iPoint] << endl; - } - } - - /*--- Output the boundary variables data for this grid. - Note that all of the data for the first variable is output - before any of the data for the second variable. - Remember that the Boundary Table above has a "surface results - flag" indicating which boundary types have surface results. - The data should be written in the same order as the faces in - the Boundary Faces section, skipping over faces whose boundary - type has a surface results flag of zero (false). - For each variable, you should write one number per boundary face. - You should skip this section if the number of boundary - variables is zero. ---*/ - - FieldView_File << "Boundary Variables" << endl; - - - FieldView_File.close(); - -} - -void COutput::SetFieldViewBinary_Mesh(CConfig *config, CGeometry *geometry) { } diff --git a/SU2_CFD/src/output_paraview.cpp b/SU2_CFD/src/output_paraview.cpp deleted file mode 100644 index fa5a996afd00..000000000000 --- a/SU2_CFD/src/output_paraview.cpp +++ /dev/null @@ -1,3545 +0,0 @@ -/*! - * \file output_paraview.cpp - * \brief Main subroutines for the output of ParaView visualization files. - * \author F. Palacios, T. Economon, E. van der Weide - * \version 6.2.0 "Falcon" - * - * The current SU2 release has been coordinated by the - * SU2 International Developers Society - * with selected contributions from the open-source community. - * - * The main research teams contributing to the current release are: - * - Prof. Juan J. Alonso's group at Stanford University. - * - Prof. Piero Colonna's group at Delft University of Technology. - * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. - * - Prof. Alberto Guardone's group at Polytechnic University of Milan. - * - Prof. Rafael Palacios' group at Imperial College London. - * - Prof. Vincent Terrapon's group at the University of Liege. - * - Prof. Edwin van der Weide's group at the University of Twente. - * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. - * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, - * Tim Albring, and the SU2 contributors. - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../include/output_structure.hpp" - -/*--- Subroutine to swap bytes, in case we need to convert to - big endian, which is expected for ParaView binary legacy format. ---*/ - -void SwapBytes(char *buffer, - size_t nBytes, - unsigned long nVar) { - - /*--- Store half the number of bytes in kk. ---*/ - - const int kk = (int)nBytes/2; - - /*--- Loop over the number of variables in the buffer. ---*/ - - for (int j = 0; j < (int)nVar; j++) { - - /*--- Initialize ii and jj, which are used to store the - indices of the bytes to be swapped. ---*/ - - int ii = j*(int)nBytes; - int jj = ii + (int)nBytes - 1; - - /*--- Swap the bytes. ---*/ - - for (int i = 0; i < kk; i++) { - char tmp = buffer[jj]; - buffer[jj] = buffer[ii]; - buffer[ii] = tmp; - - ii++; - jj--; - - } - } -} - -string GetVTKFilename(CConfig *config, unsigned short val_iZone, - unsigned short val_nZone, bool surf_sol) { - - unsigned short Kind_Solver = config->GetKind_Solver(); - - unsigned long iExtIter = config->GetExtIter(); - - bool adjoint = config->GetContinuous_Adjoint(); - bool disc_adj = config->GetDiscrete_Adjoint(); - - char cstr[200], buffer[50]; - string fileroot, fieldname; - ofstream Paraview_File; - - /*--- Write file name with extension ---*/ - if (surf_sol) { - if (adjoint || disc_adj) - fileroot = config->GetSurfAdjCoeff_FileName(); - else - fileroot = config->GetSurfFlowCoeff_FileName(); - } - else { - if (adjoint || disc_adj) - fileroot = config->GetAdj_FileName(); - else - fileroot = config->GetFlow_FileName(); - } - - if (Kind_Solver == FEM_ELASTICITY) { - if (surf_sol) - fileroot = config->GetSurfStructure_FileName().c_str(); - else - fileroot = config->GetStructure_FileName().c_str(); - } - - if (Kind_Solver == HEAT_EQUATION_FVM) { - if (surf_sol) fileroot = config->GetSurfHeat_FileName().c_str(); - else fileroot = config->GetHeat_FileName().c_str(); - } - - if (config->GetKind_SU2() == SU2_DOT) { - if (surf_sol) - fileroot = config->GetSurfSens_FileName(); - else - fileroot = config->GetVolSens_FileName(); - } - - strcpy (cstr, fileroot.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS || - Kind_Solver == DISC_ADJ_EULER || Kind_Solver == DISC_ADJ_NAVIER_STOKES || Kind_Solver == DISC_ADJ_RANS || - Kind_Solver == FEM_ELASTICITY || Kind_Solver == HEAT_EQUATION_FVM) && - (val_nZone > 1) && - (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - if (SU2_TYPE::Int(val_iZone) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 10) && (SU2_TYPE::Int(val_iZone) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 100) && (SU2_TYPE::Int(val_iZone) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 1000) && (SU2_TYPE::Int(val_iZone) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(val_iZone)); - if (SU2_TYPE::Int(val_iZone) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(val_iZone)); - - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - - } else if (config->GetDynamic_Analysis() && config->GetWrt_Dynamic()) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - } else { - SPRINTF (buffer, ".vtk"); - } - - strcat(cstr, buffer); - string filename = cstr; - return filename; -} - -void COutput::SetParaview_ASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol) { - - unsigned short iDim, iVar, nDim = geometry->GetnDim(); - unsigned short Kind_Solver = config->GetKind_Solver(); - unsigned short iInst = config->GetiInst(); - - unsigned long iPoint, iElem, iNode; - unsigned long iExtIter = config->GetExtIter(); - unsigned long *LocalIndex = NULL; - bool *SurfacePoint = NULL; - - unsigned long nSurf_Elem_Storage; - unsigned long nGlobal_Elem_Storage; - - bool dynamic_grid = config->GetDynamic_Grid(); - bool adjoint = config->GetContinuous_Adjoint(); - bool disc_adj = config->GetDiscrete_Adjoint(); - bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); - bool disc_adj_fem = (config->GetKind_Solver() == DISC_ADJ_FEM); - - - char cstr[200], buffer[50]; - string filename, fieldname; - - /*--- Write file name with extension ---*/ - if (surf_sol) { - if ((adjoint || disc_adj) && (!disc_adj_fem)) - filename = config->GetSurfAdjCoeff_FileName(); - else - filename = config->GetSurfFlowCoeff_FileName(); - } - else { - if ((adjoint || disc_adj) && (!disc_adj_fem)) - filename = config->GetAdj_FileName(); - else - filename = config->GetFlow_FileName(); - } - - if (Kind_Solver == FEM_ELASTICITY) { - if (surf_sol) - filename = config->GetSurfStructure_FileName().c_str(); - else - filename = config->GetStructure_FileName().c_str(); - } - - if (Kind_Solver == DISC_ADJ_FEM) { - if (surf_sol) - filename = config->GetAdjSurfStructure_FileName().c_str(); - else - filename = config->GetAdjStructure_FileName().c_str(); - } - - if (Kind_Solver == HEAT_EQUATION_FVM) { - if (surf_sol) filename = config->GetSurfHeat_FileName().c_str(); - else filename = config->GetHeat_FileName().c_str(); - } - - if (config->GetKind_SU2() == SU2_DOT) { - if (surf_sol) - filename = config->GetSurfSens_FileName(); - else - filename = config->GetVolSens_FileName(); - } - - strcpy (cstr, filename.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS || - Kind_Solver == DISC_ADJ_EULER || Kind_Solver == DISC_ADJ_NAVIER_STOKES || Kind_Solver == DISC_ADJ_RANS || - Kind_Solver == FEM_ELASTICITY || Kind_Solver == HEAT_EQUATION_FVM) && - (val_nZone > 1) && - (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - if (SU2_TYPE::Int(iInst) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iInst)); - if ((SU2_TYPE::Int(iInst) >= 10) && (SU2_TYPE::Int(iInst) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iInst)); - if ((SU2_TYPE::Int(iInst) >= 100) && (SU2_TYPE::Int(iInst) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iInst)); - if ((SU2_TYPE::Int(iInst) >= 1000) && (SU2_TYPE::Int(iInst) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iInst)); - if (SU2_TYPE::Int(iInst) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iInst)); - - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - - } else if (config->GetDynamic_Analysis() && config->GetWrt_Dynamic()) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - } else { - SPRINTF (buffer, ".vtk"); - } - - strcat(cstr, buffer); - - /*--- Open Paraview ASCII file and write the header. ---*/ - ofstream Paraview_File; - Paraview_File.open(cstr, ios::out); - Paraview_File.precision(6); - Paraview_File << "# vtk DataFile Version 3.0\n"; - Paraview_File << "vtk output\n"; - Paraview_File << "ASCII\n"; - Paraview_File << "DATASET UNSTRUCTURED_GRID\n"; - - /*--- If it's a surface output, print only the points - that are in the element list, change the numbering ---*/ - - if (surf_sol) { - - LocalIndex = new unsigned long [nGlobal_Poin+1]; - SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) { nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin; } - } - - } - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "POINTS "<< nSurf_Poin <<" double\n"; - else Paraview_File << "POINTS "<< nGlobal_Poin <<" double\n"; - - /*--- Write surface and volumetric solution data. ---*/ - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - - if (surf_sol) { - - if (LocalIndex[iPoint+1] != 0) { - - /*--- Write the node coordinates ---*/ - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Coords[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Data[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - - } - - } else { - - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Coords[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Data[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - - } - } - - /*--- Write the header ---*/ - nSurf_Elem_Storage = nGlobal_Line*3 +nGlobal_BoundTria*4 + nGlobal_BoundQuad*5; - nGlobal_Elem_Storage = nGlobal_Tria*4 + nGlobal_Quad*5 + nGlobal_Tetr*5 + nGlobal_Hexa*9 + nGlobal_Pris*7 + nGlobal_Pyra*6; - - if (surf_sol) Paraview_File << "\nCELLS " << nSurf_Elem << "\t" << nSurf_Elem_Storage << "\n"; - else Paraview_File << "\nCELLS " << nGlobal_Elem << "\t" << nGlobal_Elem_Storage << "\n"; - - if (surf_sol) { - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - Paraview_File << N_POINTS_LINE << "\t"; - Paraview_File << LocalIndex[Conn_Line[iNode+0]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_Line[iNode+1]]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << LocalIndex[Conn_BoundTria[iNode+0]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundTria[iNode+1]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundTria[iNode+2]]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+0]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+1]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+2]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+3]]-1 << "\t"; - } - - } - else { - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << Conn_Tria[iNode+0]-1 << "\t"; - Paraview_File << Conn_Tria[iNode+1]-1 << "\t"; - Paraview_File << Conn_Tria[iNode+2]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << Conn_Quad[iNode+0]-1 << "\t"; - Paraview_File << Conn_Quad[iNode+1]-1 << "\t"; - Paraview_File << Conn_Quad[iNode+2]-1 << "\t"; - Paraview_File << Conn_Quad[iNode+3]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - Paraview_File << N_POINTS_TETRAHEDRON << "\t"; - Paraview_File << Conn_Tetr[iNode+0]-1 << "\t" << Conn_Tetr[iNode+1]-1 << "\t"; - Paraview_File << Conn_Tetr[iNode+2]-1 << "\t" << Conn_Tetr[iNode+3]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - Paraview_File << N_POINTS_HEXAHEDRON << "\t"; - Paraview_File << Conn_Hexa[iNode+0]-1 << "\t" << Conn_Hexa[iNode+1]-1 << "\t"; - Paraview_File << Conn_Hexa[iNode+2]-1 << "\t" << Conn_Hexa[iNode+3]-1 << "\t"; - Paraview_File << Conn_Hexa[iNode+4]-1 << "\t" << Conn_Hexa[iNode+5]-1 << "\t"; - Paraview_File << Conn_Hexa[iNode+6]-1 << "\t" << Conn_Hexa[iNode+7]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - Paraview_File << N_POINTS_PRISM << "\t"; - Paraview_File << Conn_Pris[iNode+0]-1 << "\t" << Conn_Pris[iNode+1]-1 << "\t"; - Paraview_File << Conn_Pris[iNode+2]-1 << "\t" << Conn_Pris[iNode+3]-1 << "\t"; - Paraview_File << Conn_Pris[iNode+4]-1 << "\t" << Conn_Pris[iNode+5]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - Paraview_File << N_POINTS_PYRAMID << "\t"; - Paraview_File << Conn_Pyra[iNode+0]-1 << "\t" << Conn_Pyra[iNode+1]-1 << "\t"; - Paraview_File << Conn_Pyra[iNode+2]-1 << "\t" << Conn_Pyra[iNode+3]-1 << "\t"; - Paraview_File << Conn_Pyra[iNode+4]-1 << "\t"; - } - } - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "\nCELL_TYPES " << nSurf_Elem << "\n"; - else Paraview_File << "\nCELL_TYPES " << nGlobal_Elem << "\n"; - - if (surf_sol) { - for (iElem = 0; iElem < nGlobal_Line; iElem++) Paraview_File << "3\t"; - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) Paraview_File << "5\t"; - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) Paraview_File << "9\t"; - - } - else { - for (iElem = 0; iElem < nGlobal_Tria; iElem++) Paraview_File << "5\t"; - for (iElem = 0; iElem < nGlobal_Quad; iElem++) Paraview_File << "9\t"; - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) Paraview_File << "10\t"; - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) Paraview_File << "12\t"; - for (iElem = 0; iElem < nGlobal_Pris; iElem++) Paraview_File << "13\t"; - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) Paraview_File << "14\t"; - } - - - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "\nPOINT_DATA "<< nSurf_Poin <<"\n"; - else Paraview_File << "\nPOINT_DATA "<< nGlobal_Poin <<"\n"; - - unsigned short VarCounter = 0; - - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - - /*--- If SU2_SOL called this routine, we already have a set of output - variables with the appropriate string tags stored in the config class. ---*/ - for (unsigned short iField = 1; iField < config->fields.size(); iField++) { - - fieldname = config->fields[iField]; - - fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), fieldname.end()); - - bool output_variable = true; - if (fieldname == "x") { - output_variable = false; - //skip - VarCounter++; - } - if (fieldname == "y") { - output_variable = false; - //skip - VarCounter++; - } - if (fieldname == "z") { - output_variable = false; - //skip - VarCounter++; - } - - bool isVector = false; - size_t found = config->fields[iField].find("_x"); - if (found!=string::npos) { - output_variable = true; - isVector = true; - } - found = config->fields[iField].find("_y"); - if (found!=string::npos) { - output_variable = false; - //skip - VarCounter++; - } - found = config->fields[iField].find("_z"); - if (found!=string::npos) { - output_variable = false; - //skip - VarCounter++; - } - - if (output_variable && isVector) { - - /*--- Several output variables should be written as vectors. ---*/ - - fieldname.erase(fieldname.end()-2,fieldname.end()); - - if (rank == MASTER_NODE) { - Paraview_File << "\nVECTORS " << fieldname << " double\n"; - } - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter+0][iPoint] << "\t" << Data[VarCounter+1][iPoint] << "\t"; - if (nDim == 3) Paraview_File << scientific << Data[VarCounter+2][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter+0][iPoint] << "\t" << Data[VarCounter+1][iPoint] << "\t"; - if (nDim == 3) Paraview_File << scientific << Data[VarCounter+2][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - } - - VarCounter++; - - } - - else if (output_variable) { - - Paraview_File << "\nSCALARS " << fieldname << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - - VarCounter++; - - } - - } - - } else { - - for (iVar = 0; iVar < nVar_Consv; iVar++) { - - if ((Kind_Solver == FEM_ELASTICITY) || (Kind_Solver == DISC_ADJ_FEM)) - Paraview_File << "\nSCALARS Displacement_" << iVar+1 << " double 1\n"; - else - Paraview_File << "\nSCALARS Conservative_" << iVar+1 << " double 1\n"; - - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - - if (config->GetWrt_Limiters()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - - Paraview_File << "\nSCALARS Limiter_" << iVar+1 << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - } - - if (config->GetWrt_Residuals()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - - Paraview_File << "\nSCALARS Residual_" << iVar+1 << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - } - - /*--- Add names for any extra variables (this will need to be adjusted). ---*/ - if (dynamic_grid && !fem) { - - Paraview_File << "\nSCALARS Grid_Velx double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Grid_Vely double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Grid_Velz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - } - - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - - Paraview_File << "\nSCALARS Pressure double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Temperature double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Pressure_Coefficient double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Mach double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - - Paraview_File << "\nSCALARS Laminar_Viscosity double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Skin_Friction_Coefficient_X double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Skin_Friction_Coefficient_Y double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Skin_Friction_Coefficient_Z double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - Paraview_File << "\nSCALARS Heat_Flux double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Y_Plus double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if (Kind_Solver == RANS) { - - Paraview_File << "\nSCALARS Eddy_Viscosity double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS ) || - ( Kind_Solver == DISC_ADJ_EULER ) || - ( Kind_Solver == DISC_ADJ_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_RANS ) ) { - - Paraview_File << "\nSCALARS Surface_Sensitivity double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - if (( Kind_Solver == DISC_ADJ_EULER ) || - ( Kind_Solver == DISC_ADJ_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_RANS ) ) { - - Paraview_File << "\nSCALARS Sensitivity_x double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Sensitivity_y double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - Paraview_File << "\nSCALARS Sensitivity_z double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - } - - if (Kind_Solver == FEM_ELASTICITY) { - - if (config->GetDynamic_Analysis() == DYNAMIC) { - - Paraview_File << "\nSCALARS Velocity_1 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Velocity_2 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Velocity_3 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - - Paraview_File << "\nSCALARS Acceleration_1 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Acceleration_2 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Acceleration_3 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - - } - - Paraview_File << "\nSCALARS Sxx double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Syy double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Sxy double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Szz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Sxz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Syz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - Paraview_File << "\nSCALARS Von_Mises_Stress double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if ((Kind_Solver == DISC_ADJ_FEM) && (config->GetFSI_Simulation())) { - - Paraview_File << "\nSCALARS CrossTerm_1 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS CrossTerm_2 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3){ - - Paraview_File << "\nSCALARS CrossTerm_3 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - } - - } - - Paraview_File.close(); - - if (surf_sol) delete [] LocalIndex; - -} - -void COutput::SetParaview_MeshASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol, bool new_file) { - - unsigned short iDim, iVar, nDim = geometry->GetnDim(); - unsigned short Kind_Solver = config->GetKind_Solver(); - - unsigned long iPoint, iElem, iNode; - unsigned long iExtIter = config->GetExtIter(); - unsigned long *LocalIndex = NULL; - bool *SurfacePoint = NULL; - - unsigned long nSurf_Elem_Storage; - unsigned long nGlobal_Elem_Storage; - - bool dynamic_grid = config->GetDynamic_Grid(); - bool adjoint = config->GetContinuous_Adjoint(); - bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); - - char cstr[200], buffer[50]; - string filename, fieldname; - - /*--- Write file name with extension ---*/ - - if (surf_sol) { - if (adjoint) - filename = config->GetSurfAdjCoeff_FileName(); - else - filename = config->GetSurfFlowCoeff_FileName(); - } - else { - if (adjoint) - filename = config->GetAdj_FileName(); - else - filename = config->GetFlow_FileName(); - } - if (config->GetKind_SU2() == SU2_DEF) { - if (new_file) { - if (surf_sol) filename = "surface_grid"; - else filename = "volumetric_grid"; - } - else { - if (surf_sol) filename = "surface_grid_def"; - else filename = "volumetric_grid_def"; - } - } - - if (Kind_Solver == FEM_ELASTICITY) { - if (surf_sol) - filename = config->GetSurfStructure_FileName().c_str(); - else { - filename = config->GetStructure_FileName().c_str(); - if (!new_file) { - filename = filename + "_def"; - } - } - } - - - if (Kind_Solver == HEAT_EQUATION_FVM) { - if (surf_sol) filename = config->GetSurfHeat_FileName().c_str(); - else filename = config->GetHeat_FileName().c_str(); - } - - strcpy (cstr, filename.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || Kind_Solver == FEM_ELASTICITY || Kind_Solver == HEAT_EQUATION_FVM) && - (val_nZone > 1) && (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - if (((Kind_Solver == ADJ_EULER) || (Kind_Solver == ADJ_NAVIER_STOKES) || (Kind_Solver == ADJ_RANS)) && - (val_nZone > 1) && (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - if (SU2_TYPE::Int(val_iZone) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 10) && (SU2_TYPE::Int(val_iZone) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 100) && (SU2_TYPE::Int(val_iZone) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(val_iZone)); - if ((SU2_TYPE::Int(val_iZone) >= 1000) && (SU2_TYPE::Int(val_iZone) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(val_iZone)); - if (SU2_TYPE::Int(val_iZone) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(val_iZone)); - - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - - } else if (config->GetDynamic_Analysis() && config->GetWrt_Dynamic()) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - } else { - SPRINTF (buffer, ".vtk"); - } - - strcat(cstr, buffer); - - /*--- Open Paraview ASCII file and write the header. ---*/ - ofstream Paraview_File; - Paraview_File.open(cstr, ios::out); - Paraview_File.precision(6); - Paraview_File << "# vtk DataFile Version 3.0\n"; - Paraview_File << "vtk output\n"; - Paraview_File << "ASCII\n"; - if (config->GetKind_SU2()!=SU2_DEF) Paraview_File << "DATASET UNSTRUCTURED_GRID\n"; - else Paraview_File << "DATASET UNSTRUCTURED_GRID\n"; - - - /*--- If it's a surface output, print only the points - that are in the element list, change the numbering ---*/ - - if (surf_sol) { - - LocalIndex = new unsigned long [nGlobal_Poin+1]; - SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) { nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin; } - } - - } - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "POINTS "<< nSurf_Poin <<" double\n"; - else Paraview_File << "POINTS "<< nGlobal_Poin <<" double\n"; - - /*--- Write surface and volumetric solution data. ---*/ - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - - if (surf_sol) { - - if (LocalIndex[iPoint+1] != 0) { - - /*--- Write the node coordinates ---*/ - if (config->GetKind_SU2() != SU2_SOL) { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Coords[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Data[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - - } - - } else { - - if (config->GetKind_SU2() != SU2_SOL) { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Coords[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - else { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Data[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - - } - } - - /*--- Write the header ---*/ - nSurf_Elem_Storage = nGlobal_Line*3 +nGlobal_BoundTria*4 + nGlobal_BoundQuad*5; - nGlobal_Elem_Storage = nGlobal_Tria*4 + nGlobal_Quad*5 + nGlobal_Tetr*5 + nGlobal_Hexa*9 + nGlobal_Pris*7 + nGlobal_Pyra*6; - - if (surf_sol) Paraview_File << "\nCELLS " << nSurf_Elem << "\t" << nSurf_Elem_Storage << "\n"; - else Paraview_File << "\nCELLS " << nGlobal_Elem << "\t" << nGlobal_Elem_Storage << "\n"; - - if (surf_sol) { - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - Paraview_File << N_POINTS_LINE << "\t"; - Paraview_File << LocalIndex[Conn_Line[iNode+0]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_Line[iNode+1]]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << LocalIndex[Conn_BoundTria[iNode+0]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundTria[iNode+1]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundTria[iNode+2]]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+0]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+1]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+2]]-1 << "\t"; - Paraview_File << LocalIndex[Conn_BoundQuad[iNode+3]]-1 << "\t"; - } - - } - else { - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << Conn_Tria[iNode+0]-1 << "\t"; - Paraview_File << Conn_Tria[iNode+1]-1 << "\t"; - Paraview_File << Conn_Tria[iNode+2]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << Conn_Quad[iNode+0]-1 << "\t"; - Paraview_File << Conn_Quad[iNode+1]-1 << "\t"; - Paraview_File << Conn_Quad[iNode+2]-1 << "\t"; - Paraview_File << Conn_Quad[iNode+3]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - Paraview_File << N_POINTS_TETRAHEDRON << "\t"; - Paraview_File << Conn_Tetr[iNode+0]-1 << "\t" << Conn_Tetr[iNode+1]-1 << "\t"; - Paraview_File << Conn_Tetr[iNode+2]-1 << "\t" << Conn_Tetr[iNode+3]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - Paraview_File << N_POINTS_HEXAHEDRON << "\t"; - Paraview_File << Conn_Hexa[iNode+0]-1 << "\t" << Conn_Hexa[iNode+1]-1 << "\t"; - Paraview_File << Conn_Hexa[iNode+2]-1 << "\t" << Conn_Hexa[iNode+3]-1 << "\t"; - Paraview_File << Conn_Hexa[iNode+4]-1 << "\t" << Conn_Hexa[iNode+5]-1 << "\t"; - Paraview_File << Conn_Hexa[iNode+6]-1 << "\t" << Conn_Hexa[iNode+7]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - Paraview_File << N_POINTS_PRISM << "\t"; - Paraview_File << Conn_Pris[iNode+0]-1 << "\t" << Conn_Pris[iNode+1]-1 << "\t"; - Paraview_File << Conn_Pris[iNode+2]-1 << "\t" << Conn_Pris[iNode+3]-1 << "\t"; - Paraview_File << Conn_Pris[iNode+4]-1 << "\t" << Conn_Pris[iNode+5]-1 << "\t"; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - Paraview_File << N_POINTS_PYRAMID << "\t"; - Paraview_File << Conn_Pyra[iNode+0]-1 << "\t" << Conn_Pyra[iNode+1]-1 << "\t"; - Paraview_File << Conn_Pyra[iNode+2]-1 << "\t" << Conn_Pyra[iNode+3]-1 << "\t"; - Paraview_File << Conn_Pyra[iNode+4]-1 << "\t"; - } - } - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "\nCELL_TYPES " << nSurf_Elem << "\n"; - else Paraview_File << "\nCELL_TYPES " << nGlobal_Elem << "\n"; - - if (surf_sol) { - for (iElem = 0; iElem < nGlobal_Line; iElem++) Paraview_File << "3\t"; - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) Paraview_File << "5\t"; - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) Paraview_File << "9\t"; - - } - else { - for (iElem = 0; iElem < nGlobal_Tria; iElem++) Paraview_File << "5\t"; - for (iElem = 0; iElem < nGlobal_Quad; iElem++) Paraview_File << "9\t"; - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) Paraview_File << "10\t"; - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) Paraview_File << "12\t"; - for (iElem = 0; iElem < nGlobal_Pris; iElem++) Paraview_File << "13\t"; - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) Paraview_File << "14\t"; - } - - - - /*--- Write the header ---*/ - if (config->GetKind_SU2() != SU2_DEF) { - if (surf_sol) Paraview_File << "\nPOINT_DATA "<< nSurf_Poin <<"\n"; - else Paraview_File << "\nPOINT_DATA "<< nGlobal_Poin <<"\n"; - } - - unsigned short VarCounter = 0; - - if (config->GetKind_SU2() == SU2_SOL) { - - /*--- If SU2_SOL called this routine, we already have a set of output - variables with the appropriate string tags stored in the config class. ---*/ - for (unsigned short iField = 1; iField < config->fields.size(); iField++) { - - fieldname = config->fields[iField]; - - bool output_variable = true; - size_t found = config->fields[iField].find("\"x\""); - if (found!=string::npos) output_variable = false; - found = config->fields[iField].find("\"y\""); - if (found!=string::npos) output_variable = false; - found = config->fields[iField].find("\"z\""); - if (found!=string::npos) output_variable = false; - - if (output_variable) { - fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), fieldname.end()); - - Paraview_File << "\nSCALARS " << fieldname << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - } - - VarCounter++; - - - } - - } - - else if (config->GetKind_SU2()!=SU2_DEF) { - - for (iVar = 0; iVar < nVar_Consv; iVar++) { - - if (Kind_Solver == FEM_ELASTICITY) - Paraview_File << "\nSCALARS Displacement_" << iVar+1 << " double 1\n"; - else - Paraview_File << "\nSCALARS Conservative_" << iVar+1 << " double 1\n"; - - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - - if (config->GetWrt_Limiters()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - - Paraview_File << "\nSCALARS Limiter_" << iVar+1 << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - } - - if (config->GetWrt_Residuals()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - - Paraview_File << "\nSCALARS Residual_" << iVar+1 << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - } - - /*--- Add names for any extra variables (this will need to be adjusted). ---*/ - if (dynamic_grid && !fem) { - - Paraview_File << "\nSCALARS Grid_Velx double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Grid_Vely double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Grid_Velz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - } - - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - - Paraview_File << "\nSCALARS Pressure double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Temperature double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Pressure_Coefficient double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Mach double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - - Paraview_File << "\nSCALARS Laminar_Viscosity double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Skin_Friction_Coefficient double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Heat_Flux double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Y_Plus double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if (Kind_Solver == RANS) { - - Paraview_File << "\nSCALARS Eddy_Viscosity double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS ) ) { - - Paraview_File << "\nSCALARS Surface_Sensitivity double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - if (Kind_Solver == FEM_ELASTICITY) { - - if (config->GetDynamic_Analysis() == DYNAMIC) { - - Paraview_File << "\nSCALARS Velocity_1 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Velocity_2 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Velocity_3 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - - Paraview_File << "\nSCALARS Acceleration_1 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Acceleration_2 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Acceleration_3 double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - } - - } - - Paraview_File << "\nSCALARS Sxx double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Syy double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Sxy double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - if (nDim == 3) { - - Paraview_File << "\nSCALARS Szz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Sxz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - Paraview_File << "\nSCALARS Syz double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (! surf_sol) { - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - Paraview_File << "\nSCALARS Von_Mises_Stress double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - if (surf_sol) { - if (LocalIndex[iPoint+1] != 0) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } else { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Data[VarCounter][iPoint] << "\t"; - } - } - VarCounter++; - - } - - - } - - Paraview_File.close(); - - if (surf_sol) delete [] LocalIndex; - if (SurfacePoint != NULL) delete [] SurfacePoint; - -} - -void COutput::WriteParaViewASCII_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_iInst, unsigned short val_nInst, bool surf_sol) { - - unsigned short iDim, nDim = geometry->GetnDim(); - unsigned short Kind_Solver = config->GetKind_Solver(); - - unsigned long iPoint, iElem, iNode; - unsigned long iExtIter = config->GetExtIter(); - - unsigned long nSurf_Elem_Storage; - unsigned long nGlobal_Elem_Storage; - - bool adjoint = config->GetContinuous_Adjoint(); - bool disc_adj = config->GetDiscrete_Adjoint(); - - char cstr[200], buffer[50]; - string filename, fieldname; - ofstream Paraview_File; - - int iProcessor; - - /*--- Write file name with extension ---*/ - if (surf_sol) { - if (adjoint || disc_adj) - filename = config->GetSurfAdjCoeff_FileName(); - else - filename = config->GetSurfFlowCoeff_FileName(); - } - else { - if (adjoint || disc_adj) - filename = config->GetAdj_FileName(); - else - filename = config->GetFlow_FileName(); - } - - if (Kind_Solver == FEM_ELASTICITY) { - if (surf_sol) - filename = config->GetSurfStructure_FileName().c_str(); - else - filename = config->GetStructure_FileName().c_str(); - } - - if (Kind_Solver == HEAT_EQUATION_FVM) { - if (surf_sol) filename = config->GetSurfHeat_FileName().c_str(); - else filename = config->GetHeat_FileName().c_str(); - } - - if (config->GetKind_SU2() == SU2_DOT) { - if (surf_sol) - filename = config->GetSurfSens_FileName(); - else - filename = config->GetVolSens_FileName(); - } - - strcpy (cstr, filename.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS || - Kind_Solver == DISC_ADJ_EULER || Kind_Solver == DISC_ADJ_NAVIER_STOKES || Kind_Solver == DISC_ADJ_RANS || - Kind_Solver == FEM_ELASTICITY || Kind_Solver == HEAT_EQUATION_FVM) && - (val_nZone > 1) && - (config->GetUnsteady_Simulation() != HARMONIC_BALANCE)) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - if (SU2_TYPE::Int(val_iInst) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(val_iInst)); - if ((SU2_TYPE::Int(val_iInst) >= 10) && (SU2_TYPE::Int(val_iInst) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(val_iInst)); - if ((SU2_TYPE::Int(val_iInst) >= 100) && (SU2_TYPE::Int(val_iInst) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(val_iInst)); - if ((SU2_TYPE::Int(val_iInst) >= 1000) && (SU2_TYPE::Int(val_iInst) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(val_iInst)); - if (SU2_TYPE::Int(val_iInst) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(val_iInst)); - - } else if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - - } else if (config->GetDynamic_Analysis() && config->GetWrt_Dynamic()) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.vtk", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.vtk", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.vtk", SU2_TYPE::Int(iExtIter)); - } else { - SPRINTF (buffer, ".vtk"); - } - - strcat(cstr, buffer); - - /*--- Open Paraview ASCII file and write the header. ---*/ - - if (rank == MASTER_NODE) { - Paraview_File.open(cstr, ios::out); - Paraview_File.precision(6); - Paraview_File << "# vtk DataFile Version 3.0\n"; - Paraview_File << "vtk output\n"; - Paraview_File << "ASCII\n"; - Paraview_File << "DATASET UNSTRUCTURED_GRID\n"; - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "POINTS "<< nGlobal_Surf_Poin <<" double\n"; - else Paraview_File << "POINTS "<< nGlobal_Poin_Par <<" double\n"; - - } - - Paraview_File.close(); - -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - - /*--- Each processor opens the file. ---*/ - - Paraview_File.open(cstr, ios::out | ios::app); - - /*--- Write surface and volumetric point coordinates. ---*/ - - for (iProcessor = 0; iProcessor < size; iProcessor++) { - if (rank == iProcessor) { - - /*--- Write the node data from this proc ---*/ - - if (surf_sol) { - for (iPoint = 0; iPoint < nSurf_Poin_Par; iPoint++) { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Parallel_Surf_Data[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - } else { - - for (iPoint = 0; iPoint < nParallel_Poin; iPoint++) { - for (iDim = 0; iDim < nDim; iDim++) - Paraview_File << scientific << Parallel_Data[iDim][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - } - } - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - } - - /*--- Reduce the total number of each element. ---*/ - - unsigned long nTot_Line, nTot_BoundTria, nTot_BoundQuad, nTot_Tria, nTot_Quad, nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; -#ifdef HAVE_MPI - SU2_MPI::Reduce(&nParallel_Line, &nTot_Line, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_BoundTria, &nTot_BoundTria, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_BoundQuad, &nTot_BoundQuad, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - - SU2_MPI::Reduce(&nParallel_Tria, &nTot_Tria, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_Quad, &nTot_Quad, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_Tetr, &nTot_Tetr, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_Hexa, &nTot_Hexa, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_Pris, &nTot_Pris, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); - SU2_MPI::Reduce(&nParallel_Pyra, &nTot_Pyra, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, MPI_COMM_WORLD); -#else - nTot_Line = nParallel_Line; - nTot_BoundTria = nParallel_BoundTria; - nTot_BoundQuad = nParallel_BoundQuad; - - nTot_Tria = nParallel_Tria; - nTot_Quad = nParallel_Quad; - nTot_Tetr = nParallel_Tetr; - nTot_Hexa = nParallel_Hexa; - nTot_Pris = nParallel_Pris; - nTot_Pyra = nParallel_Pyra; -#endif - - if (rank == MASTER_NODE) { - - /*--- Write the header ---*/ - nSurf_Elem_Storage = nTot_Line*3 +nTot_BoundTria*4 + nTot_BoundQuad*5; - nGlobal_Elem_Storage = nTot_Tria*4 + nTot_Quad*5 + nTot_Tetr*5 + nTot_Hexa*9 + nTot_Pris*7 + nTot_Pyra*6; - - if (surf_sol) Paraview_File << "\nCELLS " << nSurf_Elem_Par << "\t" << nSurf_Elem_Storage << "\n"; - else Paraview_File << "\nCELLS " << nGlobal_Elem_Par << "\t" << nGlobal_Elem_Storage << "\n"; - - } - - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - - /*--- Write connectivity data. ---*/ - - for (iProcessor = 0; iProcessor < size; iProcessor++) { - if (rank == iProcessor) { - - if (surf_sol) { - - for (iElem = 0; iElem < nParallel_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - Paraview_File << N_POINTS_LINE << "\t"; - Paraview_File << Conn_BoundLine_Par[iNode+0]-1 << "\t"; - Paraview_File << Conn_BoundLine_Par[iNode+1]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << Conn_BoundTria_Par[iNode+0]-1 << "\t"; - Paraview_File << Conn_BoundTria_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_BoundTria_Par[iNode+2]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << Conn_BoundQuad_Par[iNode+0]-1 << "\t"; - Paraview_File << Conn_BoundQuad_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_BoundQuad_Par[iNode+2]-1 << "\t"; - Paraview_File << Conn_BoundQuad_Par[iNode+3]-1 << "\t"; - } - - } - else { - - for (iElem = 0; iElem < nParallel_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << Conn_Tria_Par[iNode+0]-1 << "\t"; - Paraview_File << Conn_Tria_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_Tria_Par[iNode+2]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << Conn_Quad_Par[iNode+0]-1 << "\t"; - Paraview_File << Conn_Quad_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_Quad_Par[iNode+2]-1 << "\t"; - Paraview_File << Conn_Quad_Par[iNode+3]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - Paraview_File << N_POINTS_TETRAHEDRON << "\t"; - Paraview_File << Conn_Tetr_Par[iNode+0]-1 << "\t" << Conn_Tetr_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_Tetr_Par[iNode+2]-1 << "\t" << Conn_Tetr_Par[iNode+3]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - Paraview_File << N_POINTS_HEXAHEDRON << "\t"; - Paraview_File << Conn_Hexa_Par[iNode+0]-1 << "\t" << Conn_Hexa_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_Hexa_Par[iNode+2]-1 << "\t" << Conn_Hexa_Par[iNode+3]-1 << "\t"; - Paraview_File << Conn_Hexa_Par[iNode+4]-1 << "\t" << Conn_Hexa_Par[iNode+5]-1 << "\t"; - Paraview_File << Conn_Hexa_Par[iNode+6]-1 << "\t" << Conn_Hexa_Par[iNode+7]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - Paraview_File << N_POINTS_PRISM << "\t"; - Paraview_File << Conn_Pris_Par[iNode+0]-1 << "\t" << Conn_Pris_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_Pris_Par[iNode+2]-1 << "\t" << Conn_Pris_Par[iNode+3]-1 << "\t"; - Paraview_File << Conn_Pris_Par[iNode+4]-1 << "\t" << Conn_Pris_Par[iNode+5]-1 << "\t"; - } - - for (iElem = 0; iElem < nParallel_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - Paraview_File << N_POINTS_PYRAMID << "\t"; - Paraview_File << Conn_Pyra_Par[iNode+0]-1 << "\t" << Conn_Pyra_Par[iNode+1]-1 << "\t"; - Paraview_File << Conn_Pyra_Par[iNode+2]-1 << "\t" << Conn_Pyra_Par[iNode+3]-1 << "\t"; - Paraview_File << Conn_Pyra_Par[iNode+4]-1 << "\t"; - } - } - } Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - } - - if (rank == MASTER_NODE) { - - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "\nCELL_TYPES " << nSurf_Elem_Par << "\n"; - else Paraview_File << "\nCELL_TYPES " << nGlobal_Elem_Par << "\n"; - } - - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - - for (iProcessor = 0; iProcessor < size; iProcessor++) { - if (rank == iProcessor) { - if (surf_sol) { - for (iElem = 0; iElem < nParallel_Line; iElem++) Paraview_File << "3\t"; - for (iElem = 0; iElem < nParallel_BoundTria; iElem++) Paraview_File << "5\t"; - for (iElem = 0; iElem < nParallel_BoundQuad; iElem++) Paraview_File << "9\t"; - } - else { - for (iElem = 0; iElem < nParallel_Tria; iElem++) Paraview_File << "5\t"; - for (iElem = 0; iElem < nParallel_Quad; iElem++) Paraview_File << "9\t"; - for (iElem = 0; iElem < nParallel_Tetr; iElem++) Paraview_File << "10\t"; - for (iElem = 0; iElem < nParallel_Hexa; iElem++) Paraview_File << "12\t"; - for (iElem = 0; iElem < nParallel_Pris; iElem++) Paraview_File << "13\t"; - for (iElem = 0; iElem < nParallel_Pyra; iElem++) Paraview_File << "14\t"; - } - } Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - } - - if (rank == MASTER_NODE) { - /*--- Write the header ---*/ - if (surf_sol) Paraview_File << "\nPOINT_DATA "<< nGlobal_Surf_Poin <<"\n"; - else Paraview_File << "\nPOINT_DATA "<< nGlobal_Poin_Par <<"\n"; - - } - - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - - unsigned short varStart = 2; - if (nDim == 3) varStart++; - - /*--- Need to adjust container location to avoid PointID tag and coords. ---*/ - unsigned short VarCounter = varStart; - - for (unsigned short iField = varStart; iField < Variable_Names.size(); iField++) { - - fieldname = Variable_Names[iField]; - - fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), fieldname.end()); - - bool output_variable = true, isVector = false; - size_t found = Variable_Names[iField].find("_x"); - if (found!=string::npos) { - output_variable = true; - isVector = true; - } - found = Variable_Names[iField].find("_y"); - if (found!=string::npos) { - output_variable = false; - //skip - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - VarCounter++; - } -found = Variable_Names[iField].find("_z"); - if (found!=string::npos) { - output_variable = false; - //skip - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - VarCounter++; - } - - if (output_variable && isVector) { - - fieldname.erase(fieldname.end()-2,fieldname.end()); - - if (rank == MASTER_NODE) { - Paraview_File << "\nVECTORS " << fieldname << " double\n"; - } - - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - - /*--- Write surface and volumetric point coordinates. ---*/ - - for (iProcessor = 0; iProcessor < size; iProcessor++) { - if (rank == iProcessor) { - - /*--- Write the node data from this proc ---*/ - - if (surf_sol) { - for (iPoint = 0; iPoint < nSurf_Poin_Par; iPoint++) { - /*--- Loop over the vars/residuals and write the values to file ---*/ - Paraview_File << scientific << Parallel_Surf_Data[VarCounter+0][iPoint] << "\t" << Parallel_Surf_Data[VarCounter+1][iPoint] << "\t"; - if (nDim == 3) Paraview_File << scientific << Parallel_Surf_Data[VarCounter+2][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - } else { - for (iPoint = 0; iPoint < nParallel_Poin; iPoint++) { - Paraview_File << scientific << Parallel_Data[VarCounter+0][iPoint] << "\t" << Parallel_Data[VarCounter+1][iPoint] << "\t"; - if (nDim == 3) Paraview_File << scientific << Parallel_Data[VarCounter+2][iPoint] << "\t"; - if (nDim == 2) Paraview_File << scientific << "0.0" << "\t"; - } - } - } - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - } - - VarCounter++; - - } else if (output_variable) { - - if (rank == MASTER_NODE) { - - Paraview_File << "\nSCALARS " << fieldname << " double 1\n"; - Paraview_File << "LOOKUP_TABLE default\n"; - } - - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - - /*--- Write surface and volumetric point coordinates. ---*/ - - for (iProcessor = 0; iProcessor < size; iProcessor++) { - if (rank == iProcessor) { - - /*--- Write the node data from this proc ---*/ - - if (surf_sol) { - for (iPoint = 0; iPoint < nSurf_Poin_Par; iPoint++) { - Paraview_File << scientific << Parallel_Surf_Data[VarCounter][iPoint] << "\t"; - } - } else { - for (iPoint = 0; iPoint < nParallel_Poin; iPoint++) { - Paraview_File << scientific << Parallel_Data[VarCounter][iPoint] << "\t"; - } - } - } - Paraview_File.flush(); -#ifdef HAVE_MPI - SU2_MPI::Barrier(MPI_COMM_WORLD); -#endif - } - - VarCounter++; - } - - } - - Paraview_File.close(); - -} - -void COutput::WriteParaViewBinary_Parallel(CConfig *config, - CGeometry *geometry, - CSolver **solver, - unsigned short val_iZone, - unsigned short val_nZone, - bool surf_sol) { - - unsigned short iDim, nDim = geometry->GetnDim(); - - unsigned long iPoint, iElem, iNode; - - string filename, fieldname; - ofstream Paraview_File; - - filename = GetVTKFilename(config, val_iZone, val_nZone, surf_sol); - - int MAX_STRING_LENGTH = 255; - char str_buf[MAX_STRING_LENGTH], fname[100]; - - const int NCOORDS = 3; - - strcpy(fname, filename.c_str()); - - /*--- Check for big endian. We have to swap bytes otherwise. ---*/ - - bool BigEndian; - union {int i; char c[4];} val; - val.i = 0x76543210; - if (val.c[0] == 0x10) BigEndian = false; - else BigEndian = true; - - /*--- Serial implementation in case we have not compiled with MPI. ---*/ - -#ifndef HAVE_MPI - - FILE* fhw; - fhw = fopen(fname, "wb"); - - unsigned long iNode2; - unsigned long nSurf_Elem_Storage; - unsigned long nGlobal_Elem_Storage; - - /*--- Error check for opening the file. ---*/ - - if (!fhw) { - SU2_MPI::Error(string("Unable to open VTK binary legacy file ") + - filename, CURRENT_FUNCTION); - } - - /*--- File header written in ASCII. ---*/ - - strcpy(str_buf, "# vtk DataFile Version 3.0\n"); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - strcpy(str_buf, "vtk output\n"); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - strcpy(str_buf, "BINARY\n"); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - strcpy(str_buf, "DATASET UNSTRUCTURED_GRID\n"); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - /*--- Write the point coordinates. ---*/ - - unsigned long GlobalPoint; - su2double **Data; - if (surf_sol) { - GlobalPoint = nSurf_Poin_Par; - Data = Parallel_Surf_Data; - } else { - GlobalPoint = nGlobal_Poin_Par; - Data = Parallel_Data; - } - - SPRINTF(str_buf, "POINTS %i float\n", (int)GlobalPoint); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - /*--- Load/write the 1D buffer of point coordinates. ---*/ - - float *coord_buf = new float[GlobalPoint*NCOORDS]; - for (iPoint = 0; iPoint < GlobalPoint; iPoint++) { - for (iDim = 0; iDim < NCOORDS; iDim++) { - if (nDim == 2 && iDim == 2) { - coord_buf[iPoint*NCOORDS + iDim] = 0.0; - } else { - float val = (float)SU2_TYPE::GetValue(Data[iDim][iPoint]); - coord_buf[iPoint*NCOORDS + iDim] = val; - } - } - } - if (!BigEndian) SwapBytes((char *)coord_buf, sizeof(float), 3*GlobalPoint); - - fwrite(coord_buf, sizeof(float), 3*GlobalPoint, fhw); - delete [] coord_buf; - - /*--- Write the connectivity data. ---*/ - - unsigned long nTot_Line, nTot_BoundTria, nTot_BoundQuad; - nTot_Line = nParallel_Line; - nTot_BoundTria = nParallel_BoundTria; - nTot_BoundQuad = nParallel_BoundQuad; - nSurf_Elem_Storage = nTot_Line*3 +nTot_BoundTria*4 + nTot_BoundQuad*5; - - unsigned long nTot_Tria, nTot_Quad; - unsigned long nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; - nTot_Tria = nParallel_Tria; - nTot_Quad = nParallel_Quad; - nTot_Tetr = nParallel_Tetr; - nTot_Hexa = nParallel_Hexa; - nTot_Pris = nParallel_Pris; - nTot_Pyra = nParallel_Pyra; - nGlobal_Elem_Storage = (nTot_Tria*4 + nTot_Quad*5 + nTot_Tetr*5 + - nTot_Hexa*9 + nTot_Pris*7 + nTot_Pyra*6); - - int *conn_buf = NULL; - - if (surf_sol) { - SPRINTF (str_buf, "\nCELLS %i %i\n", (int)nSurf_Elem_Par, - (int)nSurf_Elem_Storage); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - conn_buf = new int[nSurf_Elem_Par*(N_POINTS_QUADRILATERAL+1)]; - } else { - SPRINTF (str_buf, "\nCELLS %i %i\n", (int)nGlobal_Elem_Par, - (int)nGlobal_Elem_Storage); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - conn_buf = new int[nGlobal_Elem_Par*(N_POINTS_HEXAHEDRON+1)]; - } - - /*--- Load/write 1D buffers for the connectivity of each element type. ---*/ - - if (surf_sol) { - - for (iElem = 0; iElem < nParallel_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - iNode2 = iElem*(N_POINTS_LINE+1); - conn_buf[iNode2+0] = N_POINTS_LINE; - conn_buf[iNode2+1] = Conn_BoundLine_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_BoundLine_Par[iNode+1]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Line*(N_POINTS_LINE+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Line*(N_POINTS_LINE+1), fhw); - - for (iElem = 0; iElem < nParallel_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - iNode2 = iElem*(N_POINTS_TRIANGLE+1); - conn_buf[iNode2+0] = N_POINTS_TRIANGLE; - conn_buf[iNode2+1] = Conn_BoundTria_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_BoundTria_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_BoundTria_Par[iNode+2]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_BoundTria*(N_POINTS_TRIANGLE+1)); - fwrite(conn_buf, sizeof(int), - nParallel_BoundTria*(N_POINTS_TRIANGLE+1), fhw); - - for (iElem = 0; iElem < nParallel_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - iNode2 = iElem*(N_POINTS_QUADRILATERAL+1); - conn_buf[iNode2+0] = N_POINTS_QUADRILATERAL; - conn_buf[iNode2+1] = Conn_BoundQuad_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_BoundQuad_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_BoundQuad_Par[iNode+2]-1; - conn_buf[iNode2+4] = Conn_BoundQuad_Par[iNode+3]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_BoundQuad*(N_POINTS_QUADRILATERAL+1)); - fwrite(conn_buf, sizeof(int), - nParallel_BoundQuad*(N_POINTS_QUADRILATERAL+1), fhw); - - } else { - - for (iElem = 0; iElem < nParallel_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - iNode2 = iElem*(N_POINTS_TRIANGLE+1); - conn_buf[iNode2+0] = N_POINTS_TRIANGLE; - conn_buf[iNode2+1] = Conn_Tria_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_Tria_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_Tria_Par[iNode+2]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Tria*(N_POINTS_TRIANGLE+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Tria*(N_POINTS_TRIANGLE+1), fhw); - - for (iElem = 0; iElem < nParallel_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - iNode2 = iElem*(N_POINTS_QUADRILATERAL+1); - conn_buf[iNode2+0] = N_POINTS_QUADRILATERAL; - conn_buf[iNode2+1] = Conn_Quad_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_Quad_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_Quad_Par[iNode+2]-1; - conn_buf[iNode2+4] = Conn_Quad_Par[iNode+3]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Quad*(N_POINTS_QUADRILATERAL+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Quad*(N_POINTS_QUADRILATERAL+1), fhw); - - for (iElem = 0; iElem < nParallel_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - iNode2 = iElem*(N_POINTS_TETRAHEDRON+1); - conn_buf[iNode2+0] = N_POINTS_TETRAHEDRON; - conn_buf[iNode2+1] = Conn_Tetr_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_Tetr_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_Tetr_Par[iNode+2]-1; - conn_buf[iNode2+4] = Conn_Tetr_Par[iNode+3]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Tetr*(N_POINTS_TETRAHEDRON+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Tetr*(N_POINTS_TETRAHEDRON+1), fhw); - - for (iElem = 0; iElem < nParallel_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - iNode2 = iElem*(N_POINTS_HEXAHEDRON+1); - conn_buf[iNode2+0] = N_POINTS_HEXAHEDRON; - conn_buf[iNode2+1] = Conn_Hexa_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_Hexa_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_Hexa_Par[iNode+2]-1; - conn_buf[iNode2+4] = Conn_Hexa_Par[iNode+3]-1; - conn_buf[iNode2+5] = Conn_Hexa_Par[iNode+4]-1; - conn_buf[iNode2+6] = Conn_Hexa_Par[iNode+5]-1; - conn_buf[iNode2+7] = Conn_Hexa_Par[iNode+6]-1; - conn_buf[iNode2+8] = Conn_Hexa_Par[iNode+7]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Hexa*(N_POINTS_HEXAHEDRON+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Hexa*(N_POINTS_HEXAHEDRON+1), fhw); - - for (iElem = 0; iElem < nParallel_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - iNode2 = iElem*(N_POINTS_PRISM+1); - conn_buf[iNode2+0] = N_POINTS_PRISM; - conn_buf[iNode2+1] = Conn_Pris_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_Pris_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_Pris_Par[iNode+2]-1; - conn_buf[iNode2+4] = Conn_Pris_Par[iNode+3]-1; - conn_buf[iNode2+5] = Conn_Pris_Par[iNode+4]-1; - conn_buf[iNode2+6] = Conn_Pris_Par[iNode+5]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Pris*(N_POINTS_PRISM+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Pris*(N_POINTS_PRISM+1), fhw); - - for (iElem = 0; iElem < nParallel_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - iNode2 = iElem*(N_POINTS_PYRAMID+1); - conn_buf[iNode2+0] = N_POINTS_PYRAMID; - conn_buf[iNode2+1] = Conn_Pyra_Par[iNode+0]-1; - conn_buf[iNode2+2] = Conn_Pyra_Par[iNode+1]-1; - conn_buf[iNode2+3] = Conn_Pyra_Par[iNode+2]-1; - conn_buf[iNode2+4] = Conn_Pyra_Par[iNode+3]-1; - conn_buf[iNode2+5] = Conn_Pyra_Par[iNode+4]-1; - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), - nParallel_Pyra*(N_POINTS_PYRAMID+1)); - fwrite(conn_buf, sizeof(int), - nParallel_Pyra*(N_POINTS_PYRAMID+1), fhw); - - } - - if (conn_buf != NULL) delete [] conn_buf; - - /*--- Load/write the cell type for all elements in the file. ---*/ - - if (surf_sol) { - SPRINTF (str_buf, "\nCELL_TYPES %i\n", SU2_TYPE::Int(nSurf_Elem_Par)); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - } else { - SPRINTF (str_buf, "\nCELL_TYPES %i\n", SU2_TYPE::Int(nGlobal_Elem_Par)); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - } - - int *type_buf = NULL; - if (surf_sol) { - - type_buf = new int[nSurf_Elem_Par]; - - for (iElem = 0; iElem < nParallel_Line; iElem++) { - type_buf[iElem] = LINE; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Line); - fwrite(type_buf, sizeof(int), nParallel_Line, fhw); - - for (iElem = 0; iElem < nParallel_BoundTria; iElem++) { - type_buf[iElem] = TRIANGLE; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_BoundTria); - fwrite(type_buf, sizeof(int), nParallel_BoundTria, fhw); - - for (iElem = 0; iElem < nParallel_BoundQuad; iElem++) { - type_buf[iElem] = QUADRILATERAL; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_BoundQuad); - fwrite(type_buf, sizeof(int), nParallel_BoundQuad, fhw); - - } else { - - type_buf = new int[nGlobal_Elem_Par]; - - for (iElem = 0; iElem < nParallel_Tria; iElem++) { - type_buf[iElem] = TRIANGLE; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Tria); - fwrite(type_buf, sizeof(int), nParallel_Tria, fhw); - - for (iElem = 0; iElem < nParallel_Quad; iElem++) { - type_buf[iElem] = QUADRILATERAL; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Quad); - fwrite(type_buf, sizeof(int), nParallel_Quad, fhw); - - for (iElem = 0; iElem < nParallel_Tetr; iElem++) { - type_buf[iElem] = TETRAHEDRON; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Tetr); - fwrite(type_buf, sizeof(int), nParallel_Tetr, fhw); - - for (iElem = 0; iElem < nParallel_Hexa; iElem++) { - type_buf[iElem] = HEXAHEDRON; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Hexa); - fwrite(type_buf, sizeof(int), nParallel_Hexa, fhw); - - for (iElem = 0; iElem < nParallel_Pris; iElem++) { - type_buf[iElem] = PRISM; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Pris); - fwrite(type_buf, sizeof(int), nParallel_Pris, fhw); - - for (iElem = 0; iElem < nParallel_Pyra; iElem++) { - type_buf[iElem] = PYRAMID; - } - if (!BigEndian) - SwapBytes((char *)type_buf, sizeof(int), nParallel_Pyra); - fwrite(type_buf, sizeof(int), nParallel_Pyra, fhw); - - } - - if (type_buf != NULL) delete [] type_buf; - - /*--- Now write the scalar and vector data (reuse the counts above). ---*/ - - SPRINTF (str_buf, "\nPOINT_DATA %i\n", (int)GlobalPoint); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - unsigned short varStart = 2; - if (nDim == 3) varStart++; - - /*--- Need to adjust container location to avoid PointID tag and coords. ---*/ - - unsigned short iField, VarCounter = varStart; - for (iField = varStart; iField < Variable_Names.size(); iField++) { - - fieldname = Variable_Names[iField]; - fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), - fieldname.end()); - - bool output_variable = true, isVector = false; - size_t found = Variable_Names[iField].find("_x"); - if (found!=string::npos) { - output_variable = true; - isVector = true; - } - found = Variable_Names[iField].find("_y"); - if (found!=string::npos) { - //skip - output_variable = false; - VarCounter++; - } - found = Variable_Names[iField].find("_z"); - if (found!=string::npos) { - //skip - output_variable = false; - VarCounter++; - } - - if (output_variable && isVector) { - - fieldname.erase(fieldname.end()-2,fieldname.end()); - SPRINTF (str_buf, "\nVECTORS %s float\n", fieldname.c_str()); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - /*--- Prepare the 1D data buffer on this rank. ---*/ - - float *vec_buf = new float[GlobalPoint*NCOORDS]; - - /*--- For now, create a temp 1D buffer to load up the data for writing. - This will be replaced with a derived data type most likely. ---*/ - - float val = 0.0; - for (iPoint = 0; iPoint < GlobalPoint; iPoint++) - for (iDim = 0; iDim < NCOORDS; iDim++) { - if (nDim == 2 && iDim == 2) { - vec_buf[iPoint*NCOORDS + iDim] = 0.0; - } else { - val = (float)SU2_TYPE::GetValue(Data[VarCounter+iDim][iPoint]); - vec_buf[iPoint*NCOORDS + iDim] = val; - } - } - if (!BigEndian) - SwapBytes((char *)vec_buf, sizeof(float), NCOORDS*GlobalPoint); - fwrite(vec_buf, sizeof(float), NCOORDS*GlobalPoint, fhw); - - delete [] vec_buf; - - VarCounter++; - - } else if (output_variable) { - - SPRINTF (str_buf, "\nSCALARS %s float 1\n", fieldname.c_str()); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - SPRINTF (str_buf, "LOOKUP_TABLE default\n"); - fwrite(str_buf, sizeof(char), strlen(str_buf), fhw); - - /*--- Prepare the 1D data buffer on this rank. ---*/ - - float *scalar_buf = new float[GlobalPoint]; - - /*--- For now, create a temp 1D buffer to load up the data for writing. - This will be replaced with a derived data type most likely. ---*/ - - for (iPoint = 0; iPoint < GlobalPoint; iPoint++) { - float val = (float)SU2_TYPE::GetValue(Data[VarCounter][iPoint]); - scalar_buf[iPoint] = val; - } - if (!BigEndian) - SwapBytes((char *)scalar_buf, sizeof(float), GlobalPoint); - fwrite(scalar_buf, sizeof(float), GlobalPoint, fhw); - - delete [] scalar_buf; - - VarCounter++; - } - - } - - /*--- Close the file. ---*/ - - fclose(fhw); - -#else - - /*--- Parallel binary output using MPI I/O. ---*/ - - MPI_File fhw; - SU2_MPI::Status status; - MPI_Datatype etype, filetype; - MPI_Offset disp, disp2; - int ierr; - - /*--- All ranks open the file using MPI. Here, we try to open the file with - exclusive so that an error is generated if the file exists. We always want - to write a fresh output file, so we delete any existing files and create - a new one. ---*/ - - ierr = MPI_File_open(MPI_COMM_WORLD, fname, - MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, - MPI_INFO_NULL, &fhw); - if (ierr != MPI_SUCCESS) { - MPI_File_close(&fhw); - if (rank == 0) - MPI_File_delete(fname, MPI_INFO_NULL); - ierr = MPI_File_open(MPI_COMM_WORLD, fname, - MPI_MODE_CREATE|MPI_MODE_EXCL|MPI_MODE_WRONLY, - MPI_INFO_NULL, &fhw); - } - - /*--- Error check opening the file. ---*/ - - if (ierr) { - SU2_MPI::Error(string("Unable to open VTK binary legacy file ") + - string(fname), CURRENT_FUNCTION); - } - - /*--- Set pointer to our output data for simplicity. ---*/ - - su2double **Data; - if (surf_sol) { - Data = Parallel_Surf_Data; - } else { - Data = Parallel_Data; - } - - /*--- Write the initial strings to the file. Only the master will - write the header lines, but all ranks will store the offsets. ---*/ - - disp = 0; - strcpy(str_buf, "# vtk DataFile Version 3.0\n"); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - strcpy(str_buf, "vtk output\n"); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - strcpy(str_buf, "BINARY\n"); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - strcpy(str_buf, "DATASET UNSTRUCTURED_GRID\n"); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - /*--- Communicate the number of total points that will be - written by each rank. After this communication, each proc knows how - many poinnts will be written before its location in the file and the - offsets can be correctly set. ---*/ - - unsigned long myPoint, GlobalPoint; - if (surf_sol) { - GlobalPoint = nGlobal_Surf_Poin; - myPoint = nSurf_Poin_Par; - } else { - GlobalPoint = nGlobal_Poin_Par; - myPoint = nParallel_Poin; - } - - int *nPoint_Snd = new int[size+1]; - int *nPointCumulative = new int[size+1]; - - nPoint_Snd[0] = 0; nPointCumulative[0] = 0; - for (int ii=1; ii < size; ii++) { - nPoint_Snd[ii] = myPoint; nPointCumulative[ii] = 0; - } - nPoint_Snd[size] = myPoint; nPointCumulative[size] = 0; - - /*--- Communicate the local counts to all ranks for building offsets. ---*/ - - SU2_MPI::Alltoall(&(nPoint_Snd[1]), 1, MPI_INT, - &(nPointCumulative[1]), 1, MPI_INT, MPI_COMM_WORLD); - - /*--- Put the counters into cumulative storage format. ---*/ - - for (int ii = 0; ii < size; ii++) { - nPointCumulative[ii+1] += nPointCumulative[ii]; - } - - SPRINTF(str_buf, "POINTS %i float\n", SU2_TYPE::Int(GlobalPoint)); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - /*--- Load/write the 1D buffer of point coordinates. Note that we - always have 3 coordinate dimensions, even for 2D problems. ---*/ - - float *coord_buf = new float[myPoint*NCOORDS]; - for (iPoint = 0; iPoint < myPoint; iPoint++) { - for (iDim = 0; iDim < NCOORDS; iDim++) { - if (nDim == 2 && iDim == 2) { - coord_buf[iPoint*NCOORDS + iDim] = 0.0; - } else { - float val = (float)SU2_TYPE::GetValue(Data[iDim][iPoint]); - coord_buf[iPoint*NCOORDS + iDim] = val; - } - } - } - if (!BigEndian) SwapBytes((char *)coord_buf, sizeof(float), myPoint*NCOORDS); - - /*--- We will write the point coordinates as floats. ---*/ - - etype = MPI_FLOAT; - - /*--- Define a derived datatype for this ranks contiguous - chunk of data that will be placed in the file. ---*/ - - MPI_Type_contiguous(myPoint*NCOORDS, MPI_FLOAT, &filetype); - MPI_Type_commit(&filetype); - - /*--- Compute the offset for this rank's linear partition of the - data in bytes. ---*/ - - disp2 = disp + NCOORDS*nPointCumulative[rank]*sizeof(float); - - /*--- Set the view for the MPI file write, i.e., describe the - location in the file that this rank "sees" for writing its - piece of the file. ---*/ - - MPI_File_set_view(fhw, disp2, etype, filetype, - (char*)"native", MPI_INFO_NULL); - - /*--- Collective call for all ranks to write simultaneously. ---*/ - - MPI_File_write_all(fhw, coord_buf, myPoint*NCOORDS, MPI_FLOAT, &status); - - /*--- Update the displacement position for MPI IO. ---*/ - - disp += NCOORDS*nPointCumulative[size]*sizeof(float); - - /*--- Free the derived datatype and coordinate array. ---*/ - - MPI_Type_free(&filetype); - delete [] coord_buf; - - /*--- Compute our local number of elements, the required storage, - and reduce the total number of elements and storage globally. ---*/ - - unsigned long nTot_Line, nTot_BoundTria, nTot_BoundQuad; - unsigned long nTot_Tria, nTot_Quad; - unsigned long nTot_Tetr, nTot_Hexa, nTot_Pris, nTot_Pyra; - unsigned long myElem, myElemStorage, GlobalElem, GlobalElemStorage; - - if (surf_sol) { - - SU2_MPI::Allreduce(&nParallel_Line, &nTot_Line, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_BoundTria, &nTot_BoundTria, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_BoundQuad, &nTot_BoundQuad, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - - myElem = (nParallel_Line + nParallel_BoundTria + - nParallel_BoundQuad); - myElemStorage = (nParallel_Line*3 + nParallel_BoundTria*4 + - nParallel_BoundQuad*5); - - GlobalElem = nTot_Line + nTot_BoundTria + nTot_BoundQuad; - GlobalElemStorage = nTot_Line*3 + nTot_BoundTria*4 + nTot_BoundQuad*5; - - } else { - - SU2_MPI::Allreduce(&nParallel_Tria, &nTot_Tria, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_Quad, &nTot_Quad, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_Tetr, &nTot_Tetr, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_Hexa, &nTot_Hexa, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_Pris, &nTot_Pris, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - SU2_MPI::Allreduce(&nParallel_Pyra, &nTot_Pyra, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MPI_COMM_WORLD); - - myElem = (nParallel_Tria + nParallel_Quad + nParallel_Tetr + - nParallel_Hexa + nParallel_Pris + nParallel_Pyra); - myElemStorage = (nParallel_Tria*4 + nParallel_Quad*5 + nParallel_Tetr*5 + - nParallel_Hexa*9 + nParallel_Pris*7 + nParallel_Pyra*6); - - GlobalElem = (nTot_Tria + nTot_Quad + nTot_Tetr + - nTot_Hexa + nTot_Pris + nTot_Pyra); - GlobalElemStorage = (nTot_Tria*4 + nTot_Quad*5 + nTot_Tetr*5 + - nTot_Hexa*9 + nTot_Pris*7 + nTot_Pyra*6); - - } - - /*--- Communicate the number of total cells/storage that will be - written by each rank. After this communication, each proc knows how - many cells will be written before its location in the file and the - offsets can be correctly set. ---*/ - - int *nElem_Snd = new int[size+1]; int *nElemStorage_Snd = new int[size+1]; - int *nElem_Cum = new int[size+1]; int *nElemStorage_Cum = new int[size+1]; - - nElem_Snd[0] = 0; nElemStorage_Snd[0] = 0; - nElem_Cum[0] = 0; nElemStorage_Cum[0] = 0; - for (int ii=1; ii < size; ii++) { - nElem_Snd[ii] = myElem; nElemStorage_Snd[ii] = myElemStorage; - nElem_Cum[ii] = 0; nElemStorage_Cum[ii] = 0; - } - nElem_Snd[size] = myElem; nElemStorage_Snd[size] = myElemStorage; - nElem_Cum[size] = 0; nElemStorage_Cum[size] = 0; - - /*--- Communicate the local counts to all ranks for building offsets. ---*/ - - SU2_MPI::Alltoall(&(nElem_Snd[1]), 1, MPI_INT, - &(nElem_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); - - SU2_MPI::Alltoall(&(nElemStorage_Snd[1]), 1, MPI_INT, - &(nElemStorage_Cum[1]), 1, MPI_INT, MPI_COMM_WORLD); - - /*--- Put the counters into cumulative storage format. ---*/ - - for (int ii = 0; ii < size; ii++) { - nElem_Cum[ii+1] += nElem_Cum[ii]; - nElemStorage_Cum[ii+1] += nElemStorage_Cum[ii]; - } - - /*--- Reset the file view before writing the next ASCII line for cells. ---*/ - - MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, - (char*)"native", MPI_INFO_NULL); - SPRINTF(str_buf, "\nCELLS %i %i\n", SU2_TYPE::Int(GlobalElem), - SU2_TYPE::Int(GlobalElemStorage)); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - /*--- Load/write 1D buffers for the connectivity of each element type. ---*/ - - int *conn_buf = new int[myElemStorage]; - unsigned long iStorage = 0; - - if (surf_sol) { - - for (iElem = 0; iElem < nParallel_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - conn_buf[iStorage+0] = N_POINTS_LINE; - conn_buf[iStorage+1] = Conn_BoundLine_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_BoundLine_Par[iNode+1]-1; - iStorage += (N_POINTS_LINE+1); - } - - for (iElem = 0; iElem < nParallel_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - conn_buf[iStorage+0] = N_POINTS_TRIANGLE; - conn_buf[iStorage+1] = Conn_BoundTria_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_BoundTria_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_BoundTria_Par[iNode+2]-1; - iStorage += (N_POINTS_TRIANGLE+1); - } - - for (iElem = 0; iElem < nParallel_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - conn_buf[iStorage+0] = N_POINTS_QUADRILATERAL; - conn_buf[iStorage+1] = Conn_BoundQuad_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_BoundQuad_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_BoundQuad_Par[iNode+2]-1; - conn_buf[iStorage+4] = Conn_BoundQuad_Par[iNode+3]-1; - iStorage += (N_POINTS_QUADRILATERAL+1); - } - - } else { - - for (iElem = 0; iElem < nParallel_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - conn_buf[iStorage+0] = N_POINTS_TRIANGLE; - conn_buf[iStorage+1] = Conn_Tria_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_Tria_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_Tria_Par[iNode+2]-1; - iStorage += (N_POINTS_TRIANGLE+1); - } - - for (iElem = 0; iElem < nParallel_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - conn_buf[iStorage+0] = N_POINTS_QUADRILATERAL; - conn_buf[iStorage+1] = Conn_Quad_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_Quad_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_Quad_Par[iNode+2]-1; - conn_buf[iStorage+4] = Conn_Quad_Par[iNode+3]-1; - iStorage += (N_POINTS_QUADRILATERAL+1); - - } - - for (iElem = 0; iElem < nParallel_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - conn_buf[iStorage+0] = N_POINTS_TETRAHEDRON; - conn_buf[iStorage+1] = Conn_Tetr_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_Tetr_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_Tetr_Par[iNode+2]-1; - conn_buf[iStorage+4] = Conn_Tetr_Par[iNode+3]-1; - iStorage += (N_POINTS_TETRAHEDRON+1); - - } - - for (iElem = 0; iElem < nParallel_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - conn_buf[iStorage+0] = N_POINTS_HEXAHEDRON; - conn_buf[iStorage+1] = Conn_Hexa_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_Hexa_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_Hexa_Par[iNode+2]-1; - conn_buf[iStorage+4] = Conn_Hexa_Par[iNode+3]-1; - conn_buf[iStorage+5] = Conn_Hexa_Par[iNode+4]-1; - conn_buf[iStorage+6] = Conn_Hexa_Par[iNode+5]-1; - conn_buf[iStorage+7] = Conn_Hexa_Par[iNode+6]-1; - conn_buf[iStorage+8] = Conn_Hexa_Par[iNode+7]-1; - iStorage += (N_POINTS_HEXAHEDRON+1); - } - - for (iElem = 0; iElem < nParallel_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - conn_buf[iStorage+0] = N_POINTS_PRISM; - conn_buf[iStorage+1] = Conn_Pris_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_Pris_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_Pris_Par[iNode+2]-1; - conn_buf[iStorage+4] = Conn_Pris_Par[iNode+3]-1; - conn_buf[iStorage+5] = Conn_Pris_Par[iNode+4]-1; - conn_buf[iStorage+6] = Conn_Pris_Par[iNode+5]-1; - iStorage += (N_POINTS_PRISM+1); - } - - for (iElem = 0; iElem < nParallel_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - conn_buf[iStorage+0] = N_POINTS_PYRAMID; - conn_buf[iStorage+1] = Conn_Pyra_Par[iNode+0]-1; - conn_buf[iStorage+2] = Conn_Pyra_Par[iNode+1]-1; - conn_buf[iStorage+3] = Conn_Pyra_Par[iNode+2]-1; - conn_buf[iStorage+4] = Conn_Pyra_Par[iNode+3]-1; - conn_buf[iStorage+5] = Conn_Pyra_Par[iNode+4]-1; - iStorage += (N_POINTS_PYRAMID+1); - } - - } - if (!BigEndian) SwapBytes((char *)conn_buf, sizeof(int), myElemStorage); - - /*--- We write the connectivity with MPI_INTs. ---*/ - - etype = MPI_INT; - - /*--- Define a derived datatype for this ranks contiguous - chunk of data that will be placed in the file. ---*/ - - MPI_Type_contiguous(myElemStorage, MPI_INT, &filetype); - MPI_Type_commit(&filetype); - - /*--- Compute the offset for this rank's linear partition of the - data in bytes. ---*/ - - disp2 = (disp + nElemStorage_Cum[rank]*sizeof(int)); - - /*--- Set the view for the MPI file write, i.e., describe the - location in the file that this rank "sees" for writing its - piece of the file. ---*/ - - MPI_File_set_view(fhw, disp2, etype, filetype, - (char*)"native", MPI_INFO_NULL); - - /*--- Collective call for all ranks to write simultaneously. ---*/ - - MPI_File_write_all(fhw, conn_buf, myElemStorage, MPI_INT, &status); - - /*--- Update the displacement position for MPI IO. ---*/ - - disp += nElemStorage_Cum[size]*sizeof(int); - - /*--- Free the derived datatype. ---*/ - - MPI_Type_free(&filetype); - delete [] conn_buf; - - /*--- Load/write the cell type for all elements in the file. ---*/ - - MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, - (char*)"native", MPI_INFO_NULL); - SPRINTF (str_buf, "\nCELL_TYPES %i\n", SU2_TYPE::Int(GlobalElem)); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - int *type_buf = new int[myElem]; - unsigned long jElem = 0; - - if (surf_sol) { - for (iElem = 0; iElem < nParallel_Line; iElem++) { - type_buf[jElem] = LINE; jElem++; - } - for (iElem = 0; iElem < nParallel_BoundTria; iElem++) { - type_buf[jElem] = TRIANGLE; jElem++; - } - for (iElem = 0; iElem < nParallel_BoundQuad; iElem++) { - type_buf[jElem] = QUADRILATERAL; jElem++; - } - } else { - for (iElem = 0; iElem < nParallel_Tria; iElem++) { - type_buf[jElem] = TRIANGLE; jElem++; - } - for (iElem = 0; iElem < nParallel_Quad; iElem++) { - type_buf[jElem] = QUADRILATERAL; jElem++; - } - for (iElem = 0; iElem < nParallel_Tetr; iElem++) { - type_buf[jElem] = TETRAHEDRON; jElem++; - } - for (iElem = 0; iElem < nParallel_Hexa; iElem++) { - type_buf[jElem] = HEXAHEDRON; jElem++; - } - for (iElem = 0; iElem < nParallel_Pris; iElem++) { - type_buf[jElem] = PRISM; jElem++; - } - for (iElem = 0; iElem < nParallel_Pyra; iElem++) { - type_buf[jElem] = PYRAMID; jElem++; - } - } - if (!BigEndian) SwapBytes((char *)type_buf, sizeof(int), myElem); - - /*--- We write the cell types with MPI_INTs. ---*/ - - etype = MPI_INT; - - /*--- Define a derived datatype for this ranks contiguous - chunk of data that will be placed in the file. ---*/ - - MPI_Type_contiguous(myElem, MPI_INT, &filetype); - MPI_Type_commit(&filetype); - - /*--- Compute the offset for this rank's linear partition of the - data in bytes. ---*/ - - disp2 = (disp + nElem_Cum[rank]*sizeof(int)); - - /*--- Set the view for the MPI file write, i.e., describe the - location in the file that this rank "sees" for writing its - piece of the file. ---*/ - - MPI_File_set_view(fhw, disp2, etype, filetype, - (char*)"native", MPI_INFO_NULL); - - /*--- Collective call for all ranks to write simultaneously. ---*/ - - MPI_File_write_all(fhw, type_buf, myElem, MPI_INT, &status); - - /*--- Update the displacement position for MPI IO. ---*/ - - disp += nElem_Cum[size]*sizeof(int); - - /*--- Free the derived datatype. ---*/ - - MPI_Type_free(&filetype); - if (type_buf != NULL) delete [] type_buf; - - /*--- Now write the scalar and vector point data. ---*/ - - MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, - (char*)"native", MPI_INFO_NULL); - SPRINTF (str_buf, "\nPOINT_DATA %i\n", SU2_TYPE::Int(GlobalPoint)); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - /*--- Adjust container start location to avoid point coords. ---*/ - - unsigned short varStart = 2; - if (nDim == 3) varStart++; - - /*--- Loop over all variables that have been registered in the output. ---*/ - - unsigned short iField, VarCounter = varStart; - for (iField = varStart; iField < Variable_Names.size(); iField++) { - - fieldname = Variable_Names[iField]; - fieldname.erase(remove(fieldname.begin(), fieldname.end(), '"'), - fieldname.end()); - - /*--- Check whether this field is a vector or scalar. ---*/ - - bool output_variable = true, isVector = false; - size_t found = Variable_Names[iField].find("_x"); - if (found!=string::npos) { - output_variable = true; - isVector = true; - } - found = Variable_Names[iField].find("_y"); - if (found!=string::npos) { - /*--- We have found a vector, so skip the Y component. ---*/ - output_variable = false; - VarCounter++; - } - found = Variable_Names[iField].find("_z"); - if (found!=string::npos) { - /*--- We have found a vector, so skip the Z component. ---*/ - output_variable = false; - VarCounter++; - } - - /*--- Write the point data as an vector or a scalar. ---*/ - - if (output_variable && isVector) { - - /*--- Adjust the string name to remove the leading "X-" ---*/ - - fieldname.erase(fieldname.end()-2,fieldname.end()); - MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, - (char*)"native", MPI_INFO_NULL); - SPRINTF (str_buf, "\nVECTORS %s float\n", fieldname.c_str()); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - /*--- Prepare the 1D data buffer on this rank. ---*/ - - float *vec_buf = new float[myPoint*NCOORDS]; - - /*--- Load up the buffer for writing this rank's vector data. ---*/ - - float val = 0.0; - for (iPoint = 0; iPoint < myPoint; iPoint++) { - for (iDim = 0; iDim < NCOORDS; iDim++) { - if (nDim == 2 && iDim == 2) { - vec_buf[iPoint*NCOORDS + iDim] = 0.0; - } else { - val = (float)SU2_TYPE::GetValue(Data[VarCounter+iDim][iPoint]); - vec_buf[iPoint*NCOORDS + iDim] = val; - } - } - } - if (!BigEndian) - SwapBytes((char *)vec_buf, sizeof(float), myPoint*NCOORDS); - - /*--- We will write the point data as floats. ---*/ - - etype = MPI_FLOAT; - - /*--- Define a derived datatype for this ranks contiguous - chunk of data that will be placed in the file. ---*/ - - MPI_Type_contiguous(myPoint*NCOORDS, MPI_FLOAT, &filetype); - MPI_Type_commit(&filetype); - - /*--- Compute the offset for this rank's linear partition of the - data in bytes. ---*/ - - disp2 = disp + NCOORDS*nPointCumulative[rank]*sizeof(float); - - /*--- Set the view for the MPI file write, i.e., describe the - location in the file that this rank "sees" for writing its - piece of the file. ---*/ - - MPI_File_set_view(fhw, disp2, etype, filetype, - (char*)"native", MPI_INFO_NULL); - - /*--- Collective call for all ranks to write simultaneously. ---*/ - - MPI_File_write_all(fhw, vec_buf, myPoint*NCOORDS, MPI_FLOAT, &status); - - /*--- Update the displacement position for MPI IO. ---*/ - - disp += NCOORDS*nPointCumulative[size]*sizeof(float); - - /*--- Free the derived datatype and coordinate array. ---*/ - - MPI_Type_free(&filetype); - delete [] vec_buf; vec_buf = NULL; - - VarCounter++; - - } else if (output_variable) { - - MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, - (char*)"native", MPI_INFO_NULL); - SPRINTF (str_buf, "\nSCALARS %s float 1\n", fieldname.c_str()); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - MPI_File_set_view(fhw, 0, MPI_BYTE, MPI_BYTE, - (char*)"native", MPI_INFO_NULL); - SPRINTF (str_buf, "LOOKUP_TABLE default\n"); - if (rank == MASTER_NODE) - MPI_File_write_at(fhw, disp, str_buf, strlen(str_buf), - MPI_CHAR, MPI_STATUS_IGNORE); - disp += strlen(str_buf)*sizeof(char); - - /*--- Prepare the 1D data buffer on this rank. ---*/ - - float *scalar_buf = new float[myPoint]; - - /*--- For now, create a temp 1D buffer to load up the data for writing. - This will be replaced with a derived data type most likely. ---*/ - - for (iPoint = 0; iPoint < myPoint; iPoint++) { - float val = (float)SU2_TYPE::GetValue(Data[VarCounter][iPoint]); - scalar_buf[iPoint] = val; - } - if (!BigEndian) SwapBytes((char *)scalar_buf, sizeof(float), myPoint); - - /*--- We will write the point data as floats. ---*/ - - etype = MPI_FLOAT; - - /*--- Define a derived datatype for this ranks contiguous - chunk of data that will be placed in the file. ---*/ - - MPI_Type_contiguous(myPoint, MPI_FLOAT, &filetype); - MPI_Type_commit(&filetype); - - /*--- Compute the offset for this rank's linear partition of the - data in bytes. ---*/ - - disp2 = disp + nPointCumulative[rank]*sizeof(float); - - /*--- Set the view for the MPI file write, i.e., describe the - location in the file that this rank "sees" for writing its - piece of the file. ---*/ - - MPI_File_set_view(fhw, disp2, etype, filetype, - (char*)"native", MPI_INFO_NULL); - - /*--- Collective call for all ranks to write simultaneously. ---*/ - - MPI_File_write_all(fhw, scalar_buf, myPoint, MPI_FLOAT, &status); - - /*--- Update the displacement position for MPI IO. ---*/ - - disp += nPointCumulative[size]*sizeof(float); - - /*--- Free the derived datatype and coordinate array. ---*/ - - MPI_Type_free(&filetype); - delete [] scalar_buf; scalar_buf = NULL; - - VarCounter++; - } - - } - - /*--- All ranks close the file after writing. ---*/ - - MPI_File_close(&fhw); - - /*--- Delete the offset counters that we needed for MPI IO. ---*/ - - delete [] nElem_Snd; delete [] nElem_Cum; - delete [] nElemStorage_Snd; delete [] nElemStorage_Cum; - delete [] nPoint_Snd; delete [] nPointCumulative; - -#endif - -} diff --git a/SU2_CFD/src/output_su2.cpp b/SU2_CFD/src/output_su2.cpp deleted file mode 100644 index fc30602387f4..000000000000 --- a/SU2_CFD/src/output_su2.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/*! - * \file output_su2.cpp - * \brief Main subroutines for output solver information. - * \author F. Palacios, T. Economon, M. Colonno - * \version 6.2.0 "Falcon" - * - * The current SU2 release has been coordinated by the - * SU2 International Developers Society - * with selected contributions from the open-source community. - * - * The main research teams contributing to the current release are: - * - Prof. Juan J. Alonso's group at Stanford University. - * - Prof. Piero Colonna's group at Delft University of Technology. - * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. - * - Prof. Alberto Guardone's group at Polytechnic University of Milan. - * - Prof. Rafael Palacios' group at Imperial College London. - * - Prof. Vincent Terrapon's group at the University of Liege. - * - Prof. Edwin van der Weide's group at the University of Twente. - * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. - * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, - * Tim Albring, and the SU2 contributors. - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../include/output_structure.hpp" - -void COutput::SetSU2_MeshASCII(CConfig *config, CGeometry *geometry, unsigned short val_iZone, ofstream& output_file) { - - unsigned long iElem, iPoint, iElem_Bound, nElem_Bound_, vnodes_edge[2], vnodes_triangle[3], vnodes_quad[4], iNode, nElem; - unsigned short iMarker, iDim, nDim = geometry->GetnDim(), iChar, VTK_Type, nMarker_; - short SendTo; - ifstream input_file; - string Grid_Marker, text_line, Marker_Tag, str; - string::size_type position; - - if (config->GetnZone() > 1){ - output_file << "IZONE= " << val_iZone+1 << endl; - } - - /*--- Write dimensions data. ---*/ - - output_file << "NDIME= " << nDim << endl; - - /*--- Write the angle of attack offset. ---*/ - - output_file << "AOA_OFFSET= " << config->GetAoA_Offset() << endl; - - /*--- Write the angle of attack offset. ---*/ - - output_file << "AOS_OFFSET= " << config->GetAoS_Offset() << endl; - - /*--- Write connectivity data. ---*/ - - nElem = nGlobal_Tria+nGlobal_Quad+nGlobal_Tetr+nGlobal_Hexa+nGlobal_Pris+nGlobal_Pyra; - - output_file << "NELEM= " << nElem<< endl; - - nElem = 0; - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - output_file << "5\t"; - output_file << Conn_Tria[iNode+0]-1 << "\t"; output_file << Conn_Tria[iNode+1]-1 << "\t"; - output_file << Conn_Tria[iNode+2]-1 << "\t"; - output_file << nElem << "\n"; nElem++; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - output_file << "9\t"; - output_file << Conn_Quad[iNode+0]-1 << "\t"; output_file << Conn_Quad[iNode+1]-1 << "\t"; - output_file << Conn_Quad[iNode+2]-1 << "\t"; output_file << Conn_Quad[iNode+3]-1 << "\t"; - output_file << nElem << "\n"; nElem++; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - output_file << "10\t"; - output_file << Conn_Tetr[iNode+0]-1 << "\t" << Conn_Tetr[iNode+1]-1 << "\t"; - output_file << Conn_Tetr[iNode+2]-1 << "\t" << Conn_Tetr[iNode+3]-1 << "\t"; - output_file << nElem << "\n"; nElem++; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - output_file << "12\t"; - output_file << Conn_Hexa[iNode+0]-1 << "\t" << Conn_Hexa[iNode+1]-1 << "\t"; - output_file << Conn_Hexa[iNode+2]-1 << "\t" << Conn_Hexa[iNode+3]-1 << "\t"; - output_file << Conn_Hexa[iNode+4]-1 << "\t" << Conn_Hexa[iNode+5]-1 << "\t"; - output_file << Conn_Hexa[iNode+6]-1 << "\t" << Conn_Hexa[iNode+7]-1 << "\t"; - output_file << nElem << "\n"; nElem++; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - output_file << "13\t"; - output_file << Conn_Pris[iNode+0]-1 << "\t" << Conn_Pris[iNode+1]-1 << "\t"; - output_file << Conn_Pris[iNode+2]-1 << "\t" << Conn_Pris[iNode+3]-1 << "\t"; - output_file << Conn_Pris[iNode+4]-1 << "\t" << Conn_Pris[iNode+5]-1 << "\t"; - output_file << nElem << "\n"; nElem++; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - output_file << "14\t"; - output_file << Conn_Pyra[iNode+0]-1 << "\t" << Conn_Pyra[iNode+1]-1 << "\t"; - output_file << Conn_Pyra[iNode+2]-1 << "\t" << Conn_Pyra[iNode+3]-1 << "\t"; - output_file << Conn_Pyra[iNode+4]-1 << "\t"; - output_file << nElem << "\n"; nElem++; - } - - /*--- Write the node coordinates ---*/ - - output_file << "NPOIN= " << nGlobal_Doma; - if (geometry->GetGlobal_nPointDomain() != nGlobal_Doma) - output_file << "\t" << geometry->GetGlobal_nPointDomain(); - output_file << endl; - - for (iPoint = 0; iPoint < nGlobal_Doma; iPoint++) { - for (iDim = 0; iDim < nDim; iDim++) - output_file << scientific << Coords[iDim][iPoint] << "\t"; - output_file << iPoint << endl; - } - - /*--- Read the boundary information ---*/ - - str = "boundary.dat"; - - str = config->GetMultizone_FileName(str, val_iZone); - - input_file.open(str.c_str(), ios::out); - - /*--- Read grid file with format SU2 ---*/ - - while (getline (input_file, text_line)) { - - /*--- Write the physical boundaries ---*/ - - position = text_line.find ("NMARK=",0); - if (position != string::npos) { - - text_line.erase (0,6); nMarker_ = atoi(text_line.c_str()); - output_file << "NMARK= " << nMarker_ << endl; - - for (iMarker = 0 ; iMarker < nMarker_; iMarker++) { - - getline (input_file, text_line); - text_line.erase (0,11); - string::size_type position; - for (iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); - if (position != string::npos) text_line.erase (position,1); - } - Marker_Tag = text_line.c_str(); - - /*--- Standart physical boundary ---*/ - - getline (input_file, text_line); - - text_line.erase (0,13); nElem_Bound_ = atoi(text_line.c_str()); - output_file << "MARKER_TAG= " << Marker_Tag << endl; - output_file << "MARKER_ELEMS= " << nElem_Bound_<< endl; - getline (input_file, text_line); - - text_line.erase (0,8); SendTo = atoi(text_line.c_str()); - - if (Marker_Tag == "SEND_RECEIVE"){ - output_file << "SEND_TO= " << SendTo << endl; - } - for (iElem_Bound = 0; iElem_Bound < nElem_Bound_; iElem_Bound++) { - - getline(input_file, text_line); - istringstream bound_line(text_line); - - bound_line >> VTK_Type; - output_file << VTK_Type; - - switch(VTK_Type) { - case LINE: - bound_line >> vnodes_edge[0]; bound_line >> vnodes_edge[1]; - output_file << "\t" << vnodes_edge[0] << "\t" << vnodes_edge[1] << endl; - break; - case TRIANGLE: - bound_line >> vnodes_triangle[0]; bound_line >> vnodes_triangle[1]; bound_line >> vnodes_triangle[2]; - output_file << "\t" << vnodes_triangle[0] << "\t" << vnodes_triangle[1] << "\t" << vnodes_triangle[2] << endl; - break; - case QUADRILATERAL: - bound_line >> vnodes_quad[0]; bound_line >> vnodes_quad[1]; bound_line >> vnodes_quad[2]; bound_line >> vnodes_quad[3]; - output_file << "\t" << vnodes_quad[0] << "\t" << vnodes_quad[1] << "\t" << vnodes_quad[2] << "\t" << vnodes_quad[3] << endl; - break; - case VERTEX: - bound_line >> vnodes_edge[0]; bound_line >> vnodes_edge[1]; - output_file << "\t" << vnodes_edge[0] << "\t" << vnodes_edge[1] <GetnDim(); - unsigned long iPoint; - char cstr[200]; - - /*--- Prepare the file name. ---*/ - - strcpy(cstr, "coordinates"); - if (config->GetnZone() > 1){ - char appstr[200]; - SPRINTF(appstr, "_%u", val_iZone); - strcat(cstr, appstr); - } - strcat(cstr,".dat"); - - /*--- Prepare the first ints containing the counts. The first is a - the total number of points written. The second is the dimension. - We know the rest of the file will contain the coords (nPoints*nDim). ---*/ - - int var_buf_size = 2; - int var_buf[2] = {(int)nGlobal_Poin, nDim}; - - /*--- Prepare the 1D data buffer on this rank. ---*/ - - passivedouble *buf = new passivedouble[nGlobal_Poin*nDim]; - - /*--- For now, create a temp 1D buffer to load up the data for writing. - This will be replaced with a derived data type most likely. ---*/ - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) - for (iDim = 0; iDim < nDim; iDim++) - buf[iPoint*nDim+iDim] = SU2_TYPE::GetValue(Coords[iDim][iPoint]); - - /*--- Write the binary file. Everything is done in serial, as only the - master node has the data and enters this routine. ---*/ - - FILE* fhw; - fhw = fopen(cstr, "wb"); - - /*--- Error check for opening the file. ---*/ - - if (!fhw) { - SU2_MPI::Error(string("Unable to open binary coordinates file ") + - string(cstr), CURRENT_FUNCTION); - } - - /*--- First, write the number of variables and points. ---*/ - - fwrite(var_buf, var_buf_size, sizeof(int), fhw); - - /*--- Call to write the entire restart file data in binary in one shot. ---*/ - - fwrite(buf, nGlobal_Poin*nDim, sizeof(passivedouble), fhw); - - /*--- Close the file. ---*/ - - fclose(fhw); - - /*--- Release buffer memory. ---*/ - - delete [] buf; - -} - -void COutput::WriteProjectedSensitivity(CConfig *config, - CGeometry *geometry, - unsigned short val_iZone, - unsigned short val_nZone) { - - unsigned short iVar; - unsigned long iPoint, iElem, iNode; - unsigned long *LocalIndex = NULL; - bool *SurfacePoint = NULL; - string filename, fieldname; - - filename = config->GetDV_Sens_Filename(); - - ofstream Sens_File; - Sens_File.open(filename.c_str(), ios::out); - Sens_File.precision(15); - - /*--- This is surface output, so print only the points - that are in the element list. Change the numbering. ---*/ - - LocalIndex = new unsigned long [nGlobal_Poin+1]; - SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) - SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) {nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin;} - } - - /*--- Write surface x,y,z and surface dJ/dx, dJ/dy, dJ/dz data. ---*/ - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - - if (LocalIndex[iPoint+1] != 0) { - - /*--- Write the node coordinates and the sensitivities. Note that - we subtract 2 from the fields list to ignore the initial ID and - final sens.normal value in the Data array. ---*/ - - for (iVar = 0; iVar < config->fields.size()-2; iVar++) - Sens_File << scientific << Data[iVar][iPoint] << "\t"; - Sens_File << scientific << "\n"; - - } - } - -} - diff --git a/SU2_CFD/src/output_tecplot.cpp b/SU2_CFD/src/output_tecplot.cpp deleted file mode 100644 index a8f865e2250b..000000000000 --- a/SU2_CFD/src/output_tecplot.cpp +++ /dev/null @@ -1,3556 +0,0 @@ -/*! - * \file output_tecplot.cpp - * \brief Main subroutines for output solver information. - * \author F. Palacios, T. Economon, M. Colonno - * \version 6.2.0 "Falcon" - * - * The current SU2 release has been coordinated by the - * SU2 International Developers Society - * with selected contributions from the open-source community. - * - * The main research teams contributing to the current release are: - * - Prof. Juan J. Alonso's group at Stanford University. - * - Prof. Piero Colonna's group at Delft University of Technology. - * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. - * - Prof. Alberto Guardone's group at Polytechnic University of Milan. - * - Prof. Rafael Palacios' group at Imperial College London. - * - Prof. Vincent Terrapon's group at the University of Liege. - * - Prof. Edwin van der Weide's group at the University of Twente. - * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. - * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, - * Tim Albring, and the SU2 contributors. - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../include/output_structure.hpp" - -void COutput::SetTecplotASCII(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol) { - - unsigned short iDim, iVar, nDim = geometry->GetnDim(); - unsigned short Kind_Solver = config->GetKind_Solver(); - - unsigned long iPoint, iElem, iNode; - unsigned long iExtIter = config->GetExtIter(); - unsigned long *LocalIndex = NULL; - bool *SurfacePoint = NULL; - - bool dynamic_grid = config->GetDynamic_Grid(); - bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - - char cstr[200], buffer[50]; - string filename; - - /*--- Write file name with extension ---*/ - - if (surf_sol) { - if (adjoint) filename = config->GetSurfAdjCoeff_FileName(); - else filename = config->GetSurfFlowCoeff_FileName(); - } - else { - if (adjoint) - filename = config->GetAdj_FileName(); - else filename = config->GetFlow_FileName(); - } - - if (Kind_Solver == FEM_ELASTICITY) { - if (surf_sol) filename = config->GetSurfStructure_FileName().c_str(); - else filename = config->GetStructure_FileName().c_str(); - } - - if (Kind_Solver == HEAT_EQUATION_FVM) { - if (surf_sol) filename = config->GetSurfHeat_FileName().c_str(); - else filename = config->GetHeat_FileName().c_str(); - } - - if (config->GetKind_SU2() == SU2_DOT) { - if (surf_sol) filename = config->GetSurfSens_FileName(); - else filename = config->GetVolSens_FileName(); - } - strcpy (cstr, filename.c_str()); - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == INC_EULER || Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS || - Kind_Solver == DISC_ADJ_EULER || Kind_Solver == DISC_ADJ_NAVIER_STOKES || Kind_Solver == DISC_ADJ_RANS || - Kind_Solver == DISC_ADJ_INC_EULER || Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES || Kind_Solver == DISC_ADJ_INC_RANS || - Kind_Solver == HEAT_EQUATION_FVM) && - (val_nZone > 1) ) { - SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); - strcat(cstr, buffer); - } - - if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady() && config->GetUnsteady_Simulation() != HARMONIC_BALANCE) { - if (SU2_TYPE::Int(iExtIter) < 10) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.dat", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(iExtIter)); - } - else { SPRINTF (buffer, ".dat"); } - - strcat(cstr, buffer); - - /*--- Open Tecplot ASCII file and write the header. ---*/ - ofstream Tecplot_File; - Tecplot_File.open(cstr, ios::out); - Tecplot_File.precision(6); - if (surf_sol) Tecplot_File << "TITLE = \"Visualization of the surface solution\"" << endl; - else Tecplot_File << "TITLE = \"Visualization of the volumetric solution\"" << endl; - - /*--- Prepare the variable lists. ---*/ - - /*--- Write the list of the fields in the restart file. - Without including the PointID---*/ - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - - /*--- If SU2_SOL called this routine, we already have a set of output - variables with the appropriate string tags stored in the config class. ---*/ - Tecplot_File << "VARIABLES = "; - nVar_Total = config->fields.size() - 1; - for (unsigned short iField = 1; iField < config->fields.size(); iField++) { - Tecplot_File << config->fields[iField] << " "; - } - Tecplot_File << endl; - - } else { - - if (nDim == 2) { - Tecplot_File << "VARIABLES = \"x\",\"y\""; - } else { - Tecplot_File << "VARIABLES = \"x\",\"y\",\"z\""; - } - - /*--- Add names for conservative and residual variables ---*/ - for (iVar = 0; iVar < nVar_Consv; iVar++) { - Tecplot_File << ",\"Conservative_" << iVar+1 << "\""; - } - - if (!config->GetLow_MemoryOutput()) { - - if (config->GetWrt_Limiters()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - Tecplot_File << ",\"Limiter_" << iVar+1 << "\""; - } - } - if (config->GetWrt_Residuals()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - Tecplot_File << ",\"Residual_" << iVar+1 << "\""; - } - } - - /*--- Add names for any extra variables (this will need to be adjusted). ---*/ - if (dynamic_grid) { - if (nDim == 2) { - Tecplot_File << ",\"Grid_Velx\",\"Grid_Vely\""; - } else { - Tecplot_File << ",\"Grid_Velx\",\"Grid_Vely\",\"Grid_Velz\""; - } - } - - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || - (Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - Tecplot_File << ",\"Pressure\",\"Temperature\",\"Cp\",\"Mach\""; - } - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || - ((Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS))) { - if (nDim == 2) Tecplot_File << ", \"m\", \"Cf_x\", \"Cf_y\", \"h\", \"y+\""; - else Tecplot_File << ", \"m\", \"Cf_x\", \"Cf_y\", \"Cf_z\", \"h\", \"y+\""; - } - - if (Kind_Solver == RANS || Kind_Solver == INC_RANS) { - Tecplot_File << ", \"mt\""; - } - - if (config->GetWrt_SharpEdges()) { - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS) || - (Kind_Solver == INC_EULER) || (Kind_Solver == INC_NAVIER_STOKES) || (Kind_Solver == INC_RANS)) { - Tecplot_File << ", \"Sharp_Edge_Dist\""; - } - } - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS ) ) { - Tecplot_File << ", \"Surface_Sensitivity\", \"Solution_Sensor\""; - } - - if (( Kind_Solver == DISC_ADJ_EULER ) || - ( Kind_Solver == DISC_ADJ_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_RANS ) || - ( Kind_Solver == DISC_ADJ_INC_EULER ) || - ( Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES ) || - ( Kind_Solver == DISC_ADJ_INC_RANS ) ) { - Tecplot_File << ", \"Surface_Sensitivity\", \"Sensitivity_x\", \"Sensitivity_y\""; - if (geometry->GetnDim() == 3) { - Tecplot_File << ",\"Sensitivity_z\""; - } - } - - if (Kind_Solver == FEM_ELASTICITY) { - Tecplot_File << ", \"Von_Mises_Stress\""; - } - - if (config->GetExtraOutput()) { - string *headings = NULL; - //if (Kind_Solver == RANS) { - headings = solver[TURB_SOL]->OutputHeadingNames; - //} - for (iVar = 0; iVar < nVar_Extra; iVar++) { - //Tecplot_File << ", \"ExtraOutput_" << iVar+1<<"\""; - if (headings == NULL) { - Tecplot_File << ", \"ExtraOutput_" << iVar+1<<"\""; - } else { - Tecplot_File << ", \""<< headings[iVar] <<"\""; - } - } - } - } - - Tecplot_File << endl; - - } - - /*--- If it's a surface output, print only the points - that are in the element list, change the numbering ---*/ - - if (surf_sol) { - - LocalIndex = new unsigned long [nGlobal_Poin+1]; - SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) { nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin; } - } - - } - - /*--- Write the header ---*/ - Tecplot_File << "ZONE "; - if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - Tecplot_File << "STRANDID="<GetUnsteady_Simulation() == HARMONIC_BALANCE) { - /*--- Compute period of oscillation & compute time interval using nTimeInstances ---*/ - su2double period = config->GetHarmonicBalance_Period(); - su2double deltaT = period/(su2double)(config->GetnTimeInstances()); - Tecplot_File << "STRANDID="<GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - Tecplot_File << scientific << Coords[iDim][iPoint] << "\t"; - } - - /*--- Loop over the vars/residuals and write the values to file ---*/ - for (iVar = 0; iVar < nVar_Total; iVar++) - Tecplot_File << scientific << Data[iVar][iPoint] << "\t"; - - Tecplot_File << endl; - - } - - } else { - - /*--- Write the node coordinates ---*/ - if ((config->GetKind_SU2() != SU2_SOL) && (config->GetKind_SU2() != SU2_DOT)) { - for (iDim = 0; iDim < nDim; iDim++) - Tecplot_File << scientific << Coords[iDim][iPoint] << "\t"; - } - - /*--- Loop over the vars/residuals and write the values to file ---*/ - for (iVar = 0; iVar < nVar_Total; iVar++) - Tecplot_File << scientific << Data[iVar][iPoint] << "\t"; - - Tecplot_File << endl; - - } - - } - - - /*--- Write connectivity data. ---*/ - if (surf_sol) { - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - Tecplot_File << LocalIndex[Conn_Line[iNode+0]] << "\t"; - Tecplot_File << LocalIndex[Conn_Line[iNode+1]] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+0]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+1]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+2]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+2]] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+0]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+1]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+2]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+3]] << "\n"; - } - - } else { - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Tecplot_File << Conn_Tria[iNode+0] << "\t"; - Tecplot_File << Conn_Tria[iNode+1] << "\t"; - Tecplot_File << Conn_Tria[iNode+2] << "\t"; - Tecplot_File << Conn_Tria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Tecplot_File << Conn_Quad[iNode+0] << "\t"; - Tecplot_File << Conn_Quad[iNode+1] << "\t"; - Tecplot_File << Conn_Quad[iNode+2] << "\t"; - Tecplot_File << Conn_Quad[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - Tecplot_File << Conn_Tetr[iNode+0] << "\t" << Conn_Tetr[iNode+1] << "\t"; - Tecplot_File << Conn_Tetr[iNode+2] << "\t" << Conn_Tetr[iNode+2] << "\t"; - Tecplot_File << Conn_Tetr[iNode+3] << "\t" << Conn_Tetr[iNode+3] << "\t"; - Tecplot_File << Conn_Tetr[iNode+3] << "\t" << Conn_Tetr[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - Tecplot_File << Conn_Hexa[iNode+0] << "\t" << Conn_Hexa[iNode+1] << "\t"; - Tecplot_File << Conn_Hexa[iNode+2] << "\t" << Conn_Hexa[iNode+3] << "\t"; - Tecplot_File << Conn_Hexa[iNode+4] << "\t" << Conn_Hexa[iNode+5] << "\t"; - Tecplot_File << Conn_Hexa[iNode+6] << "\t" << Conn_Hexa[iNode+7] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - Tecplot_File << Conn_Pris[iNode+0] << "\t" << Conn_Pris[iNode+1] << "\t"; - Tecplot_File << Conn_Pris[iNode+1] << "\t" << Conn_Pris[iNode+2] << "\t"; - Tecplot_File << Conn_Pris[iNode+3] << "\t" << Conn_Pris[iNode+4] << "\t"; - Tecplot_File << Conn_Pris[iNode+4] << "\t" << Conn_Pris[iNode+5] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - Tecplot_File << Conn_Pyra[iNode+0] << "\t" << Conn_Pyra[iNode+1] << "\t"; - Tecplot_File << Conn_Pyra[iNode+2] << "\t" << Conn_Pyra[iNode+3] << "\t"; - Tecplot_File << Conn_Pyra[iNode+4] << "\t" << Conn_Pyra[iNode+4] << "\t"; - Tecplot_File << Conn_Pyra[iNode+4] << "\t" << Conn_Pyra[iNode+4] << "\n"; - } - } - - Tecplot_File.close(); - - if (surf_sol) { - delete [] LocalIndex; - delete[] SurfacePoint; - } - -} - -void COutput::SetTecplotASCII_Mesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone, bool surf_sol, bool new_file) { - - unsigned short iDim, nDim = geometry->GetnDim(); - unsigned long iPoint, iElem, iNode; - unsigned long *LocalIndex = NULL; - bool *SurfacePoint = NULL; - char cstr[200]; - ofstream Tecplot_File; - - if (surf_sol) strcpy(cstr, "surface_grid"); - else strcpy(cstr, "volumetric_grid"); - - if (config->GetnZone() > 1){ - char appstr[200]; - SPRINTF(appstr, "_%u", val_iZone); - strcat(cstr, appstr); - } - - strcat(cstr,".dat"); - - /*--- Open Tecplot ASCII file and write the header. ---*/ - - if (new_file) { - Tecplot_File.open(cstr, ios::out); - Tecplot_File.precision(6); - if (surf_sol) Tecplot_File << "TITLE = \"Visualization of the surface solution\"" << endl; - else Tecplot_File << "TITLE = \"Visualization of the volumetric solution\"" << endl; - - if (nDim == 2) Tecplot_File << "VARIABLES = \"x\",\"y\""; - else Tecplot_File << "VARIABLES = \"x\",\"y\",\"z\""; - } - else Tecplot_File.open(cstr, ios::out | ios::app); - Tecplot_File << endl; - - /*--- If it's a surface output, print only the points - that are in the element list, change the numbering ---*/ - - if (surf_sol) { - - LocalIndex = new unsigned long [nGlobal_Poin+1]; - SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) { nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin; } - } - - } - - /*--- Write the header ---*/ - - Tecplot_File << "ZONE T= "; - if (new_file) Tecplot_File << "\"Original grid\", C=BLACK, "; - else Tecplot_File << "\"Deformed grid\", C=RED, "; - - if (nDim == 2) { - if (surf_sol) Tecplot_File << "NODES= "<< nSurf_Poin <<", ELEMENTS= "<< nSurf_Elem <<", DATAPACKING=POINT, ZONETYPE=FELINESEG"<< endl; - else Tecplot_File << "NODES= "<< nGlobal_Poin <<", ELEMENTS= "<< nGlobal_Elem <<", DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL"<< endl; - } else { - if (surf_sol) Tecplot_File << "NODES= "<< nSurf_Poin<<", ELEMENTS= "<< nSurf_Elem <<", DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL"<< endl; - else Tecplot_File << "NODES= "<< nGlobal_Poin <<", ELEMENTS= "<< nGlobal_Elem <<", DATAPACKING=POINT, ZONETYPE=FEBRICK"<< endl; - } - - /*--- Write surface and volumetric solution data. ---*/ - - for (iPoint = 0; iPoint < nGlobal_Poin; iPoint++) { - - if (surf_sol) { - - if (LocalIndex[iPoint+1] != 0) { - - /*--- Write the node coordinates ---*/ - for (iDim = 0; iDim < nDim; iDim++) - Tecplot_File << scientific << Coords[iDim][iPoint] << "\t"; - - Tecplot_File << endl; - - } - - } else { - - /*--- Write the node coordinates ---*/ - - for (iDim = 0; iDim < nDim; iDim++) - Tecplot_File << scientific << Coords[iDim][iPoint] << "\t"; - - - Tecplot_File << endl; - - } - - } - - - /*--- Write connectivity data. ---*/ - - if (surf_sol) { - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - Tecplot_File << LocalIndex[Conn_Line[iNode+0]] << "\t"; - Tecplot_File << LocalIndex[Conn_Line[iNode+1]] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+0]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+1]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+2]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundTria[iNode+2]] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+0]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+1]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+2]] << "\t"; - Tecplot_File << LocalIndex[Conn_BoundQuad[iNode+3]] << "\n"; - } - - } else { - - for (iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Tecplot_File << Conn_Tria[iNode+0] << "\t"; - Tecplot_File << Conn_Tria[iNode+1] << "\t"; - Tecplot_File << Conn_Tria[iNode+2] << "\t"; - Tecplot_File << Conn_Tria[iNode+2] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Tecplot_File << Conn_Quad[iNode+0] << "\t"; - Tecplot_File << Conn_Quad[iNode+1] << "\t"; - Tecplot_File << Conn_Quad[iNode+2] << "\t"; - Tecplot_File << Conn_Quad[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - Tecplot_File << Conn_Tetr[iNode+0] << "\t" << Conn_Tetr[iNode+1] << "\t"; - Tecplot_File << Conn_Tetr[iNode+2] << "\t" << Conn_Tetr[iNode+2] << "\t"; - Tecplot_File << Conn_Tetr[iNode+3] << "\t" << Conn_Tetr[iNode+3] << "\t"; - Tecplot_File << Conn_Tetr[iNode+3] << "\t" << Conn_Tetr[iNode+3] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - Tecplot_File << Conn_Hexa[iNode+0] << "\t" << Conn_Hexa[iNode+1] << "\t"; - Tecplot_File << Conn_Hexa[iNode+2] << "\t" << Conn_Hexa[iNode+3] << "\t"; - Tecplot_File << Conn_Hexa[iNode+4] << "\t" << Conn_Hexa[iNode+5] << "\t"; - Tecplot_File << Conn_Hexa[iNode+6] << "\t" << Conn_Hexa[iNode+7] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - Tecplot_File << Conn_Pris[iNode+0] << "\t" << Conn_Pris[iNode+1] << "\t"; - Tecplot_File << Conn_Pris[iNode+1] << "\t" << Conn_Pris[iNode+2] << "\t"; - Tecplot_File << Conn_Pris[iNode+3] << "\t" << Conn_Pris[iNode+4] << "\t"; - Tecplot_File << Conn_Pris[iNode+4] << "\t" << Conn_Pris[iNode+5] << "\n"; - } - - for (iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - Tecplot_File << Conn_Pyra[iNode+0] << "\t" << Conn_Pyra[iNode+1] << "\t"; - Tecplot_File << Conn_Pyra[iNode+2] << "\t" << Conn_Pyra[iNode+3] << "\t"; - Tecplot_File << Conn_Pyra[iNode+4] << "\t" << Conn_Pyra[iNode+4] << "\t"; - Tecplot_File << Conn_Pyra[iNode+4] << "\t" << Conn_Pyra[iNode+4] << "\n"; - } - } - - Tecplot_File.close(); - - if (surf_sol) { - delete [] LocalIndex; - delete [] SurfacePoint; - } - -} - -void COutput::SetSTL_MeshASCII(CConfig *config, CGeometry *geometry) { - - unsigned short iDim, nDim = geometry->GetnDim(); - unsigned long iElem, iNode; - char cstr[200]; - ofstream STL_File; - su2double p[3] = {0.0,0.0,0.0}, u[3] = {0.0,0.0,0.0}, v[3] = {0.0,0.0,0.0}, n[3] = {0.0,0.0,0.0}, a; - unsigned long Point_0, Point_1, Point_2; - - /*--- STL format: - solid NAME - ... - facet normal 0.00 0.00 1.00 - outer loop - vertex 2.00 2.00 0.00 - vertex -1.00 1.00 0.00 - vertex 0.00 -1.00 0.00 - endloop - endfacet - ... - end solid - ---*/ - - if (nDim == 3) { - - strcpy(cstr, "surface_grid.stl"); - - /*--- Open STL ASCII file and write the header. ---*/ - - STL_File.open(cstr, ios::out); - STL_File.precision(6); - STL_File << "solid surface_mesh" << endl; - - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - - iNode = iElem*N_POINTS_TRIANGLE; - - /*--- Compute Normal vectors ---*/ - - Point_0 = Conn_BoundTria[iNode+0]-1; - Point_1 = Conn_BoundTria[iNode+1]-1; - Point_2 = Conn_BoundTria[iNode+2]-1; - - for (iDim = 0; iDim < nDim; iDim++) { - p[0] = Coords[iDim][Point_0]; - p[1] = Coords[iDim][Point_1]; - p[2] = Coords[iDim][Point_2]; - u[iDim] = p[1]-p[0]; - v[iDim] = p[2]-p[0]; - } - - n[0] = u[1]*v[2]-u[2]*v[1]; - n[1] = u[2]*v[0]-u[0]*v[2]; - n[2] = u[0]*v[1]-u[1]*v[0]; - a = sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]); - - /*--- Print normal vector ---*/ - - STL_File << " facet normal "; - for (iDim = 0; iDim < nDim; iDim++) { - STL_File << n[iDim]/a << " "; - } - STL_File << endl; - - /*--- Print nodes for facet ---*/ - STL_File << " outer loop" << endl; - - STL_File << " vertex "; - for (iDim = 0; iDim < nDim; iDim++) STL_File << Coords[iDim][Point_0] << " "; - STL_File << endl; - - STL_File << " vertex "; - for (iDim = 0; iDim < nDim; iDim++) STL_File << Coords[iDim][Point_1] << " "; - STL_File << endl; - - STL_File << " vertex "; - for (iDim = 0; iDim < nDim; iDim++) STL_File << Coords[iDim][Point_2] << " "; - STL_File << endl; - - STL_File << " endloop" << endl; - STL_File << " endfacet" << endl; - - } - - // for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - // iNode = iElem*N_POINTS_QUADRILATERAL; - // STL_File << LocalIndex[Conn_BoundQuad[iNode+0]] << "\t"; - // STL_File << LocalIndex[Conn_BoundQuad[iNode+1]] << "\t"; - // STL_File << LocalIndex[Conn_BoundQuad[iNode+2]] << "\t"; - // STL_File << LocalIndex[Conn_BoundQuad[iNode+3]] << "\n"; - // } - - /*--- Done with Surface Mesh ---*/ - - STL_File << "endsolid" << endl; - - STL_File.close(); - - - } - -} - -void COutput::SetCSV_MeshASCII(CConfig *config, CGeometry *geometry) { - - short iStation, nStation; - unsigned short nDim = geometry->GetnDim(); - unsigned long iVertex; - su2double *Plane_P0, *Plane_Normal; - vector Xcoord_Airfoil, Ycoord_Airfoil, Zcoord_Airfoil, Variable_Airfoil; - ofstream csv_File; - - if (nDim == 3) { - - Plane_P0 = new su2double[3]; - Plane_Normal = new su2double[3]; - - if (geometry->GetnDim() == 3) { - - nStation = config->GetnLocationStations(); - - for (iStation = 0; iStation < nStation; iStation++) { - - /*--- Read the values from the config file ---*/ - - Plane_Normal[0] = 0.0; Plane_P0[0] = 0.0; - Plane_Normal[1] = 0.0; Plane_P0[1] = 0.0; - Plane_Normal[2] = 0.0; Plane_P0[2] = 0.0; - - if (config->GetGeo_Description() == FUSELAGE) { - Plane_Normal[0] = 1.0; - Plane_P0[0] = config->GetLocationStations(iStation); - } - - if (config->GetGeo_Description() == NACELLE) { - Plane_Normal[0] = 0.0; - Plane_Normal[1] = -sin(config->GetLocationStations(iStation)*PI_NUMBER/180.0); - Plane_Normal[2] = cos(config->GetLocationStations(iStation)*PI_NUMBER/180.0); - } - - if (config->GetGeo_Description() == WING) { - Plane_Normal[1] = 1.0; - Plane_P0[1] = config->GetLocationStations(iStation); - } - - /*--- Compute the airfoil Stations (note that we feed in the Cp) ---*/ - - geometry->ComputeAirfoil_Section(Plane_P0, Plane_Normal, -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, - NULL, Xcoord_Airfoil, Ycoord_Airfoil, Zcoord_Airfoil, - Variable_Airfoil, true, config); - - if ((rank == MASTER_NODE) && (Xcoord_Airfoil.size() == 0)) { - cout << "Please check the config file, the station (" << Plane_P0[0] << ", " << Plane_P0[1] << ", " << Plane_P0[2] << ") has not been detected." << endl; - } - - /*--- Write Cp at each Station (csv format) ---*/ - - if ((rank == MASTER_NODE) && (Xcoord_Airfoil.size() != 0)) { - - if (iStation == 0) csv_File.open("surface_grid.csv", ios::out); - else csv_File.open("surface_grid.csv", ios::app); - - /*--- Coordinates value ---*/ - - for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { - csv_File << Xcoord_Airfoil[iVertex] << " ," << Ycoord_Airfoil[iVertex] << " ," << Zcoord_Airfoil[iVertex]; - if (iVertex == 0) { if (iStation == 0) csv_File << ", 2"; else csv_File << ", 1"; } - else csv_File << ", 0"; - csv_File << endl; - } - - csv_File.close(); - - } - - } - - } - - /*--- Delete dynamically allocated memory ---*/ - - delete[] Plane_P0; - delete[] Plane_Normal; - - } - -} - -namespace -{ - - std::string GetTecplotFilename(CConfig *config, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol, const char *extension) { - - const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - const unsigned short Kind_Solver = config->GetKind_Solver(); - string filename; - - if (config->GetKind_SU2() == SU2_DOT) { - if (surf_sol) filename = config->GetSurfSens_FileName(); - else filename = config->GetVolSens_FileName(); - } - else if (Kind_Solver == FEM_ELASTICITY) { - if (surf_sol) filename = config->GetSurfStructure_FileName().c_str(); - else filename = config->GetStructure_FileName().c_str(); - } - else if (surf_sol) { - if (adjoint) filename = config->GetSurfAdjCoeff_FileName(); - else filename = config->GetSurfFlowCoeff_FileName(); - } - else { - if (adjoint) - filename = config->GetAdj_FileName(); - else filename = config->GetFlow_FileName(); - } - - ostringstream string_stream; - string_stream << filename; - - /*--- Special cases where a number needs to be appended to the file name. ---*/ - if ((Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || Kind_Solver == RANS || - Kind_Solver == INC_EULER || Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS || - Kind_Solver == ADJ_EULER || Kind_Solver == ADJ_NAVIER_STOKES || Kind_Solver == ADJ_RANS || - Kind_Solver == DISC_ADJ_EULER || Kind_Solver == DISC_ADJ_NAVIER_STOKES || Kind_Solver == DISC_ADJ_RANS || - Kind_Solver == DISC_ADJ_INC_EULER || Kind_Solver == DISC_ADJ_INC_NAVIER_STOKES || Kind_Solver == DISC_ADJ_INC_RANS || - Kind_Solver == HEAT_EQUATION_FVM) && - (val_nZone > 1) ) { - string_stream << '_' << val_iZone; - } - - const unsigned long iExtIter = config->GetExtIter(); - if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady() && config->GetUnsteady_Simulation() != HARMONIC_BALANCE) { - string_stream << '_' << setfill('0') << setw(5) << iExtIter; - } - - string_stream << extension; - return string_stream.str(); - } - -} /* namespace */ - -void COutput::WriteTecplotASCII_Parallel(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_iInst, unsigned short val_nInst, bool surf_sol) { - - unsigned short iVar, nDim = geometry->GetnDim(); - - unsigned long iPoint, iElem, iNode; - unsigned long iExtIter = config->GetExtIter(); - - int iProcessor; - - string filename = GetTecplotFilename(config, val_iZone, val_nZone, surf_sol, ".dat"); - ofstream Tecplot_File; - - /*--- Open Tecplot ASCII file and write the header. ---*/ - - if (rank == MASTER_NODE) { - Tecplot_File.open(filename.c_str(), ios::out); - Tecplot_File.precision(6); - if (surf_sol) Tecplot_File << "TITLE = \"Visualization of the surface solution\"" << endl; - else Tecplot_File << "TITLE = \"Visualization of the volumetric solution\"" << endl; - - Tecplot_File << "VARIABLES = "; - for (iVar = 0; iVar < Variable_Names.size()-1; iVar++) { - Tecplot_File << "\"" << Variable_Names[iVar] << "\","; - } - Tecplot_File << "\"" << Variable_Names[Variable_Names.size()-1] << "\"" << endl; - - /*--- Write the header ---*/ - - Tecplot_File << "ZONE "; - if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - Tecplot_File << "STRANDID="<GetUnsteady_Simulation() == HARMONIC_BALANCE) { - /*--- Compute period of oscillation & compute time interval using nTimeInstances ---*/ - su2double period = config->GetHarmonicBalance_Period(); - su2double deltaT = period/(su2double)(config->GetnTimeInstances()); - Tecplot_File << "STRANDID="< 0) { - ++m_node_range[ii]; - --num_extra_nodes; - } - } - assert(m_node_range[num_ranks] == global_num_nodes); - } - - /*! - * \brief Determine the MPI rank that owns a global node number and its corresponding local node number. - * \param global_node_number[in] - The global node number; global node numbers are sequential across all MPI ranks. - * \param owning_rank[out] - The MPI rank that owns (will output) the global node - * \param node_number[out] - The rank-local node number for the given global node number - */ - void GetOwningRankAndNodeNumber(unsigned long global_node_number, int &owning_rank, unsigned long &node_number) - { - owning_rank = static_cast(global_node_number / m_node_range[1]); - if (owning_rank >= m_num_ranks) - owning_rank = m_num_ranks - 1; - while(global_node_number > m_node_range[owning_rank + 1]) - ++owning_rank; - while(global_node_number <= m_node_range[owning_rank]) - --owning_rank; - node_number = global_node_number - m_node_range[owning_rank]; - } - - /*! - * \brief Determine the number of nodes to be output by a particular rank - * \param which_rank[in] - The MPI rank - * \ret - The number of nodes that will be output by the give MPI rank. - */ - int64_t GetRankNumNodes(int which_rank) - { - return static_cast(m_node_range[which_rank + 1] - m_node_range[which_rank]); - } - -private: - int m_num_ranks; - vector m_node_range; -}; - -int64_t GetHaloNodeNumber(unsigned long global_node_number, unsigned long last_local_node, vector const &halo_node_list) -{ - vector::const_iterator it = lower_bound(halo_node_list.begin(), halo_node_list.end(), global_node_number); - assert(it != halo_node_list.end()); - assert(*it == global_node_number); - /* When C++11 is universally available, replace the following mouthful with "auto" */ - iterator_traits::const_iterator>::difference_type offset = distance(halo_node_list.begin(), it); - assert(offset >= 0); - return (int64_t)(last_local_node + offset + 1); -} - -} /* namespace */ - -#endif /* HAVE_MPI */ - -void COutput::WriteTecplotBinary_Parallel(CConfig *config, CGeometry *geometry, unsigned short val_iZone, unsigned short val_nZone, bool surf_sol) { - -#ifdef HAVE_TECIO - - /*--- Open Tecplot binary file. ---*/ - - string filename = GetTecplotFilename(config, val_iZone, val_nZone, surf_sol, ".szplt"); - - string data_set_title = surf_sol - ? "Visualization of the surface solution" - : "Visualization of the volumetric solution"; - - ostringstream tecplot_variable_names; - for (size_t iVar = 0; iVar < Variable_Names.size()-1; ++iVar) { - tecplot_variable_names << Variable_Names[iVar] << ","; - } - tecplot_variable_names << Variable_Names[Variable_Names.size()-1]; - - void* file_handle = NULL; - int32_t err = tecFileWriterOpen(filename.c_str(), data_set_title.c_str(), tecplot_variable_names.str().c_str(), - FILEFORMAT_SZL, FILETYPE_FULL, (int32_t)FieldDataType_Double, NULL, &file_handle); - if (err) cout << "Error opening Tecplot file '" << filename << "'" << endl; - -#ifdef HAVE_MPI - err = tecMPIInitialize(file_handle, MPI_COMM_WORLD, MASTER_NODE); - if (err) cout << "Error initializing Tecplot parallel output." << endl; -#endif - - /*--- Define the zone(s). For 2D, and for 3D surfaces, each rank outputs a separate zone. ---*/ - - int64_t num_nodes; - int64_t num_cells; - int32_t zone_type; - if (surf_sol) { - num_nodes = static_cast(nGlobal_Surf_Poin); - num_cells = static_cast(nSurf_Elem_Par); - if (geometry->GetnDim() == 2) - zone_type = ZONETYPE_FELINESEG; - else - zone_type = ZONETYPE_FEQUADRILATERAL; - } else { - num_nodes = static_cast(nGlobal_Poin_Par); - num_cells = static_cast(nGlobal_Elem_Par); - if (geometry->GetnDim() == 2) - zone_type = ZONETYPE_FEQUADRILATERAL; - else - zone_type = ZONETYPE_FEBRICK; - } - - bool is_unsteady = false; - passivedouble solution_time = 0.0; - if (config->GetUnsteady_Simulation() && config->GetWrt_Unsteady()) { - is_unsteady = true; - solution_time = SU2_TYPE::GetValue(config->GetDelta_UnstTime()*config->GetExtIter()); - } else if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { - is_unsteady = true; - /*--- Compute period of oscillation & compute time interval using nTimeInstances ---*/ - passivedouble period = SU2_TYPE::GetValue(config->GetHarmonicBalance_Period()); - passivedouble deltaT = period/SU2_TYPE::GetValue(config->GetnTimeInstances()); - solution_time = deltaT*val_iZone; - } - - int32_t zone; - vector value_locations(nVar_Par, 1); /* Nodal variables. */ - err = tecZoneCreateFE(file_handle, "Zone", zone_type, num_nodes, num_cells, NULL, NULL, &value_locations[0], NULL, 0, 0, 0, &zone); - if (err) cout << rank << ": Error creating Tecplot zone." << endl; - if (is_unsteady) { - err = tecZoneSetUnsteadyOptions(file_handle, zone, solution_time, config->GetExtIter() + 1); - if (err) cout << rank << ": Error setting Tecplot zone unsteady options." << std::endl; - } - -#ifdef HAVE_MPI - - unsigned short iVar; - NodePartitioner node_partitioner(num_nodes, size); - set halo_nodes; - vector sorted_halo_nodes; - vector halo_var_data; - vector num_nodes_to_receive(size, 0); - vector values_to_receive_displacements(size); - - if (zone_type == ZONETYPE_FEBRICK) { - - /* We output a single, partitioned zone where each rank outputs one partition. */ - vector partition_owners; - partition_owners.reserve(size); - for (int32_t iRank = 0; iRank < size; ++iRank) - partition_owners.push_back(iRank); - err = tecZoneMapPartitionsToMPIRanks(file_handle, zone, size, &partition_owners[0]); - if (err) cout << rank << ": Error assigning MPI ranks for Tecplot zone partitions." << endl; - - /* Gather a list of nodes we refer to but are not outputting. */ - - for (unsigned long i = 0; i < nParallel_Tria * N_POINTS_TRIANGLE; ++i) - if ((unsigned long)Conn_Tria_Par[i] <= beg_node[rank] || end_node[rank] < (unsigned long)Conn_Tria_Par[i]) - halo_nodes.insert(Conn_Tria_Par[i]); - - for (unsigned long i = 0; i < nParallel_Quad * N_POINTS_QUADRILATERAL; ++i) - if ((unsigned long)Conn_Quad_Par[i] <= beg_node[rank] || end_node[rank] < (unsigned long)Conn_Quad_Par[i]) - halo_nodes.insert(Conn_Quad_Par[i]); - - for (unsigned long i = 0; i < nParallel_Tetr * N_POINTS_TETRAHEDRON; ++i) - if ((unsigned long)Conn_Tetr_Par[i] <= beg_node[rank] || end_node[rank] < (unsigned long)Conn_Tetr_Par[i]) - halo_nodes.insert(Conn_Tetr_Par[i]); - - for (unsigned long i = 0; i < nParallel_Hexa * N_POINTS_HEXAHEDRON; ++i) - if ((unsigned long)Conn_Hexa_Par[i] <= beg_node[rank] || end_node[rank] < (unsigned long)Conn_Hexa_Par[i]) - halo_nodes.insert(Conn_Hexa_Par[i]); - - for (unsigned long i = 0; i < nParallel_Pris * N_POINTS_PRISM; ++i) - if ((unsigned long)Conn_Pris_Par[i] <= beg_node[rank] || end_node[rank] < (unsigned long)Conn_Pris_Par[i]) - halo_nodes.insert(Conn_Pris_Par[i]); - - for (unsigned long i = 0; i < nParallel_Pyra * N_POINTS_PYRAMID; ++i) - if ((unsigned long)Conn_Pyra_Par[i] <= beg_node[rank] || end_node[rank] < (unsigned long)Conn_Pyra_Par[i]) - halo_nodes.insert(Conn_Pyra_Par[i]); - - /* Sorted list of halo nodes for this MPI rank. */ - sorted_halo_nodes.assign(halo_nodes.begin(), halo_nodes.end()); - - /* Have to include all nodes our cells refer to or TecIO will barf, so add the halo node count to the number of local nodes. */ - int64_t partition_num_nodes = end_node[rank] - beg_node[rank] + static_cast(halo_nodes.size()); - int64_t partition_num_cells = nParallel_Tetr + nParallel_Hexa + nParallel_Pris + nParallel_Pyra; - - /*--- We effectively tack the halo nodes onto the end of the node list for this partition. - TecIO will later replace them with references to nodes in neighboring partitions. */ - size_t num_halo_nodes = sorted_halo_nodes.size(); - vector halo_node_local_numbers(max((size_t)1, num_halo_nodes)); /* Min size 1 to avoid crashes when we access these vectors below. */ - vector neighbor_partitions(max((size_t)1, num_halo_nodes)); - vector neighbor_nodes(max((size_t)1, num_halo_nodes)); - for(int64_t i = 0; i < static_cast(num_halo_nodes); ++i) { - halo_node_local_numbers[i] = end_node[rank] - beg_node[rank] + i + 1; - int owning_rank; - unsigned long node_number; - node_partitioner.GetOwningRankAndNodeNumber(sorted_halo_nodes[i], owning_rank, node_number); - neighbor_partitions[i] = owning_rank + 1; /* Partition numbers are 1-based. */ - neighbor_nodes[i] = static_cast(node_number); - } - err = tecFEPartitionCreate64(file_handle, zone, rank + 1, partition_num_nodes, partition_num_cells, - static_cast(num_halo_nodes), &halo_node_local_numbers[0], &neighbor_partitions[0], &neighbor_nodes[0], 0, NULL); - if (err) cout << rank << ": Error creating Tecplot zone partition." << endl; - - /* Gather halo node data. First, tell each rank how many nodes' worth of data we need from them. */ - for (size_t i = 0; i < num_halo_nodes; ++i) - ++num_nodes_to_receive[neighbor_partitions[i] - 1]; - vector num_nodes_to_send(size); - SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, MPI_COMM_WORLD); - - /* Now send the global node numbers whose data we need, - and receive the same from all other ranks. - Each rank has globally consecutive node numbers, - so we can just parcel out sorted_halo_nodes for send. */ - vector nodes_to_send_displacements(size); - vector nodes_to_receive_displacements(size); - nodes_to_send_displacements[0] = 0; - nodes_to_receive_displacements[0] = 0; - for(int iRank = 1; iRank < size; ++iRank) { - nodes_to_send_displacements[iRank] = nodes_to_send_displacements[iRank - 1] + num_nodes_to_send[iRank - 1]; - nodes_to_receive_displacements[iRank] = nodes_to_receive_displacements[iRank - 1] + num_nodes_to_receive[iRank - 1]; - } - int total_num_nodes_to_send = nodes_to_send_displacements[size - 1] + num_nodes_to_send[size - 1]; - vector nodes_to_send(max(1, total_num_nodes_to_send)); - - /* The terminology gets a bit confusing here. We're sending the node numbers - (sorted_halo_nodes) whose data we need to receive, and receiving - lists of nodes whose data we need to send. */ - if (sorted_halo_nodes.empty()) sorted_halo_nodes.resize(1); /* Avoid crash. */ - SU2_MPI::Alltoallv(&sorted_halo_nodes[0], &num_nodes_to_receive[0], &nodes_to_receive_displacements[0], MPI_UNSIGNED_LONG, - &nodes_to_send[0], &num_nodes_to_send[0], &nodes_to_send_displacements[0], MPI_UNSIGNED_LONG, - MPI_COMM_WORLD); - - /* Now actually send and receive the data */ - vector data_to_send(max(1, total_num_nodes_to_send * nVar_Par)); - halo_var_data.resize(max((size_t)1, nVar_Par * num_halo_nodes)); - vector num_values_to_send(size); - vector values_to_send_displacements(size); - vector num_values_to_receive(size); - size_t index = 0; - for(int iRank = 0; iRank < size; ++iRank) { - /* We send and receive nVar_Par values per node. */ - num_values_to_send[iRank] = num_nodes_to_send[iRank] * nVar_Par; - values_to_send_displacements[iRank] = nodes_to_send_displacements[iRank] * nVar_Par; - num_values_to_receive[iRank] = num_nodes_to_receive[iRank] * nVar_Par; - values_to_receive_displacements[iRank] = nodes_to_receive_displacements[iRank] * nVar_Par; - for(iVar = 0; iVar < nVar_Par; ++iVar) - for(int iNode = 0; iNode < num_nodes_to_send[iRank]; ++iNode) { - unsigned long node_offset = nodes_to_send[nodes_to_send_displacements[iRank] + iNode] - beg_node[rank] - 1; - data_to_send[index++] = SU2_TYPE::GetValue(Parallel_Data[iVar][node_offset]); - } - } - SU2_MPI::Alltoallv(&data_to_send[0], &num_values_to_send[0], &values_to_send_displacements[0], MPI_DOUBLE, - &halo_var_data[0], &num_values_to_receive[0], &values_to_receive_displacements[0], MPI_DOUBLE, - MPI_COMM_WORLD); - } - else { - /* Zone will be gathered to and output by MASTER_NODE */ - int32_t partition_owner = MASTER_NODE; - err = tecZoneMapPartitionsToMPIRanks(file_handle, zone, 1, &partition_owner); - } - - /*--- Write surface and volumetric solution data. ---*/ - - if (zone_type == ZONETYPE_FEBRICK) { - std::vector values_to_write(nParallel_Poin); - for (iVar = 0; err == 0 && iVar < nVar_Par; iVar++) { - for(unsigned long i = 0; i < nParallel_Poin; ++i) - values_to_write[i] = SU2_TYPE::GetValue(Parallel_Data[iVar][i]); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, rank + 1, nParallel_Poin, &values_to_write[0]); - if (err) cout << rank << ": Error outputting Tecplot variable values." << endl; - for (int iRank = 0; err == 0 && iRank < size; ++iRank) { - if (num_nodes_to_receive[iRank] > 0) { - int var_data_offset = values_to_receive_displacements[iRank] + num_nodes_to_receive[iRank] * iVar; - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, rank + 1, static_cast(num_nodes_to_receive[iRank]), &halo_var_data[var_data_offset]); - if (err) cout << rank << ": Error outputting Tecplot halo values." << endl; - } - } - } - } else { - if (rank == MASTER_NODE) { - vector var_data; - vector num_surface_points(size); - if (surf_sol) - SU2_MPI::Gather(&nSurf_Poin_Par, 1, MPI_UNSIGNED_LONG, &num_surface_points[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - for(int iRank = 0; iRank < size; ++iRank) { - int64_t rank_num_points; - if (surf_sol) - rank_num_points = num_surface_points[iRank]; - else - rank_num_points = node_partitioner.GetRankNumNodes(iRank); - if (rank_num_points > 0) { - if (iRank == rank) { /* Output local data. */ - std::vector values_to_write; - for (iVar = 0; err == 0 && iVar < nVar_Par; iVar++) { - if (surf_sol) { - values_to_write.resize(nSurf_Poin_Par); - for(unsigned long i = 0; i < nSurf_Poin_Par; ++i) - values_to_write[i] = SU2_TYPE::GetValue(Parallel_Surf_Data[iVar][i]); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, nSurf_Poin_Par, &values_to_write[0]); - } - else { - values_to_write.resize(rank_num_points); - for(unsigned long i = 0; i < (unsigned long)rank_num_points; ++i) - values_to_write[i] = SU2_TYPE::GetValue(Parallel_Data[iVar][i]); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &values_to_write[0]); - } - if (err) cout << rank << ": Error outputting Tecplot variable values." << endl; - } - } - else { /* Receive data from other rank. */ - var_data.resize(max((int64_t)1, nVar_Par * rank_num_points)); - SU2_MPI::Recv(&var_data[0], nVar_Par * rank_num_points, MPI_DOUBLE, iRank, iRank, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - for (iVar = 0; err == 0 && iVar < nVar_Par; iVar++) { - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &var_data[iVar * rank_num_points]); - if (err) cout << rank << ": Error outputting Tecplot surface variable values." << endl; - } - } - } - } - } - else { /* Send data to MASTER_NODE */ - if (surf_sol) - SU2_MPI::Gather(&nSurf_Poin_Par, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - vector var_data; - size_t var_data_size = nVar_Par * (surf_sol ? nSurf_Poin_Par : nParallel_Poin); - var_data.reserve(var_data_size); - for (iVar = 0; err == 0 && iVar < nVar_Par; iVar++) - if (surf_sol) - for(unsigned long i = 0; i < nSurf_Poin_Par; ++i) - var_data.push_back(SU2_TYPE::GetValue(Parallel_Surf_Data[iVar][i])); - else - for(unsigned long i = 0; i < nParallel_Poin; ++i) - var_data.push_back(SU2_TYPE::GetValue(Parallel_Data[iVar][i])); - if (var_data.size() > 0) - SU2_MPI::Send(&var_data[0], static_cast(var_data.size()), MPI_DOUBLE, MASTER_NODE, rank, MPI_COMM_WORLD); - } - } - -#else - - unsigned short iVar; - - vector var_data; - size_t var_data_size = nVar_Par * (surf_sol ? nSurf_Poin_Par : nParallel_Poin); - var_data.reserve(var_data_size); - - if (surf_sol) { - for (iVar = 0; err == 0 && iVar < nVar_Par; iVar++) { - for(unsigned long i = 0; i < nSurf_Poin_Par; ++i) - var_data.push_back(SU2_TYPE::GetValue(Parallel_Surf_Data[iVar][i])); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, nSurf_Poin_Par, &var_data[iVar * nSurf_Poin_Par]); - if (err) cout << rank << ": Error outputting Tecplot variable value." << endl; - } - } else { - for (iVar = 0; err == 0 && iVar < nVar_Par; iVar++) { - for(unsigned long i = 0; i < nParallel_Poin; ++i) - var_data.push_back(SU2_TYPE::GetValue(Parallel_Data[iVar][i])); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, nParallel_Poin, &var_data[iVar * nParallel_Poin]); - if (err) cout << rank << ": Error outputting Tecplot variable value." << endl; - } - } - -#endif /* HAVE_MPI */ - - /*--- Write connectivity data. ---*/ - - unsigned long iElem, iNode; - -#ifdef HAVE_MPI - if (zone_type == ZONETYPE_FEBRICK) { - - int64_t nodes[8]; - - /** - * Each rank writes node numbers relative to the partition it is outputting (starting with node number 1). - * Ghost (halo) nodes identified above are numbered sequentially just beyond the end of the actual, local nodes. - * Note that beg_node and end_node refer to zero-based node numbering, but Conn_* contain one-based node numbers. - */ -#define MAKE_LOCAL(n) beg_node[rank] < (unsigned long)n && (unsigned long)n <= end_node[rank] \ - ? (int64_t)((unsigned long)n - beg_node[rank]) \ - : GetHaloNodeNumber(n, end_node[rank] - beg_node[rank], sorted_halo_nodes) - - for (iElem = 0; err == 0 && iElem < nParallel_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - nodes[0] = MAKE_LOCAL(Conn_Tetr_Par[iNode+0]); - nodes[1] = MAKE_LOCAL(Conn_Tetr_Par[iNode+1]); - nodes[2] = MAKE_LOCAL(Conn_Tetr_Par[iNode+2]); - nodes[3] = nodes[2]; - nodes[4] = MAKE_LOCAL(Conn_Tetr_Par[iNode+3]); - nodes[5] = nodes[4]; - nodes[6] = nodes[4]; - nodes[7] = nodes[4]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - nodes[0] = MAKE_LOCAL(Conn_Hexa_Par[iNode+0]); - nodes[1] = MAKE_LOCAL(Conn_Hexa_Par[iNode+1]); - nodes[2] = MAKE_LOCAL(Conn_Hexa_Par[iNode+2]); - nodes[3] = MAKE_LOCAL(Conn_Hexa_Par[iNode+3]); - nodes[4] = MAKE_LOCAL(Conn_Hexa_Par[iNode+4]); - nodes[5] = MAKE_LOCAL(Conn_Hexa_Par[iNode+5]); - nodes[6] = MAKE_LOCAL(Conn_Hexa_Par[iNode+6]); - nodes[7] = MAKE_LOCAL(Conn_Hexa_Par[iNode+7]); - err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - nodes[0] = MAKE_LOCAL(Conn_Pris_Par[iNode+0]); - nodes[1] = MAKE_LOCAL(Conn_Pris_Par[iNode+1]); - nodes[2] = nodes[1]; - nodes[3] = MAKE_LOCAL(Conn_Pris_Par[iNode+2]); - nodes[4] = MAKE_LOCAL(Conn_Pris_Par[iNode+3]); - nodes[5] = MAKE_LOCAL(Conn_Pris_Par[iNode+4]); - nodes[6] = nodes[5]; - nodes[7] = MAKE_LOCAL(Conn_Pris_Par[iNode+5]); - err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - nodes[0] = MAKE_LOCAL(Conn_Pyra_Par[iNode+0]); - nodes[1] = MAKE_LOCAL(Conn_Pyra_Par[iNode+1]); - nodes[2] = MAKE_LOCAL(Conn_Pyra_Par[iNode+2]); - nodes[3] = MAKE_LOCAL(Conn_Pyra_Par[iNode+3]); - nodes[4] = MAKE_LOCAL(Conn_Pyra_Par[iNode+4]); - nodes[5] = nodes[4]; - nodes[6] = nodes[4]; - nodes[7] = nodes[4]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - } else { - if (rank == MASTER_NODE) { - - /* Non-hexahedral output by the master node. Output local data directly, and gather other data from the other ranks. */ - - int64_t nodes[4]; - - vector connectivity_sizes(size); - unsigned long unused = 0; - SU2_MPI::Gather(&unused, 1, MPI_UNSIGNED_LONG, &connectivity_sizes[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - vector connectivity; - for(int iRank = 0; iRank < size; ++iRank) { - if (iRank == rank) { - if (surf_sol) { - for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - nodes[0] = Conn_BoundLine_Par[iNode+0]; - nodes[1] = Conn_BoundLine_Par[iNode+1]; - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 2, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - nodes[0] = Conn_BoundTria_Par[iNode+0]; - nodes[1] = Conn_BoundTria_Par[iNode+1]; - nodes[2] = Conn_BoundTria_Par[iNode+2]; - nodes[3] = Conn_BoundTria_Par[iNode+2]; - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - nodes[0] = Conn_BoundQuad_Par[iNode+0]; - nodes[1] = Conn_BoundQuad_Par[iNode+1]; - nodes[2] = Conn_BoundQuad_Par[iNode+2]; - nodes[3] = Conn_BoundQuad_Par[iNode+3]; - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - } else { - for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - nodes[0] = Conn_Tria_Par[iNode+0]; - nodes[1] = Conn_Tria_Par[iNode+1]; - nodes[2] = Conn_Tria_Par[iNode+2]; - nodes[3] = Conn_Tria_Par[iNode+2]; - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - nodes[0] = Conn_Quad_Par[iNode+0]; - nodes[1] = Conn_Quad_Par[iNode+1]; - nodes[2] = Conn_Quad_Par[iNode+2]; - nodes[3] = Conn_Quad_Par[iNode+3]; - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - } - } else { /* Receive node map and write out. */ - connectivity.resize(max((unsigned long)1, connectivity_sizes[iRank])); - SU2_MPI::Recv(&connectivity[0], connectivity_sizes[iRank], MPI_UNSIGNED_LONG, iRank, iRank, MPI_COMM_WORLD, MPI_STATUS_IGNORE); - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, connectivity_sizes[iRank], &connectivity[0]); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - } - } else { - - /* Non-hexahedral output by non-master node. Send what we've got to the master node. */ - - unsigned long connectivity_size; - if (surf_sol) - connectivity_size = 2 * nParallel_Line + 4 * nParallel_BoundTria + 4 * nParallel_BoundQuad; - else - connectivity_size = 4 * (nParallel_Tria + nParallel_Quad); - SU2_MPI::Gather(&connectivity_size, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, MPI_COMM_WORLD); - vector connectivity; - connectivity.reserve(connectivity_size); - if (surf_sol) { - for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - connectivity.push_back(Conn_BoundLine_Par[iNode+0]); - connectivity.push_back(Conn_BoundLine_Par[iNode+1]); - } - - for (iElem = 0; err == 0 && iElem < nParallel_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - connectivity.push_back(Conn_BoundTria_Par[iNode+0]); - connectivity.push_back(Conn_BoundTria_Par[iNode+1]); - connectivity.push_back(Conn_BoundTria_Par[iNode+2]); - connectivity.push_back(Conn_BoundTria_Par[iNode+2]); - } - - for (iElem = 0; err == 0 && iElem < nParallel_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - connectivity.push_back(Conn_BoundQuad_Par[iNode+0]); - connectivity.push_back(Conn_BoundQuad_Par[iNode+1]); - connectivity.push_back(Conn_BoundQuad_Par[iNode+2]); - connectivity.push_back(Conn_BoundQuad_Par[iNode+3]); - } - } else { - for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - connectivity.push_back(Conn_Tria_Par[iNode+0]); - connectivity.push_back(Conn_Tria_Par[iNode+1]); - connectivity.push_back(Conn_Tria_Par[iNode+2]); - connectivity.push_back(Conn_Tria_Par[iNode+2]); - } - - for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - connectivity.push_back(Conn_Quad_Par[iNode+0]); - connectivity.push_back(Conn_Quad_Par[iNode+1]); - connectivity.push_back(Conn_Quad_Par[iNode+2]); - connectivity.push_back(Conn_Quad_Par[iNode+3]); - } - } - if (connectivity.empty()) connectivity.resize(1); /* Avoid crash */ - SU2_MPI::Send(&connectivity[0], connectivity_size, MPI_UNSIGNED_LONG, MASTER_NODE, rank, MPI_COMM_WORLD); - } - } -#else - if (surf_sol) { - - int64_t nodes[4]; - - for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - nodes[0] = Conn_BoundLine_Par[iNode+0]; - nodes[1] = Conn_BoundLine_Par[iNode+1]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 2, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - nodes[0] = Conn_BoundTria_Par[iNode+0]; - nodes[1] = Conn_BoundTria_Par[iNode+1]; - nodes[2] = Conn_BoundTria_Par[iNode+2]; - nodes[3] = Conn_BoundTria_Par[iNode+2]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - nodes[0] = Conn_BoundQuad_Par[iNode+0]; - nodes[1] = Conn_BoundQuad_Par[iNode+1]; - nodes[2] = Conn_BoundQuad_Par[iNode+2]; - nodes[3] = Conn_BoundQuad_Par[iNode+3]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - } else { - - int64_t nodes[8]; - - for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - nodes[0] = Conn_Tria_Par[iNode+0]; - nodes[1] = Conn_Tria_Par[iNode+1]; - nodes[2] = Conn_Tria_Par[iNode+2]; - nodes[3] = Conn_Tria_Par[iNode+2]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - nodes[0] = Conn_Quad_Par[iNode+0]; - nodes[1] = Conn_Quad_Par[iNode+1]; - nodes[2] = Conn_Quad_Par[iNode+2]; - nodes[3] = Conn_Quad_Par[iNode+3]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Tetr; iElem++) { - iNode = iElem*N_POINTS_TETRAHEDRON; - nodes[0] = Conn_Tetr_Par[iNode+0]; - nodes[1] = Conn_Tetr_Par[iNode+1]; - nodes[2] = Conn_Tetr_Par[iNode+2]; - nodes[3] = Conn_Tetr_Par[iNode+2]; - nodes[4] = Conn_Tetr_Par[iNode+3]; - nodes[5] = Conn_Tetr_Par[iNode+3]; - nodes[6] = Conn_Tetr_Par[iNode+3]; - nodes[7] = Conn_Tetr_Par[iNode+3]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Hexa; iElem++) { - iNode = iElem*N_POINTS_HEXAHEDRON; - nodes[0] = Conn_Hexa_Par[iNode+0]; - nodes[1] = Conn_Hexa_Par[iNode+1]; - nodes[2] = Conn_Hexa_Par[iNode+2]; - nodes[3] = Conn_Hexa_Par[iNode+3]; - nodes[4] = Conn_Hexa_Par[iNode+4]; - nodes[5] = Conn_Hexa_Par[iNode+5]; - nodes[6] = Conn_Hexa_Par[iNode+6]; - nodes[7] = Conn_Hexa_Par[iNode+7]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Pris; iElem++) { - iNode = iElem*N_POINTS_PRISM; - nodes[0] = Conn_Pris_Par[iNode+0]; - nodes[1] = Conn_Pris_Par[iNode+1]; - nodes[2] = Conn_Pris_Par[iNode+1]; - nodes[3] = Conn_Pris_Par[iNode+2]; - nodes[4] = Conn_Pris_Par[iNode+3]; - nodes[5] = Conn_Pris_Par[iNode+4]; - nodes[6] = Conn_Pris_Par[iNode+4]; - nodes[7] = Conn_Pris_Par[iNode+5]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - for (iElem = 0; err == 0 && iElem < nParallel_Pyra; iElem++) { - iNode = iElem*N_POINTS_PYRAMID; - nodes[0] = Conn_Pyra_Par[iNode+0]; - nodes[1] = Conn_Pyra_Par[iNode+1]; - nodes[2] = Conn_Pyra_Par[iNode+2]; - nodes[3] = Conn_Pyra_Par[iNode+3]; - nodes[4] = Conn_Pyra_Par[iNode+4]; - nodes[5] = Conn_Pyra_Par[iNode+4]; - nodes[6] = Conn_Pyra_Par[iNode+4]; - nodes[7] = Conn_Pyra_Par[iNode+4]; - err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); - if (err) cout << rank << ": Error outputting Tecplot node values." << endl; - } - - } - -#endif - - err = tecFileWriterClose(&file_handle); - if (err) cout << rank << ": Error finishing Tecplot file output." << endl; - -#endif /* HAVE_TECIO */ - -} - -void COutput::SetTecplotBinary_DomainMesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { - -#ifdef HAVE_TECIO - - passivedouble t; - INTEGER4 i, err, Debug, NPts, NElm, N2DElm, NVolElm, IsDouble, KMax; - INTEGER4 ICellMax, JCellMax, KCellMax, ZoneType, StrandID, ParentZn, FileFormat, FileType; - INTEGER4 *ShareFromZone = NULL, IsBlock, NumFaceConnections, FaceNeighborMode, ShareConnectivityFromZone; - string buffer, variables; - stringstream file; - bool first_zone = true; - bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - unsigned short dims = geometry->GetnDim(); - enum FileFormat { PLT = 0, SZPLT = 1 }; - enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 }; - enum ZoneType { ORDERED=0, FELINESEG=1, FETRIANGLE=2, FEQUADRILATERAL=3, FETETRAHEDRON=4, FEBRICK=5, FEPOLYGON=6, FEPOLYHEDRON=7 }; - - /*--- Consistent data for Tecplot zones ---*/ - - Debug = 0; - IsDouble = 1; - NPts = (INTEGER4)nGlobal_Poin; - t = 0.0;//iExtIter*config->GetDelta_UnstTimeND(); - KMax = 0; - ICellMax = 0; - JCellMax = 0; - KCellMax = 0; - StrandID = 0;//(INTEGER4)iExtIter; - ParentZn = 0; - IsBlock = 1; - NumFaceConnections = 0; - FaceNeighborMode = 0; - ShareConnectivityFromZone = 0; - - /*--- Write Tecplot solution file ---*/ - - if (!wrote_base_file) { - - file.str(string()); - - if (adjoint) - buffer = config->GetAdj_FileName(); - else buffer = config->GetFlow_FileName(); - - if (config->GetKind_SU2() == SU2_DOT) { - buffer = config->GetVolSens_FileName(); - } - - file << buffer << ".mesh.szplt"; - FileFormat = SZPLT; - FileType = GRID; - - if (dims == 2) variables = "x y"; - else if (dims == 3) variables = "x y z"; - else cout << "Error: wrong number of dimensions: " << dims << endl; - - /*--- Open Tecplot file ---*/ - err = TECINI142((char *)config->GetFlow_FileName().c_str(), - (char *)variables.c_str(), - (char *)file.str().c_str(), - (char *)".", - &FileFormat, - &FileType, - &Debug, - &IsDouble); - if (err) cout << "Error in opening Tecplot file" << endl; - - first_zone = true; - - N2DElm = (INTEGER4)(nGlobal_Tria + nGlobal_Quad); - if (N2DElm > 0) { - - /*--- Write the zone header information ---*/ - - if ((INTEGER4)nGlobal_Tria < N2DElm) { /* Create a Quad zone with a mixed element types */ - - - ZoneType = FEQUADRILATERAL; NElm = N2DElm; - - err = TECZNE142((char*)"Mixed Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - - } else { /* Create a Tria zone */ - - ZoneType = FETRIANGLE; NElm = (INTEGER4)nGlobal_Tria; - - err = TECZNE142((char*)"Triangle Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - } - - /*--- write node coordinates and data if not done already---*/ - - if (first_zone) { - - ShareFromZone = new INTEGER4[dims]; - for (i = 0; i < dims; i++) ShareFromZone[i] = 0; - - if (config->GetKind_SU2() == SU2_SOL) { - err = TECDAT142(&NPts, Data[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Data[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Data[2], &IsDouble); - ShareFromZone[2] = 1; - } - - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[0][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[0] = 1; - - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[1][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[1] = 1; - - if (geometry->GetnDim() == 3) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[2][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); - ShareFromZone[2] = 1; - } - - delete [] PassiveData; - - } else { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - ShareFromZone[2] = 1; - } - } - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - first_zone = false; - } - - - if (nGlobal_Tria > 0) { - if ((INTEGER4)nGlobal_Tria < N2DElm) { /* Write Tria connecivity as collapsed Quad */ - - /*--- Convert the triangle connectivity from 3 nodes to 4 nodes for FEQUADRALATERL */ - int *Conn_Tria_Mod = new int[nGlobal_Tria*N_POINTS_QUADRILATERAL]; - unsigned long iNode_Tria, iNode_Quad; - for (unsigned long iElem = 0; iElem < nGlobal_Tria; iElem++) { - iNode_Tria = iElem*N_POINTS_TRIANGLE; - iNode_Quad = iElem*N_POINTS_QUADRILATERAL; - Conn_Tria_Mod[iNode_Quad+0] = Conn_Tria[iNode_Tria+0]; - Conn_Tria_Mod[iNode_Quad+1] = Conn_Tria[iNode_Tria+1]; - Conn_Tria_Mod[iNode_Quad+2] = Conn_Tria[iNode_Tria+2]; - Conn_Tria_Mod[iNode_Quad+3] = Conn_Tria[iNode_Tria+2]; - } - NElm = (INTEGER4)(nGlobal_Tria*N_POINTS_QUADRILATERAL); - err = TECNODE142(&NElm, Conn_Tria_Mod); - if (err) cout << "Error writing triangle connectivity to Tecplot file" << endl; - delete [] Conn_Tria_Mod; - - } else { /* Write Tria connectivity */ - - err = TECNOD142(Conn_Tria); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - } - } - - if (nGlobal_Quad > 0) { - - NElm = (INTEGER4)(nGlobal_Quad*N_POINTS_QUADRILATERAL); - err = TECNODE142(&NElm, Conn_Quad); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - - } - - } - - /*--- Create 3D Volume Zone ---*/ - NVolElm = (INTEGER4)(nGlobal_Tetr + nGlobal_Pyra + nGlobal_Pris + nGlobal_Hexa); - if (NVolElm > 0) { - - /*--- Write the zone header information ---*/ - - if ((INTEGER4)nGlobal_Tetr < NVolElm) { /* Create a Hexa zone with a mixed element types */ - - /*--- Write the mixed-element zone header information ---*/ - - ZoneType = FEBRICK; NElm = NVolElm; - - err = TECZNE142((char*)"Mixed Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - } else { /* Create a Tetra zone */ - - /*--- Write the tetrahedral zone header information ---*/ - - ZoneType = FETETRAHEDRON; NElm = (INTEGER4)nGlobal_Tetr; - - err = TECZNE142((char*)"Tetrahedral Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - } - - /*--- write node coordinates and data if not done already---*/ - - if (first_zone) { - - ShareFromZone = new INTEGER4[dims]; - for (i = 0; i < dims; i++) ShareFromZone[i] = 0; - - if (config->GetKind_SU2() == SU2_SOL) { - err = TECDAT142(&NPts, Data[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Data[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Data[2], &IsDouble); - ShareFromZone[2] = 1; - } - - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[0][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[0] = 1; - - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[1][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[1] = 1; - - if (geometry->GetnDim() == 3) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[2][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); - ShareFromZone[2] = 1; - } - - delete [] PassiveData; - - } else { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - ShareFromZone[2] = 1; - } - } - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - first_zone = false; - } - - } - - if (nGlobal_Tetr > 0) { - if ((INTEGER4)nGlobal_Tetr < NVolElm) { /* Write tetra connecivity as collapsed hexa */ - - /*--- Convert the tetrahedral connectivity from 4 nodes to 8 nodes for FEBRICK ---*/ - int *Conn_Tetr_Mod = new int[nGlobal_Tetr*N_POINTS_HEXAHEDRON]; - unsigned long iNode_Tetr, iNode_Hexa; - for (unsigned long iElem = 0; iElem < nGlobal_Tetr; iElem++) { - iNode_Tetr = iElem*N_POINTS_TETRAHEDRON; - iNode_Hexa = iElem*N_POINTS_HEXAHEDRON; - Conn_Tetr_Mod[iNode_Hexa+0] = Conn_Tetr[iNode_Tetr+0]; - Conn_Tetr_Mod[iNode_Hexa+1] = Conn_Tetr[iNode_Tetr+1]; - Conn_Tetr_Mod[iNode_Hexa+2] = Conn_Tetr[iNode_Tetr+2]; - Conn_Tetr_Mod[iNode_Hexa+3] = Conn_Tetr[iNode_Tetr+2]; - Conn_Tetr_Mod[iNode_Hexa+4] = Conn_Tetr[iNode_Tetr+3]; - Conn_Tetr_Mod[iNode_Hexa+5] = Conn_Tetr[iNode_Tetr+3]; - Conn_Tetr_Mod[iNode_Hexa+6] = Conn_Tetr[iNode_Tetr+3]; - Conn_Tetr_Mod[iNode_Hexa+7] = Conn_Tetr[iNode_Tetr+3]; - } - NElm = (INTEGER4)(nGlobal_Tetr*N_POINTS_HEXAHEDRON); - err = TECNODE142(&NElm, Conn_Tetr_Mod); - if (err) cout << "Error writing tetrahedral connectivity to Tecplot file" << endl; - delete [] Conn_Tetr_Mod; - - } else { /* Write Tetra connectivity */ - - err = TECNOD142(Conn_Tetr); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - } - - } - - if (nGlobal_Hexa > 0) { - - NElm = (INTEGER4)(nGlobal_Hexa*N_POINTS_HEXAHEDRON); - err = TECNODE142(&NElm, Conn_Hexa); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - - } - - if (nGlobal_Pyra > 0) { - - /*--- Convert the pyramid connectivity from 5 nodes to 8 nodes for FEBRICK ---*/ - int *Conn_Pyra_Mod = new int[nGlobal_Pyra*N_POINTS_HEXAHEDRON]; - unsigned long iNode_Pyra, iNode_Hexa; - for (unsigned long iElem = 0; iElem < nGlobal_Pyra; iElem++) { - iNode_Pyra = iElem*N_POINTS_PYRAMID; - iNode_Hexa = iElem*N_POINTS_HEXAHEDRON; - Conn_Pyra_Mod[iNode_Hexa+0] = Conn_Pyra[iNode_Pyra+4]; - Conn_Pyra_Mod[iNode_Hexa+1] = Conn_Pyra[iNode_Pyra+4]; - Conn_Pyra_Mod[iNode_Hexa+2] = Conn_Pyra[iNode_Pyra+4]; - Conn_Pyra_Mod[iNode_Hexa+3] = Conn_Pyra[iNode_Pyra+4]; - Conn_Pyra_Mod[iNode_Hexa+4] = Conn_Pyra[iNode_Pyra+0]; - Conn_Pyra_Mod[iNode_Hexa+5] = Conn_Pyra[iNode_Pyra+1]; - Conn_Pyra_Mod[iNode_Hexa+6] = Conn_Pyra[iNode_Pyra+2]; - Conn_Pyra_Mod[iNode_Hexa+7] = Conn_Pyra[iNode_Pyra+3]; - } - NElm = (INTEGER4)(nGlobal_Pyra*N_POINTS_HEXAHEDRON); - err = TECNODE142(&NElm, Conn_Pyra_Mod); - if (err) cout << "Error writing pyramid connectivity to Tecplot file" << endl; - delete [] Conn_Pyra_Mod; - - } - - if (nGlobal_Pris > 0) { - - /*--- Convert the prism connectivity from 6 nodes to 8 nodes for FEBRICK ---*/ - int *Conn_Pris_Mod = new int[nGlobal_Pris*N_POINTS_HEXAHEDRON]; - unsigned long iNode_Pris, iNode_Hexa; - for (unsigned long iElem = 0; iElem < nGlobal_Pris; iElem++) { - iNode_Pris = iElem*N_POINTS_PRISM; - iNode_Hexa = iElem*N_POINTS_HEXAHEDRON; - Conn_Pris_Mod[iNode_Hexa+0] = Conn_Pris[iNode_Pris+0]; - Conn_Pris_Mod[iNode_Hexa+1] = Conn_Pris[iNode_Pris+0]; - Conn_Pris_Mod[iNode_Hexa+2] = Conn_Pris[iNode_Pris+1]; - Conn_Pris_Mod[iNode_Hexa+3] = Conn_Pris[iNode_Pris+2]; - Conn_Pris_Mod[iNode_Hexa+4] = Conn_Pris[iNode_Pris+3]; - Conn_Pris_Mod[iNode_Hexa+5] = Conn_Pris[iNode_Pris+3]; - Conn_Pris_Mod[iNode_Hexa+6] = Conn_Pris[iNode_Pris+4]; - Conn_Pris_Mod[iNode_Hexa+7] = Conn_Pris[iNode_Pris+5]; - } - NElm = (INTEGER4)(nGlobal_Pris*N_POINTS_HEXAHEDRON); - err = TECNODE142(&NElm, Conn_Pris_Mod); - if (err) cout << "Error writing prism connectivity to Tecplot file" << endl; - delete [] Conn_Pris_Mod; - - } - - delete [] ShareFromZone; - wrote_base_file = true; - - err = TECEND142(); - if (err) cout << "Error in closing Tecplot file" << endl; - - } - -#endif - -} - -void COutput::SetTecplotBinary_DomainSolution(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { - -#ifdef HAVE_TECIO - - passivedouble t; - INTEGER4 i, iVar, err, Debug, NPts, NElm, N2DElm, NVolElm, IsDouble, KMax; - INTEGER4 ICellMax, JCellMax, KCellMax, ZoneType, StrandID, ParentZn, FileFormat, FileType; - INTEGER4 *ShareFromZone = NULL, IsBlock, NumFaceConnections, FaceNeighborMode, ShareConnectivityFromZone; - string buffer, variables; - stringstream file; - bool first_zone = true, unsteady = config->GetUnsteady_Simulation(), GridMovement = config->GetDynamic_Grid(); - bool Wrt_Unsteady = config->GetWrt_Unsteady(); - unsigned long iExtIter = config->GetExtIter(); - unsigned short NVar, dims = geometry->GetnDim(); - enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 }; - enum FileFormat { PLT = 0, SZPLT = 1 }; - enum ZoneType { ORDERED=0, FELINESEG=1, FETRIANGLE=2, FEQUADRILATERAL=3, FETETRAHEDRON=4, FEBRICK=5, FEPOLYGON=6, FEPOLYHEDRON=7 }; - - bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - unsigned short Kind_Solver = config->GetKind_Solver(); - - /*--- Consistent data for Tecplot zones ---*/ - Debug = 0; - IsDouble = 1; - NPts = (INTEGER4)nGlobal_Poin; - t = SU2_TYPE::GetValue(iExtIter*config->GetDelta_UnstTime()); - KMax = 0; - ICellMax = 0; - JCellMax = 0; - KCellMax = 0; - StrandID = (INTEGER4)iExtIter+1; - ParentZn = 0; - IsBlock = 1; - NumFaceConnections = 0; - FaceNeighborMode = 0; - ShareConnectivityFromZone = 0; - - file.str(string()); - - /*--- Write file name with extension ---*/ - - if (adjoint) - buffer = config->GetAdj_FileName(); - else buffer = config->GetFlow_FileName(); - - if (Kind_Solver == FEM_ELASTICITY) { - buffer = config->GetStructure_FileName().c_str(); - } - - if (Kind_Solver == HEAT_EQUATION_FVM) { - buffer = config->GetHeat_FileName().c_str(); - } - - if (config->GetKind_SU2() == SU2_DOT) { - buffer = config->GetVolSens_FileName(); - } - file << buffer; - - if (unsteady) { - if (((int)iExtIter >= 0) && ((int)iExtIter < 10)) file << "_0000" << iExtIter; - if (((int)iExtIter >= 10) && ((int)iExtIter < 100)) file << "_000" << iExtIter; - if (((int)iExtIter >= 100) && ((int)iExtIter < 1000)) file << "_00" << iExtIter; - if (((int)iExtIter >= 1000) && ((int)iExtIter < 10000)) file << "_0" << iExtIter; - if ((int)iExtIter >= 10000) file << iExtIter; - } - - file << ".sol.szplt"; - FileFormat = SZPLT; - FileType = SOLUTION; - variables = AssembleVariableNames(geometry, config, nVar_Consv, &NVar); - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - if (Wrt_Unsteady && GridMovement) nVar_Total = NVar; - else nVar_Total = NVar+dims; - } - - /*--- Open Tecplot file ---*/ - err = TECINI142((char *)config->GetFlow_FileName().c_str(), - (char *)variables.c_str(), - (char *)file.str().c_str(), - (char *)".", - &FileFormat, - &FileType, - &Debug, - &IsDouble); - if (err) cout << "Error in opening Tecplot file" << endl; - - first_zone = true; - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - N2DElm = (INTEGER4)(nGlobal_Tria + nGlobal_Quad); - if (N2DElm > 0) { - - /*--- Write the zone header information ---*/ - - if ((INTEGER4)nGlobal_Tria < N2DElm) { /* Create a Quad zone with a mixed element types */ - - ZoneType = FEQUADRILATERAL; NElm = N2DElm; - - err = TECZNE142((char*)"Mixed Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - - } else { /* Create a Tria zone */ - - ZoneType = FETRIANGLE; NElm = (INTEGER4)nGlobal_Tria; - - err = TECZNE142((char*)"Triangle Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - } - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - i = 0; - if (config->GetKind_SU2() == SU2_SOL) { - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - delete [] PassiveData; - - } else { - - if (Wrt_Unsteady && GridMovement) { - - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - if (dims == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - ShareFromZone[i++] = 1; - } - } - - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - first_zone = false; - } - - } - if (nGlobal_Quad > 0) { - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - i = 0; - if (config->GetKind_SU2() == SU2_SOL) { - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - delete [] PassiveData; - - } else { - if (Wrt_Unsteady && GridMovement) { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - if (dims == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - ShareFromZone[i++] = 1; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - first_zone = false; - } - - } - - /*--- Create 3D Volume Zone ---*/ - NVolElm = (INTEGER4)(nGlobal_Tetr + nGlobal_Pyra + nGlobal_Pris + nGlobal_Hexa); - if (NVolElm > 0) { - - /*--- Write the zone header information ---*/ - - if ((INTEGER4)nGlobal_Tetr < NVolElm) { /* Create a Hexa zone with a mixed element types */ - - /*--- Write the mixed-element zone header information ---*/ - - ZoneType = FEBRICK; NElm = NVolElm; - - err = TECZNE142((char*)"Mixed Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - } else { /* Create a Tetra zone */ - - /*--- Write the tetrahedral zone header information ---*/ - - ZoneType = FETETRAHEDRON; NElm = (INTEGER4)nGlobal_Tetr; - - err = TECZNE142((char*)"Tetrahedral Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - } - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - i = 0; - if (config->GetKind_SU2() == SU2_SOL) { - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - delete [] PassiveData; - - } else { - if (Wrt_Unsteady && GridMovement) { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - if (dims == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - ShareFromZone[i++] = 1; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - first_zone = false; - } - - } - - if (nGlobal_Hexa > 0) { - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - i = 0; - if (config->GetKind_SU2() == SU2_SOL) { - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - delete [] PassiveData; - - } else { - if (Wrt_Unsteady && GridMovement) { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - if (dims == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - ShareFromZone[i++] = 1; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - first_zone = false; - } - - } - if (nGlobal_Pyra > 0) { - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - i = 0; - if (config->GetKind_SU2() == SU2_SOL) { - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - delete [] PassiveData; - - } else { - if (Wrt_Unsteady && GridMovement) { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - if (dims == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - ShareFromZone[i++] = 1; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - first_zone = false; - } - - } - if (nGlobal_Pris > 0) { - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - i = 0; - if (config->GetKind_SU2() == SU2_SOL) { - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - } else if (config->GetKind_SU2() == SU2_DOT) { - - passivedouble* PassiveData = new passivedouble[NPts]; - - if (Wrt_Unsteady && GridMovement) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - for (iVar = dims; iVar < nVar_Total; iVar++) { - for (i = 0; i < NPts; i++) PassiveData[i] = SU2_TYPE::GetValue(Data[iVar][i]); - err = TECDAT142(&NPts, PassiveData, &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - delete [] PassiveData; - - } else { - if (Wrt_Unsteady && GridMovement) { - err = TECDAT142(&NPts, Coords[0], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - err = TECDAT142(&NPts, Coords[1], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - if (dims == 3) { - err = TECDAT142(&NPts, Coords[2], &IsDouble); - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - ShareFromZone[i++] = 1; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - - first_zone = false; - } - } - - delete [] ShareFromZone; - - err = TECEND142(); - if (err) cout << "Error in closing Tecplot file" << endl; - -#endif - -} - -void COutput::SetTecplotBinary_SurfaceMesh(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { - -#ifdef HAVE_TECIO - - passivedouble t; - INTEGER4 i, err, Debug, NPts, NElm, IsDouble, KMax; - INTEGER4 ICellMax, JCellMax, KCellMax, ZoneType, StrandID, ParentZn, FileFormat, FileType; - INTEGER4 *ShareFromZone, IsBlock, NumFaceConnections, FaceNeighborMode, ShareConnectivityFromZone; - string buffer, variables; - stringstream file; - bool first_zone = true; - unsigned short iDim, dims = geometry->GetnDim(); - unsigned long iPoint, iElem, iNode; - enum FileFormat { PLT = 0, SZPLT = 1 }; - enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 }; - enum ZoneType { ORDERED=0, FELINESEG=1, FETRIANGLE=2, FEQUADRILATERAL=3, FETETRAHEDRON=4, FEBRICK=5, FEPOLYGON=6, FEPOLYHEDRON=7 }; - - /*--- Write Tecplot solution file ---*/ - if (!wrote_surf_file) { - - file.str(string()); - buffer = config->GetSurfFlowCoeff_FileName(); - if (config->GetKind_SU2() == SU2_DOT) { - buffer = config->GetSurfSens_FileName(); - } - - FileFormat = PLT; - - file << buffer << ".mesh.szplt"; - FileType = GRID; - - if (dims == 2) variables = "x y"; - else if (dims == 3) variables = "x y z"; - else cout << "Error: wrong number of dimensions: " << dims << endl; - - first_zone = true; - ShareFromZone = new INTEGER4[dims]; - for (i = 0; i < dims; i++) ShareFromZone[i] = 0; - - /*--- Perform a renumbering for the surface points/elements ---*/ - unsigned long *LocalIndex = new unsigned long [nGlobal_Poin+1]; - bool *SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - unsigned long nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) { nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin; } - } - - /*--- Collect surface coordinates into one array as well ---*/ - /*--- Note the -1 in the Coords/Data array in order to undo the 1-based indexing ---*/ - passivedouble **Surf_Coords = new passivedouble*[dims]; - for (iDim = 0; iDim < dims; iDim++) - Surf_Coords[iDim] = new passivedouble[nSurf_Poin]; - - unsigned long iSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - if (SurfacePoint[iPoint]) { - for (iDim = 0; iDim < dims; iDim++) { - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) - Surf_Coords[iDim][iSurf_Poin] = SU2_TYPE::GetValue(Data[iDim][iPoint-1]); - else - Surf_Coords[iDim][iSurf_Poin] = SU2_TYPE::GetValue(Coords[iDim][iPoint-1]); - } - iSurf_Poin++; - } - } - - /*--- Consistent data for Tecplot zones ---*/ - Debug = 0; - IsDouble = 1; - NPts = (INTEGER4)nSurf_Poin; - t = 0.0;//iExtIter*config->GetDelta_UnstTimeND(); - KMax = 0; - ICellMax = 0; - JCellMax = 0; - KCellMax = 0; - StrandID = 0;//(INTEGER4)iExtIter; - ParentZn = 0; - IsBlock = 1; - NumFaceConnections = 0; - FaceNeighborMode = 0; - ShareConnectivityFromZone = 0; - - /*--- Open Tecplot file ---*/ - err = TECINI142((char *)config->GetSurfFlowCoeff_FileName().c_str(), - (char *)variables.c_str(), - (char *)file.str().c_str(), - (char *)".", - &FileFormat, - &FileType, - &Debug, - &IsDouble); - if (err) cout << "Error in opening Tecplot file" << endl; - - - if (nGlobal_Line > 0) { - - /*--- Put the connectivity into a single array for writing ---*/ - int *Conn_Line_New = new int[nGlobal_Line*N_POINTS_LINE]; - iNode = 0; - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - Conn_Line_New[iNode+0] = LocalIndex[Conn_Line[iNode+0]]; - Conn_Line_New[iNode+1] = LocalIndex[Conn_Line[iNode+1]]; - } - - /*--- Write the zone header information ---*/ - ZoneType = FELINESEG; NElm = (INTEGER4)nGlobal_Line; - - err = TECZNE142((char*)"Line Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - NULL, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - err = TECDAT142(&NPts, Surf_Coords[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Surf_Coords[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Surf_Coords[2], &IsDouble); - ShareFromZone[2] = 1; - } - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - first_zone = false; - } - - err = TECNOD142(Conn_Line_New); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - - delete [] Conn_Line_New; - } - - if (nGlobal_BoundTria > 0) { - - /*--- Put the connectivity into a single array for writing ---*/ - int *Conn_BoundTria_New = new int[nGlobal_BoundTria*N_POINTS_TRIANGLE]; - - iNode = 0; - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - Conn_BoundTria_New[iNode+0] = LocalIndex[Conn_BoundTria[iNode+0]]; - Conn_BoundTria_New[iNode+1] = LocalIndex[Conn_BoundTria[iNode+1]]; - Conn_BoundTria_New[iNode+2] = LocalIndex[Conn_BoundTria[iNode+2]]; - } - - /*--- Write the zone header information ---*/ - ZoneType = FETRIANGLE; NElm = (INTEGER4)nGlobal_BoundTria; - - err = TECZNE142((char*)"Triangle Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - err = TECDAT142(&NPts, Surf_Coords[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Surf_Coords[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Surf_Coords[2], &IsDouble); - ShareFromZone[2] = 1; - } - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - first_zone = false; - } - - err = TECNOD142(Conn_BoundTria_New); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - - delete [] Conn_BoundTria_New; - } - - if (nGlobal_BoundQuad > 0) { - - - /*--- Put the connectivity into a single array for writing ---*/ - int *Conn_BoundQuad_New = new int[nGlobal_BoundQuad*N_POINTS_QUADRILATERAL]; - iNode = 0; - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - Conn_BoundQuad_New[iNode+0] = LocalIndex[Conn_BoundQuad[iNode+0]]; - Conn_BoundQuad_New[iNode+1] = LocalIndex[Conn_BoundQuad[iNode+1]]; - Conn_BoundQuad_New[iNode+2] = LocalIndex[Conn_BoundQuad[iNode+2]]; - Conn_BoundQuad_New[iNode+3] = LocalIndex[Conn_BoundQuad[iNode+3]]; - } - - /*--- Write the zone header information ---*/ - ZoneType = FEQUADRILATERAL; NElm = (INTEGER4)nGlobal_BoundQuad; - - err = TECZNE142((char*)"Quadrilateral Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - err = TECDAT142(&NPts, Surf_Coords[0], &IsDouble); ShareFromZone[0] = 1; - err = TECDAT142(&NPts, Surf_Coords[1], &IsDouble); ShareFromZone[1] = 1; - if (geometry->GetnDim() == 3) { - err = TECDAT142(&NPts, Surf_Coords[2], &IsDouble); - ShareFromZone[2] = 1; - } - if (err) cout << "Error writing coordinates to Tecplot file" << endl; - first_zone = false; - } - - err = TECNOD142(Conn_BoundQuad_New); - if (err) cout << "Error writing connectivity to Tecplot file" << endl; - - delete [] Conn_BoundQuad_New; - } - - for (iDim = 0; iDim < dims; iDim++) - delete [] Surf_Coords[iDim]; - delete [] Surf_Coords; - delete [] ShareFromZone; - delete [] LocalIndex; - delete [] SurfacePoint; - - wrote_surf_file = true; - - err = TECEND142(); - if (err) cout << "Error in closing Tecplot file" << endl; - - } - -#endif - -} - -void COutput::SetTecplotBinary_SurfaceSolution(CConfig *config, CGeometry *geometry, unsigned short val_iZone) { - -#ifdef HAVE_TECIO - - passivedouble t; - INTEGER4 i, iVar, err, Debug, NPts, NElm, IsDouble, KMax; - INTEGER4 ICellMax, JCellMax, KCellMax, ZoneType, StrandID, ParentZn, FileFormat, FileType; - INTEGER4 *ShareFromZone, IsBlock, NumFaceConnections, FaceNeighborMode, ShareConnectivityFromZone; - string buffer, variables; - stringstream file; - bool first_zone = true, unsteady = config->GetUnsteady_Simulation(), GridMovement = config->GetDynamic_Grid(); - bool Wrt_Unsteady = config->GetWrt_Unsteady(); - unsigned long iPoint, iElem, iNode, iSurf_Poin, iExtIter = config->GetExtIter(); - unsigned short iDim, NVar, dims = geometry->GetnDim(); - enum FileFormat { PLT = 0, SZPLT = 1 }; - enum FileType { FULL = 0, GRID = 1, SOLUTION = 2 }; - enum ZoneType { ORDERED=0, FELINESEG=1, FETRIANGLE=2, FEQUADRILATERAL=3, FETETRAHEDRON=4, FEBRICK=5, FEPOLYGON=6, FEPOLYHEDRON=7 }; - - bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - unsigned short Kind_Solver = config->GetKind_Solver(); - - file.str(string()); - - /*--- Write file name with extension ---*/ - - if (adjoint) buffer = config->GetSurfAdjCoeff_FileName(); - else buffer = config->GetSurfFlowCoeff_FileName(); - - if (Kind_Solver == FEM_ELASTICITY) { - buffer = config->GetSurfStructure_FileName().c_str(); - } - - if (Kind_Solver == HEAT_EQUATION_FVM) { - buffer = config->GetSurfHeat_FileName().c_str(); - } - - if (config->GetKind_SU2() == SU2_DOT) { - buffer = config->GetSurfSens_FileName(); - } - - file << buffer; - - if (unsteady) { - if (((int)iExtIter >= 0) && ((int)iExtIter < 10)) file << "_0000" << iExtIter; - if (((int)iExtIter >= 10) && ((int)iExtIter < 100)) file << "_000" << iExtIter; - if (((int)iExtIter >= 100) && ((int)iExtIter < 1000)) file << "_00" << iExtIter; - if (((int)iExtIter >= 1000) && ((int)iExtIter < 10000)) file << "_0" << iExtIter; - if ((int)iExtIter >= 10000) file << iExtIter; - } - file << ".sol.szplt"; - FileFormat = PLT; - FileType = SOLUTION; - variables = AssembleVariableNames(geometry, config, nVar_Consv, &NVar); - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - if (Wrt_Unsteady && GridMovement) nVar_Total = NVar; - else nVar_Total = NVar+dims; - } - - first_zone = true; - ShareFromZone = new INTEGER4[NVar]; - for (i = 0; i < NVar; i++) ShareFromZone[i] = 0; - - - /*--- Perform a renumbering for the surface points/elements ---*/ - unsigned long *LocalIndex = new unsigned long [nGlobal_Poin+1]; - bool *SurfacePoint = new bool [nGlobal_Poin+1]; - - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) SurfacePoint[iPoint] = false; - - for (iElem = 0; iElem < nGlobal_Line; iElem++) { - iNode = iElem*N_POINTS_LINE; - SurfacePoint[Conn_Line[iNode+0]] = true; - SurfacePoint[Conn_Line[iNode+1]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundTria; iElem++) { - iNode = iElem*N_POINTS_TRIANGLE; - SurfacePoint[Conn_BoundTria[iNode+0]] = true; - SurfacePoint[Conn_BoundTria[iNode+1]] = true; - SurfacePoint[Conn_BoundTria[iNode+2]] = true; - } - for (iElem = 0; iElem < nGlobal_BoundQuad; iElem++) { - iNode = iElem*N_POINTS_QUADRILATERAL; - SurfacePoint[Conn_BoundQuad[iNode+0]] = true; - SurfacePoint[Conn_BoundQuad[iNode+1]] = true; - SurfacePoint[Conn_BoundQuad[iNode+2]] = true; - SurfacePoint[Conn_BoundQuad[iNode+3]] = true; - } - - unsigned long nSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - LocalIndex[iPoint] = 0; - if (SurfacePoint[iPoint]) { nSurf_Poin++; LocalIndex[iPoint] = nSurf_Poin; } - } - - /*--- Collect surface coordinates into one array as well ---*/ - /*--- Note the -1 in the Coords/Data array in order to undo the 1-based indexing ---*/ - passivedouble **Surf_Coords = NULL; - if (Wrt_Unsteady && GridMovement) { - Surf_Coords = new passivedouble*[dims]; - for (iDim = 0; iDim < dims; iDim++) - Surf_Coords[iDim] = new passivedouble[nSurf_Poin]; - - iSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - if (SurfacePoint[iPoint]) { - for (iDim = 0; iDim < dims; iDim++) { - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) - Surf_Coords[iDim][iSurf_Poin] = SU2_TYPE::GetValue(Data[iDim][iPoint-1]); - else - Surf_Coords[iDim][iSurf_Poin] = SU2_TYPE::GetValue(Coords[iDim][iPoint-1]); - } - iSurf_Poin++; - } - } - } - - /*--- Collect surface data into one array for the surface as well ---*/ - /*--- Note the -1 in the Coords/Data array in order to undo the 1-based indexing ---*/ - passivedouble **Surf_Data = new passivedouble*[nVar_Total]; - for (iVar = 0; iVar < nVar_Total; iVar++) - Surf_Data[iVar] = new passivedouble[nSurf_Poin]; - - iSurf_Poin = 0; - for (iPoint = 0; iPoint < nGlobal_Poin+1; iPoint++) { - if (SurfacePoint[iPoint]) { - for (iVar = 0; iVar < nVar_Total; iVar++) { - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - if (Wrt_Unsteady && GridMovement) - Surf_Data[iVar][iSurf_Poin] = SU2_TYPE::GetValue(Data[iVar][iPoint-1]); - else - Surf_Data[iVar][iSurf_Poin] = SU2_TYPE::GetValue(Data[iVar][iPoint-1]); - } else - Surf_Data[iVar][iSurf_Poin] = SU2_TYPE::GetValue(Data[iVar][iPoint-1]); - } - iSurf_Poin++; - } - } - - /*--- Consistent data for Tecplot zones ---*/ - Debug = 0; - IsDouble = 1; - NPts = (INTEGER4)nSurf_Poin; - t = SU2_TYPE::GetValue(iExtIter*config->GetDelta_UnstTime()); - KMax = 0; - ICellMax = 0; - JCellMax = 0; - KCellMax = 0; - StrandID = (INTEGER4)iExtIter+1; - ParentZn = 0; - IsBlock = 1; - NumFaceConnections = 0; - FaceNeighborMode = 0; - ShareConnectivityFromZone = 0; - - - /*--- Open Tecplot file ---*/ - err = TECINI142((char *)config->GetFlow_FileName().c_str(), - (char *)variables.c_str(), - (char *)file.str().c_str(), - (char *)".", - &FileFormat, - &FileType, - &Debug, - &IsDouble); - if (err) cout << "Error in opening Tecplot file" << endl; - - - if (nGlobal_Line > 0) { - - /*--- Write the zone header information ---*/ - ZoneType = FELINESEG; NElm = (INTEGER4)nGlobal_Line; - - err = TECZNE142((char*)"Line Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - i = 0; - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - if (Wrt_Unsteady && GridMovement) { - for (iDim = 0; iDim < dims; iDim++) { - err = TECDAT142(&NPts, Surf_Data[iDim], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Surf_Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - if (Wrt_Unsteady && GridMovement) { - for (iDim = 0; iDim < dims; iDim++) { - err = TECDAT142(&NPts, Surf_Coords[iDim], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Surf_Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - first_zone = false; - } - - } - - if (nGlobal_BoundTria > 0) { - - /*--- Write the zone header information ---*/ - ZoneType = FETRIANGLE; NElm = (INTEGER4)nGlobal_BoundTria; - - err = TECZNE142((char*)"Triangle Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - i = 0; - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - if (Wrt_Unsteady && GridMovement) { - for (iDim = 0; iDim < dims; iDim++) { - err = TECDAT142(&NPts, Surf_Data[iDim], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Surf_Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - if (Wrt_Unsteady && GridMovement) { - for (iDim = 0; iDim < dims; iDim++) { - err = TECDAT142(&NPts, Surf_Coords[iDim], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Surf_Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - first_zone = false; - } - - } - - if (nGlobal_BoundQuad > 0) { - - /*--- Write the zone header information ---*/ - ZoneType = FEQUADRILATERAL; NElm = (INTEGER4)nGlobal_BoundQuad; - - err = TECZNE142((char*)"Quadrilateral Elements", - &ZoneType, - &NPts, - &NElm, - &KMax, - &ICellMax, - &JCellMax, - &KCellMax, - &t, - &StrandID, - &ParentZn, - &IsBlock, - &NumFaceConnections, - &FaceNeighborMode, - 0, /* TotalNumFaceNodes */ - 0, /* NumConnectedBoundaryFaces */ - 0, /* TotalNumBoundaryConnections */ - NULL, /* PassiveVarList */ - NULL, /* ValueLocation */ - ShareFromZone, /* ShareVarFromZone */ - &ShareConnectivityFromZone); - if (err) cout << "Error writing Tecplot zone data" << endl; - - /*--- write node coordinates and data if not done already---*/ - if (first_zone) { - - i = 0; - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - if (Wrt_Unsteady && GridMovement) { - for (iDim = 0; iDim < dims; iDim++) { - err = TECDAT142(&NPts, Surf_Data[iDim], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - for (iVar = dims; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Surf_Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } else { - if (Wrt_Unsteady && GridMovement) { - for (iDim = 0; iDim < dims; iDim++) { - err = TECDAT142(&NPts, Surf_Coords[iDim], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - for (iVar = 0; iVar < nVar_Total; iVar++) { - err = TECDAT142(&NPts, Surf_Data[iVar], &IsDouble); ShareFromZone[i++] = 1; - if (err) cout << "Error writing data to Tecplot file" << endl; - } - } - first_zone = false; - } - - } - - for (iVar = 0; iVar < nVar_Total; iVar++) - delete [] Surf_Data[iVar]; - delete [] Surf_Data; - - if (Surf_Coords != NULL) { - for (iDim = 0; iDim < dims; iDim++) delete [] Surf_Coords[iDim]; - delete [] Surf_Coords; - } - delete [] LocalIndex; - delete [] SurfacePoint; - delete [] ShareFromZone; - - err = TECEND142(); - if (err) cout << "Error in closing Tecplot file" << endl; - -#endif - -} - -string COutput::AssembleVariableNames(CGeometry *geometry, CConfig *config, unsigned short nVar_Consv, unsigned short *NVar) { - - /*--- Local variables ---*/ - stringstream variables; variables.str(string()); - unsigned short iVar; - *NVar = 0; - unsigned short nDim = geometry->GetnDim(); - unsigned short Kind_Solver = config->GetKind_Solver(); - bool dynamic_grid = config->GetDynamic_Grid(); - bool Wrt_Unsteady = config->GetWrt_Unsteady(); - - - /*--- Write the basic variable header based on the particular solution ----*/ - - /*--- Write the list of the fields in the restart file. - Without including the PointID---*/ - if ((config->GetKind_SU2() == SU2_SOL) || (config->GetKind_SU2() == SU2_DOT)) { - - /*--- If SU2_SOL called this routine, we already have a set of output - variables with the appropriate string tags stored in the config class. - We simply read in and remove the quotation marks from the var names. ---*/ - - /*--- Set the number of variables to be written. Subtract off an index for - the PointID as well as each coordinate (x, y, z). ---*/ - string varname; - - if (Wrt_Unsteady && dynamic_grid) { - - *NVar = config->fields.size()-1; - for (unsigned short iField = 1; iField < config->fields.size(); iField++) { - varname = config->fields[iField]; - varname.erase (varname.begin(), varname.begin()+1); - varname.erase (varname.end()-1, varname.end()); - variables << varname << " "; - } - } else { - - *NVar = config->fields.size()-1-nDim; - for (unsigned short iField = 1+nDim; iField < config->fields.size(); iField++) { - varname = config->fields[iField]; - varname.erase (varname.begin(), varname.begin()+1); - varname.erase (varname.end()-1, varname.end()); - variables << varname << " "; - } - } - - } else { - - if (Wrt_Unsteady && dynamic_grid) { - if (nDim == 2) { - variables << "x y "; *NVar += 2; - } else { - variables << "x y z "; *NVar += 3; - } - } - - for (iVar = 0; iVar < nVar_Consv; iVar++) { - variables << "Conservative_" << iVar+1<<" "; *NVar += 1; - } - if (config->GetWrt_Limiters()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - variables << "Limiter_" << iVar+1<<" "; *NVar += 1; - } - } - if (config->GetWrt_Residuals()) { - for (iVar = 0; iVar < nVar_Consv; iVar++) { - variables << "Residual_" << iVar+1<<" "; *NVar += 1; - } - } - - /*--- Add names for any extra variables (this will need to be adjusted). ---*/ - if (dynamic_grid) { - if (nDim == 2) { - variables << "Grid_Velx Grid_Vely "; *NVar += 2; - } else { - variables << "Grid_Velx Grid_Vely Grid_Velz "; *NVar += 3; - } - } - - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - variables << "Pressure Temperature Pressure_Coefficient Mach "; - *NVar += 4; - } - - if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - if (nDim == 2) { - variables << "Laminar_Viscosity Skin_Friction_Coefficient_x Skin_Friction_Coefficient_y Heat_Flux Y_Plus "; - *NVar += 5; - } - else { - variables << "Laminar_Viscosity Skin_Friction_Coefficient_x Skin_Friction_Coefficient_y Skin_Friction_Coefficient_z Heat_Flux Y_Plus "; - *NVar += 6; - } - } - - if (Kind_Solver == RANS) { - variables << "Eddy_Viscosity "; - *NVar += 1; - } - - if (config->GetWrt_SharpEdges()) { - if ((Kind_Solver == EULER) || (Kind_Solver == NAVIER_STOKES) || (Kind_Solver == RANS)) { - variables << "Sharp_Edge_Dist "; - *NVar += 1; - } - } - - - - if (( Kind_Solver == ADJ_EULER ) || - ( Kind_Solver == ADJ_NAVIER_STOKES ) || - ( Kind_Solver == ADJ_RANS ) ) { - variables << "Surface_Sensitivity Solution_Sensor "; - *NVar += 2; - } - } - - return variables.str(); - -} diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index cb47fa072477..501939b3be6a 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -295,19 +295,19 @@ bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned short iVertex) { } -unsigned long CDriver::GetnExtIter() { +unsigned long CDriver::GetnTimeIter() { - return config_container[ZONE_0]->GetnExtIter(); + return config_container[ZONE_0]->GetnTime_Iter(); } -unsigned long CDriver::GetExtIter(){ +unsigned long CDriver::GetTime_Iter(){ - return ExtIter; + return TimeIter; } passivedouble CDriver::GetUnsteady_TimeStep(){ - return SU2_TYPE::GetValue(config_container[ZONE_0]->GetDelta_UnstTime()); + return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); } passivedouble CDriver::GetVertexCoordX(unsigned short iMarker, unsigned short iVertex) { diff --git a/SU2_CFD/src/solver_adjoint_discrete.cpp b/SU2_CFD/src/solver_adjoint_discrete.cpp index 1d494c09bcbf..4cc42e00e070 100644 --- a/SU2_CFD/src/solver_adjoint_discrete.cpp +++ b/SU2_CFD/src/solver_adjoint_discrete.cpp @@ -154,9 +154,9 @@ CDiscAdjSolver::~CDiscAdjSolver(void) { void CDiscAdjSolver::SetRecording(CGeometry* geometry, CConfig *config){ - bool time_n_needed = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)), - time_n1_needed = config->GetUnsteady_Simulation() == DT_STEPPING_2ND; + bool time_n_needed = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)), + time_n1_needed = config->GetTime_Marching() == DT_STEPPING_2ND; unsigned long iPoint; unsigned short iVar; @@ -248,9 +248,9 @@ void CDiscAdjSolver::SetMesh_Recording(CGeometry** geometry, CVolumetricMovement void CDiscAdjSolver::RegisterSolution(CGeometry *geometry, CConfig *config) { unsigned long iPoint, nPoint = geometry->GetnPoint(); - bool time_n_needed = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)), - time_n1_needed = config->GetUnsteady_Simulation() == DT_STEPPING_2ND, + bool time_n_needed = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)), + time_n1_needed = config->GetTime_Marching() == DT_STEPPING_2ND, input = true; /*--- Register solution at all necessary time instances and other variables on the tape ---*/ @@ -437,13 +437,13 @@ void CDiscAdjSolver::RegisterObj_Func(CConfig *config) { void CDiscAdjSolver::SetAdj_ObjFunc(CGeometry *geometry, CConfig *config) { - bool time_stepping = config->GetUnsteady_Simulation() != STEADY; + bool time_stepping = config->GetTime_Marching() != STEADY; unsigned long IterAvg_Obj = config->GetIter_Avg_Objective(); - unsigned long ExtIter = config->GetExtIter(); + unsigned long TimeIter = config->GetTimeIter(); su2double seeding = 1.0; if (time_stepping) { - if (ExtIter < IterAvg_Obj) { + if (TimeIter < IterAvg_Obj) { seeding = 1.0/((su2double)IterAvg_Obj); } else { @@ -460,10 +460,10 @@ void CDiscAdjSolver::SetAdj_ObjFunc(CGeometry *geometry, CConfig *config) { void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config){ - bool time_n_needed = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool time_n_needed = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool time_n1_needed = config->GetUnsteady_Simulation() == DT_STEPPING_2ND; + bool time_n1_needed = config->GetTime_Marching() == DT_STEPPING_2ND; unsigned short iVar; unsigned long iPoint; @@ -727,8 +727,8 @@ void CDiscAdjSolver::ExtractAdjoint_CrossTerm_Geometry_Flow(CGeometry *geometry, void CDiscAdjSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config) { - bool dual_time = (config->GetUnsteady_Simulation() == DT_STEPPING_1ST || - config->GetUnsteady_Simulation() == DT_STEPPING_2ND); + bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST || + config->GetTime_Marching() == DT_STEPPING_2ND); bool fsi = config->GetFSI_Simulation(); unsigned short iVar; @@ -794,7 +794,7 @@ void CDiscAdjSolver::SetSensitivity(CGeometry *geometry, CSolver **solver, CConf unsigned short iDim; su2double *Coord, Sensitivity, eps; - bool time_stepping = (config->GetUnsteady_Simulation() != STEADY); + bool time_stepping = (config->GetTime_Marching() != STEADY); for (iPoint = 0; iPoint < nPoint; iPoint++) { Coord = geometry->node[iPoint]->GetCoord(); @@ -909,8 +909,8 @@ void CDiscAdjSolver::SetSurface_Sensitivity(CGeometry *geometry, CConfig *config } void CDiscAdjSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config_container, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - bool dual_time_1st = (config_container->GetUnsteady_Simulation() == DT_STEPPING_1ST); - bool dual_time_2nd = (config_container->GetUnsteady_Simulation() == DT_STEPPING_2ND); + bool dual_time_1st = (config_container->GetTime_Marching() == DT_STEPPING_1ST); + bool dual_time_2nd = (config_container->GetTime_Marching() == DT_STEPPING_2ND); bool dual_time = (dual_time_1st || dual_time_2nd); su2double *solution_n, *solution_n1; unsigned long iPoint; @@ -932,9 +932,8 @@ void CDiscAdjSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfi unsigned short iVar, iMesh; unsigned long iPoint, index, iChildren, Point_Fine, counter; su2double Area_Children, Area_Parent, *Solution_Fine; - ifstream restart_file; - string restart_filename, filename, text_line; - + string restart_filename, filename; + bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); @@ -942,10 +941,13 @@ void CDiscAdjSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfi filename = config->GetSolution_AdjFileName(); restart_filename = config->GetObjFunc_Extension(filename); + + restart_filename = config->GetFilename(restart_filename, "", val_iter); + /*--- Read and store the restart metadata. ---*/ - Read_SU2_Restart_Metadata(geometry[MESH_0], config, true, restart_filename); +// Read_SU2_Restart_Metadata(geometry[MESH_0], config, true, restart_filename); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ @@ -1075,15 +1077,3 @@ void CDiscAdjSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *con } -void CDiscAdjSolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config){ - - unsigned long iPoint; - - /*--- To nPoint: The solution must be communicated beforehand ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++){ - - node[iPoint]->Set_BGSSolution_k(); - - } - -} diff --git a/SU2_CFD/src/solver_adjoint_elasticity.cpp b/SU2_CFD/src/solver_adjoint_elasticity.cpp index 95aa73de2433..bbd221d050a4 100644 --- a/SU2_CFD/src/solver_adjoint_elasticity.cpp +++ b/SU2_CFD/src/solver_adjoint_elasticity.cpp @@ -85,7 +85,7 @@ CDiscAdjFEASolver::CDiscAdjFEASolver(CGeometry *geometry, CConfig *config, CSolv string text_line, mesh_filename; string filename, AdjExt; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); nVar = direct_solver->GetnVar(); nDim = geometry->GetnDim(); @@ -383,7 +383,7 @@ CDiscAdjFEASolver::~CDiscAdjFEASolver(void){ void CDiscAdjFEASolver::SetRecording(CGeometry* geometry, CConfig *config){ - bool dynamic (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic (config->GetTime_Domain()); unsigned long iPoint; unsigned short iVar; @@ -440,7 +440,7 @@ void CDiscAdjFEASolver::RegisterSolution(CGeometry *geometry, CConfig *config){ unsigned long iPoint, nPoint = geometry->GetnPoint(); - bool dynamic (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic (config->GetTime_Domain()); bool input = true; /*--- Register solution at all necessary time instances and other variables on the tape ---*/ @@ -535,7 +535,7 @@ void CDiscAdjFEASolver::RegisterOutput(CGeometry *geometry, CConfig *config){ unsigned long iPoint, nPoint = geometry->GetnPoint(); - bool dynamic (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); /*--- Register variables as output of the solver iteration ---*/ @@ -599,13 +599,13 @@ void CDiscAdjFEASolver::RegisterObj_Func(CConfig *config){ void CDiscAdjFEASolver::SetAdj_ObjFunc(CGeometry *geometry, CConfig *config){ - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); unsigned long IterAvg_Obj = config->GetIter_Avg_Objective(); - unsigned long ExtIter = config->GetExtIter(); + unsigned long TimeIter = config->GetTimeIter(); su2double seeding = 1.0; if (dynamic){ - if (ExtIter < IterAvg_Obj){ + if (TimeIter < IterAvg_Obj){ seeding = 1.0/((su2double)IterAvg_Obj); } else{ @@ -622,7 +622,7 @@ void CDiscAdjFEASolver::SetAdj_ObjFunc(CGeometry *geometry, CConfig *config){ void CDiscAdjFEASolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config){ - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); unsigned short iVar; unsigned long iPoint; @@ -832,7 +832,7 @@ void CDiscAdjFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *c void CDiscAdjFEASolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config){ - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); bool fsi = config->GetFSI_Simulation(); bool deform_mesh = (config->GetnMarker_Deform_Mesh() > 0); @@ -887,7 +887,7 @@ void CDiscAdjFEASolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config){ void CDiscAdjFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config_container, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output){ - bool dynamic = (config_container->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config_container->GetTime_Domain()); unsigned long iPoint; unsigned short iVar; @@ -1011,23 +1011,10 @@ void CDiscAdjFEASolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig * } -void CDiscAdjFEASolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config){ - - unsigned long iPoint; - - /*--- To nPoint: The solution must be communicated beforehand ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++){ - - node[iPoint]->Set_BGSSolution_k(); - - } - -} - void CDiscAdjFEASolver::BC_Clamped_Post(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { unsigned long iPoint, iVertex; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { @@ -1155,8 +1142,7 @@ void CDiscAdjFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CCo unsigned short iVar, iMesh; unsigned long iPoint, index, iChildren, Point_Fine, counter; su2double Area_Children, Area_Parent, *Solution_Fine; - ifstream restart_file; - string restart_filename, filename, text_line; + string restart_filename, filename; bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); @@ -1165,10 +1151,11 @@ void CDiscAdjFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CCo filename = config->GetSolution_AdjFileName(); restart_filename = config->GetObjFunc_Extension(filename); + restart_filename = config->GetFilename(restart_filename, "", val_iter); /*--- Read and store the restart metadata. ---*/ - Read_SU2_Restart_Metadata(geometry[MESH_0], config, true, restart_filename); +// Read_SU2_Restart_Metadata(geometry[MESH_0], config, true, restart_filename); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ diff --git a/SU2_CFD/src/solver_adjoint_mean.cpp b/SU2_CFD/src/solver_adjoint_mean.cpp index 436ff3d7a360..7ae32d1296c4 100644 --- a/SU2_CFD/src/solver_adjoint_mean.cpp +++ b/SU2_CFD/src/solver_adjoint_mean.cpp @@ -300,7 +300,7 @@ CAdjEulerSolver::CAdjEulerSolver(CGeometry *geometry, CConfig *config, unsigned if (restart && (iMesh == MESH_0)) { mesh_filename = config->GetSolution_AdjFileName(); filename = config->GetObjFunc_Extension(mesh_filename); - Read_SU2_Restart_Metadata(geometry, config, true, filename); +// Read_SU2_Restart_Metadata(geometry, config, true, filename); } /*--- Define solver parameters needed for execution of destructor ---*/ @@ -1579,14 +1579,14 @@ void CAdjEulerSolver::SetIntBoundary_Jump(CGeometry *geometry, CSolver **solver_ } -void CAdjEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CAdjEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { unsigned long iPoint, Point_Fine; unsigned short iMesh, iChildren, iVar; su2double Area_Children, Area_Parent, *Solution, *Solution_Fine; bool restart = config->GetRestart(); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- If restart solution, then interpolate the flow solution to all the multigrid levels, this is important with the dual time strategy ---*/ @@ -1616,7 +1616,7 @@ void CAdjEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve /*--- The value of the solution for the first iteration of the dual time ---*/ for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { for (iPoint = 0; iPoint < geometry[iMesh]->GetnPoint(); iPoint++) { - if ((ExtIter == 0) && (dual_time)) { + if ((TimeIter == 0) && (dual_time)) { solver_container[iMesh][ADJFLOW_SOL]->node[iPoint]->Set_Solution_time_n(); solver_container[iMesh][ADJFLOW_SOL]->node[iPoint]->Set_Solution_time_n1(); } @@ -1887,7 +1887,7 @@ void CAdjEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont bool rotating_frame = config->GetRotating_Frame(); bool axisymmetric = config->GetAxisymmetric(); // bool gravity = (config->GetGravityForce() == YES); - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); /*--- Initialize the source residual to zero ---*/ for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; @@ -2887,12 +2887,12 @@ void CAdjEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_cont CConfig *config, unsigned short iMesh, bool Output) { unsigned long Iter_Fixed_CL = config->GetIter_Fixed_CL(); - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool Update_AoA = false; su2double dCL_dAlpha = config->GetdCL_dAlpha()*180.0/PI_NUMBER; unsigned long Update_Alpha = config->GetUpdate_Alpha(); - if (ExtIter == 0) AoA_Counter = 0; + if (InnerIter == 0) AoA_Counter = 0; /*--- Only the fine mesh level should check the convergence criteria ---*/ @@ -2905,7 +2905,7 @@ void CAdjEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_cont /*--- Reevaluate the lift derivative with respect to Angle of Attack at a fix number of iterations ---*/ - if ((ExtIter % Iter_Fixed_CL == 0) && (ExtIter != 0)) { + if ((InnerIter % Iter_Fixed_CL == 0) && (InnerIter != 0)) { AoA_Counter++; if ((AoA_Counter <= Update_Alpha)) Update_AoA = true; Update_AoA = true; @@ -2971,7 +2971,7 @@ void CAdjEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_cont /*--- Output some information to the console with the headers ---*/ - bool write_heads = ((ExtIter % Iter_Fixed_CL == 0) && (ExtIter != 0)); + bool write_heads = ((InnerIter % Iter_Fixed_CL == 0) && (InnerIter != 0)); if ((rank == MASTER_NODE) && (iMesh == MESH_0) && write_heads && Output) { cout.precision(7); cout.setf(ios::fixed, ios::floatfield); @@ -4720,9 +4720,9 @@ void CAdjEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver /*--- Compute Residual ---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = ( U_time_nP1[iVar]*Volume_nP1 - U_time_n[iVar]*Volume_n ) / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = ( 3.0*U_time_nP1[iVar]*Volume_nP1 - 4.0*U_time_n[iVar]*Volume_n + 1.0*U_time_nM1[iVar]*Volume_nM1 ) / (2.0*TimeStep); } @@ -4735,9 +4735,9 @@ void CAdjEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); } Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); @@ -4752,19 +4752,13 @@ void CAdjEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf unsigned short iDim, iVar, iMesh; unsigned long iPoint, index, iChildren, Point_Fine; su2double Area_Children, Area_Parent, *Coord, *Solution_Fine; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; - string UnstExt, text_line, filename, restart_filename; - ifstream restart_file; - - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); + string filename, restart_filename; /*--- Restart the solution from file information ---*/ filename = config->GetSolution_AdjFileName(); restart_filename = config->GetObjFunc_Extension(filename); + restart_filename = config->GetFilename(restart_filename, "", val_iter); Coord = new su2double [nDim]; for (iDim = 0; iDim < nDim; iDim++) @@ -4774,16 +4768,6 @@ void CAdjEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf unsigned short skipVars = geometry[MESH_0]->GetnDim(); - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - restart_filename = config->GetMultizone_FileName(restart_filename, iZone); - - /*--- Modify file name for an unsteady restart ---*/ - - if (dual_time || time_stepping) - restart_filename = config->GetUnsteady_FileName(restart_filename, val_iter); - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ if (config->GetRead_Binary_Restart()) { @@ -5081,7 +5065,7 @@ CAdjNSSolver::CAdjNSSolver(CGeometry *geometry, CConfig *config, unsigned short if (restart && (iMesh == MESH_0)) { mesh_filename = config->GetSolution_AdjFileName(); filename = config->GetObjFunc_Extension(mesh_filename); - Read_SU2_Restart_Metadata(geometry, config, true, filename); +// Read_SU2_Restart_Metadata(geometry, config, true, filename); } /*--- Calculate area monitored for area-averaged-outflow-quantity-based objectives ---*/ diff --git a/SU2_CFD/src/solver_direct_elasticity.cpp b/SU2_CFD/src/solver_direct_elasticity.cpp index 16807bbdbe13..ad51b191021c 100644 --- a/SU2_CFD/src/solver_direct_elasticity.cpp +++ b/SU2_CFD/src/solver_direct_elasticity.cpp @@ -39,6 +39,7 @@ #include "../include/variables/CFEAFSIBoundVariable.hpp" #include "../include/variables/CFEABoundVariable.hpp" #include "../include/variables/CFEAVariable.hpp" +#include "../../Common/include/toolboxes/printing_toolbox.hpp" #include CFEASolver::CFEASolver(bool mesh_deform_mode) : CSolver(mesh_deform_mode) { @@ -58,6 +59,11 @@ CFEASolver::CFEASolver(bool mesh_deform_mode) : CSolver(mesh_deform_mode) { loadIncrement = 1.0; element_container = NULL; + unsigned short iTerm; + element_container = new CElement** [MAX_TERMS](); + for (iTerm = 0; iTerm < MAX_TERMS; iTerm++) + element_container[iTerm] = new CElement* [MAX_FE_KINDS](); + node = NULL; element_properties = NULL; @@ -95,15 +101,17 @@ CFEASolver::CFEASolver(bool mesh_deform_mode) : CSolver(mesh_deform_mode) { iElem_iDe = NULL; topol_filter_applied = false; + + element_based = false; } CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CSolver() { unsigned long iPoint; unsigned short iVar, jVar, iDim, jDim; - unsigned short iTerm, iKind; + unsigned short iTerm; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool dynamic = (config->GetTime_Domain()); // Dynamic simulations. bool nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. bool gen_alpha = (config->GetKind_TimeIntScheme_FEA() == GENERALIZED_ALPHA); // Generalized alpha method requires residual at previous time step. @@ -128,15 +136,10 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CSolver() { /*--- Here is where we assign the kind of each element ---*/ /*--- First level: different possible terms of the equations ---*/ - element_container = new CElement** [MAX_TERMS]; + element_container = new CElement** [MAX_TERMS](); for (iTerm = 0; iTerm < MAX_TERMS; iTerm++) - element_container[iTerm] = new CElement* [MAX_FE_KINDS]; + element_container[iTerm] = new CElement* [MAX_FE_KINDS](); - for (iTerm = 0; iTerm < MAX_TERMS; iTerm++) { - for (iKind = 0; iKind < MAX_FE_KINDS; iKind++) { - element_container[iTerm][iKind] = NULL; - } - } if (nDim == 2) { @@ -430,8 +433,8 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CSolver() { RelaxCoeff = 1.0; ForceCoeff = 1.0; - Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 0.0; - Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 0.0; + Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 1.0; + Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 1.0; /*--- Define some structures for locating max residuals ---*/ @@ -461,6 +464,8 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CSolver() { CompleteComms(geometry, config, SOLUTION_FEA_OLD); } + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "FEA"; } CFEASolver::~CFEASolver(void) { @@ -485,11 +490,11 @@ CFEASolver::~CFEASolver(void) { } for (iVar = 0; iVar < nVar; iVar++) { - if (Jacobian_s_ij != NULL) delete [] Jacobian_s_ij[iVar]; + if (Jacobian_s_ij!= NULL) delete [] Jacobian_s_ij[iVar]; if (Jacobian_c_ij != NULL) delete [] Jacobian_c_ij[iVar]; - delete [] mZeros_Aux[iVar]; - delete [] mId_Aux[iVar]; - delete [] stressTensor[iVar]; + if (mZeros_Aux != NULL) delete [] mZeros_Aux[iVar]; + if (mId_Aux != NULL) delete [] mId_Aux[iVar]; + if (stressTensor!= NULL) delete [] stressTensor[iVar]; } if (Jacobian_s_ij != NULL) delete [] Jacobian_s_ij; @@ -502,15 +507,22 @@ CFEASolver::~CFEASolver(void) { delete [] GradN_X; delete [] GradN_x; - delete [] mZeros_Aux; - delete [] mId_Aux; + if (mZeros_Aux != NULL) delete [] mZeros_Aux; + if (mId_Aux != NULL) delete [] mId_Aux; delete [] nodeReactions; delete [] normalVertex; - delete [] stressTensor; + if (stressTensor != NULL) delete [] stressTensor; + + if (solutionPredictor != NULL) delete [] solutionPredictor; if (iElem_iDe != NULL) delete [] iElem_iDe; + + delete [] elProperties; + + if (Res_FSI_Cont != NULL) delete [] Res_FSI_Cont; + } void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { @@ -534,7 +546,7 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { /*--- If multizone, append zone name ---*/ if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); + filename = config->GetMultizone_FileName(filename, iZone, ".dat"); if (rank == MASTER_NODE) cout << "Filename: " << filename << "." << endl; @@ -672,7 +684,7 @@ void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { /*--- If multizone, append zone name ---*/ if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); + filename = config->GetMultizone_FileName(filename, iZone, ".dat"); if (rank == MASTER_NODE) cout << "Filename: " << filename << "." << endl; @@ -829,15 +841,12 @@ void CFEASolver::Set_Prestretch(CGeometry *geometry, CConfig *config) { void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { unsigned long iPoint; - unsigned long index; unsigned short iVar; unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry->GetnZone(); unsigned short file_format = config->GetRefGeom_FileFormat(); string filename; - su2double dull_val; ifstream reference_file; @@ -846,8 +855,8 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { filename = config->GetRefGeom_FEMFileName(); /*--- If multizone, append zone name ---*/ - if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); + + filename = config->GetMultizone_FileName(filename, iZone, ".csv"); reference_file.open(filename.data(), ios::in); @@ -885,7 +894,8 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { getline (reference_file, text_line); while (getline (reference_file, text_line)) { - istringstream point_line(text_line); + + vector point_line = PrintingToolbox::split(text_line, ','); /*--- Retrieve local index. If this node from the restart file lives on a different processor, the value of iPoint_Local will be -1. @@ -895,9 +905,15 @@ void CFEASolver::Set_ReferenceGeometry(CGeometry *geometry, CConfig *config) { iPoint_Local = Global2Local[iPoint_Global]; if (iPoint_Local >= 0) { - - if (nDim == 2) point_line >> index >> dull_val >> dull_val >> Solution[0] >> Solution[1]; - if (nDim == 3) point_line >> index >> dull_val >> dull_val >> dull_val >> Solution[0] >> Solution[1] >> Solution[2]; + + if (nDim == 2){ + Solution[0] = PrintingToolbox::stod(point_line[3]); + Solution[1] = PrintingToolbox::stod(point_line[4]); + } else { + Solution[0] = PrintingToolbox::stod(point_line[4]); + Solution[1] = PrintingToolbox::stod(point_line[5]); + Solution[2] = PrintingToolbox::stod(point_line[6]); + } for (iVar = 0; iVar < nVar; iVar++) node[iPoint_Local]->SetReference_Geometry(iVar, Solution[iVar]); @@ -939,14 +955,14 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, unsigned long iPoint; - bool initial_calc = (config->GetExtIter() == 0); // Checks if it is the first calculation. - bool first_iter = (config->GetIntIter() == 0); // Checks if it is the first iteration - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool initial_calc = (config->GetTimeIter() == 0) && (config->GetInnerIter() == 0); // Checks if it is the first calculation. + bool first_iter = (config->GetInnerIter() == 0); // Checks if it is the first iteration + bool dynamic = (config->GetTime_Domain()); // Dynamic simulations. bool linear_analysis = (config->GetGeometricConditions() == SMALL_DEFORMATIONS); // Linear analysis. bool nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA() == NEWTON_RAPHSON); // Newton-Raphson method bool restart = config->GetRestart(); // Restart analysis - bool initial_calc_restart = (SU2_TYPE::Int(config->GetExtIter()) == config->GetDyn_RestartIter()); // Initial calculation for restart + bool initial_calc_restart = (SU2_TYPE::Int(config->GetTimeIter()) ==SU2_TYPE::Int(config->GetRestart_Iter())); // Initial calculation for restart bool disc_adj_fem = (config->GetKind_Solver() == DISC_ADJ_FEM); // Discrete adjoint FEM solver @@ -1094,7 +1110,7 @@ void CFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, void CFEASolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned long Iteration) { } -void CFEASolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CFEASolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { unsigned long iPoint, nPoint; bool incremental_load = config->GetIncrementalLoad(); // If an incremental load is applied @@ -1110,7 +1126,7 @@ void CFEASolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_con } -void CFEASolver::ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CFEASolver::ResetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { unsigned long iPoint, nPoint; bool incremental_load = config->GetIncrementalLoad(); // If an incremental load is applied @@ -1580,7 +1596,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, bool prestretch_fem = config->GetPrestretch(); - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); bool topology_mode = config->GetTopology_Optimization(); su2double simp_exponent = config->GetSIMP_Exponent(); @@ -1979,7 +1995,7 @@ void CFEASolver::BC_Clamped(CGeometry *geometry, CNumerics *numerics, CConfig *c unsigned long iPoint, iVertex; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); Solution[0] = 0.0; Solution[1] = 0.0; @@ -2015,7 +2031,7 @@ void CFEASolver::BC_Clamped(CGeometry *geometry, CNumerics *numerics, CConfig *c void CFEASolver::BC_Clamped_Post(CGeometry *geometry, CNumerics *numerics, CConfig *config, unsigned short val_marker) { unsigned long iPoint, iVertex; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { @@ -2124,12 +2140,9 @@ void CFEASolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, unsigned short iVar; unsigned long iPoint, total_index; - bool first_iter = (config->GetIntIter() == 0); bool nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. bool disc_adj_fem = (config->GetKind_Solver() == DISC_ADJ_FEM); - - su2double solNorm = 0.0, solNorm_recv = 0.0; - + if (disc_adj_fem) { if (nonlinear_analysis) { @@ -2198,69 +2211,6 @@ void CFEASolver::Postprocessing(CGeometry *geometry, CSolver **solver_container, else { if (nonlinear_analysis){ - /*--- If the problem is nonlinear, we have 3 convergence criteria ---*/ - - /*--- UTOL = norm(Delta_U(k)) / norm(U(k)) --------------------------*/ - /*--- RTOL = norm(Residual(k)) / norm(Residual(0)) ------------------*/ - /*--- ETOL = Delta_U(k) * Residual(k) / Delta_U(0) * Residual(0) ----*/ - - if (first_iter){ - Conv_Ref[0] = 1.0; // Position for the norm of the solution - Conv_Ref[1] = max(LinSysRes.norm(), EPS); // Position for the norm of the residual - Conv_Ref[2] = max(dotProd(LinSysSol, LinSysRes), EPS); // Position for the energy tolerance - - /*--- Make sure the computation runs at least 2 iterations ---*/ - Conv_Check[0] = 1.0; - Conv_Check[1] = 1.0; - Conv_Check[2] = 1.0; - - /*--- If absolute, we check the norms ---*/ - switch (config->GetResidual_Criteria_FEM()) { - case RESFEM_ABSOLUTE: - Conv_Check[0] = LinSysSol.norm(); // Norm of the delta-solution vector - Conv_Check[1] = LinSysRes.norm(); // Norm of the residual - Conv_Check[2] = dotProd(LinSysSol, LinSysRes); // Position for the energy tolerance - break; - } - } - else { - /*--- Compute the norm of the solution vector Uk ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - for (iVar = 0; iVar < nVar; iVar++){ - solNorm += node[iPoint]->GetSolution(iVar) * node[iPoint]->GetSolution(iVar); - } - } - - // We need to communicate the norm of the solution and compute the RMS throughout the different processors - -#ifdef HAVE_MPI - /*--- We sum the squares of the norms across the different processors ---*/ - SU2_MPI::Allreduce(&solNorm, &solNorm_recv, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); -#else - solNorm_recv = solNorm; -#endif - - Conv_Ref[0] = max(sqrt(solNorm_recv), EPS); // Norm of the solution vector - - switch (config->GetResidual_Criteria_FEM()) { - case RESFEM_RELATIVE: - Conv_Check[0] = LinSysSol.norm() / Conv_Ref[0]; // Norm of the delta-solution vector - Conv_Check[1] = LinSysRes.norm() / Conv_Ref[1]; // Norm of the residual - Conv_Check[2] = dotProd(LinSysSol, LinSysRes) / Conv_Ref[2]; // Position for the energy tolerance - break; - case RESFEM_ABSOLUTE: - Conv_Check[0] = LinSysSol.norm(); // Norm of the delta-solution vector - Conv_Check[1] = LinSysRes.norm(); // Norm of the residual - Conv_Check[2] = dotProd(LinSysSol, LinSysRes); // Position for the energy tolerance - break; - default: - Conv_Check[0] = LinSysSol.norm() / Conv_Ref[0]; // Norm of the delta-solution vector - Conv_Check[1] = LinSysRes.norm() / Conv_Ref[1]; // Norm of the residual - Conv_Check[2] = dotProd(LinSysSol, LinSysRes) / Conv_Ref[2]; // Position for the energy tolerance - break; - } - - } /*--- MPI solution ---*/ @@ -3021,13 +2971,13 @@ su2double CFEASolver::Compute_LoadCoefficient(su2double CurrentTime, su2double R bool restart = config->GetRestart(); // Restart analysis bool fsi = (config->GetnMarker_Fluid_Load() > 0); // FSI simulation. - bool stat_fsi = (config->GetDynamic_Analysis() == STATIC); + bool stat_fsi = !config->GetTime_Domain(); /*--- This offset introduces the ramp load in dynamic cases starting from the restart point. ---*/ bool offset = (restart && fsi && (!stat_fsi)); su2double DeltaT = config->GetDelta_DynTime(); su2double OffsetTime = 0.0; - OffsetTime = DeltaT * (config->GetDyn_RestartIter()-1); + OffsetTime = DeltaT * (config->GetRestart_Iter()-1); /*--- Polynomial functions from https://en.wikipedia.org/wiki/Smoothstep ---*/ @@ -3095,8 +3045,8 @@ void CFEASolver::ImplicitNewmark_Iteration(CGeometry *geometry, CSolver **solver unsigned long iPoint, jPoint; unsigned short iVar, jVar; - bool first_iter = (config->GetIntIter() == 0); - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool first_iter = (config->GetInnerIter() == 0); + bool dynamic = (config->GetTime_Domain()); // Dynamic simulations. bool linear_analysis = (config->GetGeometricConditions() == SMALL_DEFORMATIONS); // Linear analysis. bool nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA() == NEWTON_RAPHSON); // Newton-Raphson method @@ -3263,7 +3213,7 @@ void CFEASolver::ImplicitNewmark_Update(CGeometry *geometry, CSolver **solver_co unsigned short iVar; unsigned long iPoint; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool dynamic = (config->GetTime_Domain()); // Dynamic simulations. /*--- Update solution ---*/ @@ -3329,7 +3279,7 @@ void CFEASolver::ImplicitNewmark_Relaxation(CGeometry *geometry, CSolver **solve unsigned short iVar; unsigned long iPoint; su2double *valSolutionPred; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); /*--- Update solution and set it to be the solution after applying relaxation---*/ @@ -3403,8 +3353,8 @@ void CFEASolver::GeneralizedAlpha_Iteration(CGeometry *geometry, CSolver **solve unsigned long iPoint, jPoint; unsigned short iVar, jVar; - bool first_iter = (config->GetIntIter() == 0); - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); // Dynamic simulations. + bool first_iter = (config->GetInnerIter() == 0); + bool dynamic = (config->GetTime_Domain()); // Dynamic simulations. bool linear_analysis = (config->GetGeometricConditions() == SMALL_DEFORMATIONS); // Linear analysis. bool nonlinear_analysis = (config->GetGeometricConditions() == LARGE_DEFORMATIONS); // Nonlinear analysis. bool newton_raphson = (config->GetKind_SpaceIteScheme_FEA() == NEWTON_RAPHSON); // Newton-Raphson method @@ -3746,49 +3696,29 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry **fea_geometry, CConfig *fe su2double *dispPred, *dispCalc, *dispPred_Old, *dispCalc_Old; su2double deltaU[3] = {0.0, 0.0, 0.0}, deltaU_p1[3] = {0.0, 0.0, 0.0}; su2double delta_deltaU[3] = {0.0, 0.0, 0.0}; - su2double CurrentTime=fea_config->GetCurrent_DynTime(); su2double WAitkDyn_tn1, WAitkDyn_Max, WAitkDyn_Min, WAitkDyn; unsigned short RelaxMethod_FSI = fea_config->GetRelaxation_Method_FSI(); - ofstream historyFile_FSI; - bool writeHistFSI = fea_config->GetWrite_Conv_FSI(); - if (writeHistFSI && (rank == MASTER_NODE)) { - char cstrFSI[200]; - string filenameHistFSI = fea_config->GetConv_FileName_FSI(); - strcpy (cstrFSI, filenameHistFSI.data()); - historyFile_FSI.open (cstrFSI, std::ios_base::app); - } - /*--- Only when there is movement, and a dynamic coefficient is requested, it makes sense to compute the Aitken's coefficient ---*/ if (RelaxMethod_FSI == NO_RELAXATION) { - if (writeHistFSI && (rank == MASTER_NODE)) { + if (rank == MASTER_NODE) { SetWAitken_Dyn(1.0); - if (iOuterIter == 0) historyFile_FSI << " " << endl ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(4) << CurrentTime << "," ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(1) << iOuterIter << "," ; - if (iOuterIter == 0) historyFile_FSI << setiosflags(ios::scientific) << setprecision(4) << 1.0 ; - else historyFile_FSI << setiosflags(ios::scientific) << setprecision(4) << 1.0 << "," ; } } else if (RelaxMethod_FSI == FIXED_PARAMETER) { - if (writeHistFSI && (rank == MASTER_NODE)) { + if (rank == MASTER_NODE) { SetWAitken_Dyn(fea_config->GetAitkenStatRelax()); - if (iOuterIter == 0) historyFile_FSI << " " << endl ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(4) << CurrentTime << "," ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(1) << iOuterIter << "," ; - if (iOuterIter == 0) historyFile_FSI << setiosflags(ios::scientific) << setprecision(4) << fea_config->GetAitkenStatRelax() ; - else historyFile_FSI << setiosflags(ios::scientific) << setprecision(4) << fea_config->GetAitkenStatRelax() << "," ; } } @@ -3804,12 +3734,6 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry **fea_geometry, CConfig *fe WAitkDyn = max(WAitkDyn, WAitkDyn_Min); SetWAitken_Dyn(WAitkDyn); - if (writeHistFSI && (rank == MASTER_NODE)) { - if (iOuterIter == 0) historyFile_FSI << " " << endl ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(4) << CurrentTime << "," ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(1) << iOuterIter << "," ; - historyFile_FSI << setiosflags(ios::scientific) << setprecision(4) << WAitkDyn ; - } } else { @@ -3857,21 +3781,13 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry **fea_geometry, CConfig *fe SetWAitken_Dyn(WAitkDyn); - if (writeHistFSI && (rank == MASTER_NODE)) { - historyFile_FSI << setiosflags(ios::fixed) << setprecision(4) << CurrentTime << "," ; - historyFile_FSI << setiosflags(ios::fixed) << setprecision(1) << iOuterIter << "," ; - historyFile_FSI << setiosflags(ios::scientific) << setprecision(4) << WAitkDyn << "," ; - } - } } else { if (rank == MASTER_NODE) cout << "No relaxation method used. " << endl; } - - if (writeHistFSI && (rank == MASTER_NODE)) {historyFile_FSI.close();} - + } void CFEASolver::SetAitken_Relaxation(CGeometry **fea_geometry, @@ -3950,9 +3866,9 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, CSolver **solver_contain unsigned long iPoint; unsigned long nTotalPoint = 1; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); - unsigned long ExtIter = config->GetExtIter(); + unsigned long TimeIter = config->GetTimeIter(); su2double reference_geometry = 0.0, current_solution = 0.0; @@ -3996,7 +3912,7 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, CSolver **solver_contain Total_OFRefGeom = objective_function_reduce + PenaltyValue; Global_OFRefGeom += Total_OFRefGeom; - objective_function_averaged = Global_OFRefGeom / (ExtIter + 1.0 + EPS); + objective_function_averaged = Global_OFRefGeom / (TimeIter + 1.0 + EPS); bool direct_diff = ((config->GetDirectDiff() == D_YOUNG) || (config->GetDirectDiff() == D_POISSON) || @@ -4032,11 +3948,11 @@ void CFEASolver::Compute_OFRefGeom(CGeometry *geometry, CSolver **solver_contain if (fsi) { Total_ForwardGradient = local_forward_gradient; - averaged_gradient = Total_ForwardGradient / (ExtIter + 1.0); + averaged_gradient = Total_ForwardGradient / (TimeIter + 1.0); } else { Total_ForwardGradient += local_forward_gradient; - averaged_gradient = Total_ForwardGradient / (ExtIter + 1.0); + averaged_gradient = Total_ForwardGradient / (TimeIter + 1.0); } myfile_res << scientific << local_forward_gradient << "\t"; @@ -4085,9 +4001,9 @@ void CFEASolver::Compute_OFRefNode(CGeometry *geometry, CSolver **solver_contain unsigned short iVar; unsigned long iPoint; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); - unsigned long ExtIter = config->GetExtIter(); + unsigned long TimeIter = config->GetTimeIter(); su2double reference_geometry = 0.0, current_solution = 0.0; @@ -4143,7 +4059,7 @@ void CFEASolver::Compute_OFRefNode(CGeometry *geometry, CSolver **solver_contain Total_OFRefNode = objective_function_reduce + PenaltyValue; Global_OFRefNode += Total_OFRefNode; - objective_function_averaged = Global_OFRefNode / (ExtIter + 1.0 + EPS); + objective_function_averaged = Global_OFRefNode / (TimeIter + 1.0 + EPS); bool direct_diff = ((config->GetDirectDiff() == D_YOUNG) || (config->GetDirectDiff() == D_POISSON) || @@ -4179,11 +4095,11 @@ void CFEASolver::Compute_OFRefNode(CGeometry *geometry, CSolver **solver_contain if (fsi) { Total_ForwardGradient = local_forward_gradient; - averaged_gradient = Total_ForwardGradient / (ExtIter + 1.0); + averaged_gradient = Total_ForwardGradient / (TimeIter + 1.0); } else { Total_ForwardGradient += local_forward_gradient; - averaged_gradient = Total_ForwardGradient / (ExtIter + 1.0); + averaged_gradient = Total_ForwardGradient / (TimeIter + 1.0); } myfile_res << scientific << local_forward_gradient << "\t"; @@ -4221,7 +4137,7 @@ void CFEASolver::Compute_OFRefNode(CGeometry *geometry, CSolver **solver_contain ofstream myfile_his; myfile_his.open ("history_refnode.dat",ios::app); myfile_his.precision(15); - myfile_his << ExtIter << "\t"; + myfile_his << TimeIter << "\t"; myfile_his << scientific << Total_OFRefNode << "\t"; myfile_his << scientific << objective_function_averaged << "\t"; myfile_his << scientific << difX_reduce << "\t"; @@ -4424,46 +4340,6 @@ void CFEASolver::Stiffness_Penalty(CGeometry *geometry, CSolver **solver, CNumer -} - -void CFEASolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ - - unsigned short iVar; - unsigned long iPoint; - su2double residual; - - /*--- Set Residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++){ - SetRes_BGS(iVar,0.0); - SetRes_Max_BGS(iVar,0.0,0); - } - - /*--- Set the residuals ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - for (iVar = 0; iVar < nVar; iVar++){ - residual = node[iPoint]->GetSolution(iVar) - node[iPoint]->Get_BGSSolution_k(iVar); - AddRes_BGS(iVar,residual*residual); - AddRes_Max_BGS(iVar,fabs(residual),geometry->node[iPoint]->GetGlobalIndex(),geometry->node[iPoint]->GetCoord()); - } - } - - SetResidual_BGS(geometry, config); - -} - - -void CFEASolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config){ - - unsigned long iPoint; - - /*--- To nPoint: The solution must be communicated beforehand ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++){ - - node[iPoint]->Set_BGSSolution_k(); - - } - } void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *config, int val_iter, bool val_update_geo) { @@ -4471,13 +4347,9 @@ void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c unsigned short iVar, nSolVar; unsigned long index; - ifstream restart_file; - string restart_filename, filename, text_line; - - unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry[MESH_0]->GetnZone(); + string filename; - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic = (config->GetTime_Domain()); bool fluid_structure = (config->GetnMarker_Fluid_Load() > 0); bool discrete_adjoint = config->GetDiscrete_Adjoint(); @@ -4492,16 +4364,7 @@ void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c /*--- Restart the solution from file information ---*/ - filename = config->GetSolution_FEMFileName(); - - /*--- If multizone, append zone name ---*/ - - if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); - - if (dynamic) { - filename = config->GetUnsteady_FileName(filename, val_iter); - } + filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); /*--- Read all lines in the restart file ---*/ diff --git a/SU2_CFD/src/solver_direct_heat.cpp b/SU2_CFD/src/solver_direct_heat.cpp index 7cfad4f4d037..4a43ca0321aa 100644 --- a/SU2_CFD/src/solver_direct_heat.cpp +++ b/SU2_CFD/src/solver_direct_heat.cpp @@ -158,12 +158,12 @@ CHeatSolverFVM::CHeatSolverFVM(CGeometry *geometry, CConfig *config, unsigned sh Smatrix[iDim] = new su2double [nDim]; } - Heat_Flux = new su2double[nMarker]; + HeatFlux = new su2double*[nMarker]; AvgTemperature = new su2double[nMarker]; Surface_Areas = new su2double[config->GetnMarker_HeatFlux()]; for(iMarker = 0; iMarker < nMarker; iMarker++) { - Heat_Flux[iMarker] = 0.0; + HeatFlux[iMarker] = new su2double[geometry->GetnVertex(iMarker)]; AvgTemperature[iMarker] = 0.0; } for(iMarker = 0; iMarker < config->GetnMarker_HeatFlux(); iMarker++) { @@ -225,8 +225,8 @@ CHeatSolverFVM::CHeatSolverFVM(CGeometry *geometry, CConfig *config, unsigned sh if (multizone){ /*--- Initialize the BGS residuals. ---*/ - Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 0.0; - Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 0.0; + Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 1.0; + Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 1.0; /*--- Define some structures for locating max residuals ---*/ @@ -248,7 +248,9 @@ CHeatSolverFVM::CHeatSolverFVM(CGeometry *geometry, CConfig *config, unsigned sh InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); - + + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "HEAT"; } CHeatSolverFVM::~CHeatSolverFVM(void) { } @@ -293,17 +295,8 @@ void CHeatSolverFVM::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfi (config->GetKind_Solver() == DISC_ADJ_HEAT)); su2double Area_Children, Area_Parent, *Coord, *Solution_Fine; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; - - string UnstExt, text_line; - ifstream restart_file; - - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); - string restart_filename = config->GetSolution_FlowFileName(); + string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); Coord = new su2double [nDim]; for (iDim = 0; iDim < nDim; iDim++) @@ -337,16 +330,6 @@ void CHeatSolverFVM::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfi cout << "WARNING: Finite volume heat solver's restart routine could not load data." << endl; } - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - restart_filename = config->GetMultizone_FileName(restart_filename, iZone); - - /*--- Modify file name for an unsteady restart ---*/ - - if (dual_time || time_stepping) - restart_filename = config->GetUnsteady_FileName(restart_filename, val_iter); - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ if (config->GetRead_Binary_Restart()) { @@ -1221,8 +1204,6 @@ void CHeatSolverFVM::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container Marker_Tag = config->GetMarker_All_TagBound(iMarker); Monitoring = config->GetMarker_All_Monitoring(iMarker); - Heat_Flux[iMarker] = 0.0; - if ( Boundary == ISOTHERMAL ) { Twall = config->GetIsothermal_Temperature(Marker_Tag)/config->GetTemperature_Ref(); @@ -1257,7 +1238,11 @@ void CHeatSolverFVM::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container thermal_conductivity = config->GetThermalDiffusivity_Solid()*rho_cp_solid; } - Heat_Flux[iMarker] += thermal_conductivity*dTdn*config->GetTemperature_Ref()*Area; + HeatFlux[iMarker][iVertex] = thermal_conductivity*dTdn*config->GetTemperature_Ref()*Area; + + if (Monitoring){ + AllBound_HeatFlux += HeatFlux[iMarker][iVertex]; + } } } } @@ -1295,22 +1280,23 @@ void CHeatSolverFVM::Heat_Fluxes(CGeometry *geometry, CSolver **solver_container thermal_conductivity = config->GetThermalDiffusivity_Solid()*rho_cp_solid; } - Heat_Flux[iMarker] += thermal_conductivity*dTdn*config->GetTemperature_Ref()*Area; - + HeatFlux[iMarker][iVertex] = thermal_conductivity*dTdn*config->GetTemperature_Ref()*Area; + + if (Monitoring){ + AllBound_HeatFlux += HeatFlux[iMarker][iVertex]; + } + /*--- We do only aim to compute averaged temperatures on the (interesting) heat flux walls ---*/ if ( Boundary == HEAT_FLUX ) { AvgTemperature[iMarker] += Twall*config->GetTemperature_Ref()*Area; } - } } } if (Monitoring == YES) { - - AllBound_HeatFlux += Heat_Flux[iMarker]; - AllBound_AvgTemperature += AvgTemperature[iMarker]; + AllBound_AvgTemperature += AvgTemperature[iMarker]; } } @@ -1346,8 +1332,8 @@ void CHeatSolverFVM::SetTime_Step(CGeometry *geometry, CSolver **solver_containe || (config->GetKind_Solver() == DISC_ADJ_INC_RANS)); bool turb = ((config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS)); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); eddy_viscosity = 0.0; @@ -1513,7 +1499,7 @@ void CHeatSolverFVM::SetTime_Step(CGeometry *geometry, CSolver **solver_containe } /*--- For exact time solution use the minimum delta time of the whole mesh ---*/ - if (config->GetUnsteady_Simulation() == TIME_STEPPING) { + if (config->GetTime_Marching() == TIME_STEPPING) { #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; @@ -1690,20 +1676,20 @@ void CHeatSolverFVM::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solv } -void CHeatSolverFVM::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CHeatSolverFVM::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { unsigned long iPoint, Point_Fine; unsigned short iMesh, iChildren, iVar; su2double Area_Children, Area_Parent, *Solution_Fine, *Solution; bool restart = (config->GetRestart() || config->GetRestart_Flow()); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- If restart solution, then interpolate the flow solution to all the multigrid levels, this is important with the dual time strategy ---*/ - if (restart && (ExtIter == 0)) { + if (restart && (TimeIter == 0)) { Solution = new su2double[nVar]; for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { @@ -1728,7 +1714,7 @@ void CHeatSolverFVM::SetInitialCondition(CGeometry **geometry, CSolver ***solver /*--- The value of the solution for the first iteration of the dual time ---*/ - if (dual_time && (ExtIter == 0 || (restart && (long)ExtIter == config->GetUnst_RestartIter()))) { + if (dual_time && (TimeIter == 0 || (restart && (long)TimeIter == (long)config->GetRestart_Iter()))) { /*--- Push back the initial condition to previous solution containers for a 1st-order restart or when simply intitializing to freestream. ---*/ @@ -1740,12 +1726,12 @@ void CHeatSolverFVM::SetInitialCondition(CGeometry **geometry, CSolver ***solver } } - if ((restart && (long)ExtIter == config->GetUnst_RestartIter()) && - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((restart && (long)TimeIter == (long)config->GetRestart_Iter()) && + (config->GetTime_Marching() == DT_STEPPING_2ND)) { /*--- Load an additional restart file for a 2nd-order restart ---*/ - solver_container[MESH_0][HEAT_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetUnst_RestartIter()-1), true); + solver_container[MESH_0][HEAT_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), true); /*--- Push back this new solution to time level N. ---*/ @@ -1800,9 +1786,9 @@ void CHeatSolverFVM::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_ time discretization scheme (1st- or 2nd-order).---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); } @@ -1814,9 +1800,9 @@ void CHeatSolverFVM::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_ if (implicit) { for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); } @@ -1826,28 +1812,4 @@ void CHeatSolverFVM::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_ } } -void CHeatSolverFVM::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ - - unsigned short iVar; - unsigned long iPoint; - su2double residual; - - /*--- Set Residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++){ - SetRes_BGS(iVar,0.0); - SetRes_Max_BGS(iVar,0.0,0); - } - - /*--- Set the residuals ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - for (iVar = 0; iVar < nVar; iVar++){ - residual = node[iPoint]->GetSolution(iVar) - node[iPoint]->Get_BGSSolution_k(iVar); - AddRes_BGS(iVar,residual*residual); - AddRes_Max_BGS(iVar,fabs(residual),geometry->node[iPoint]->GetGlobalIndex(),geometry->node[iPoint]->GetCoord()); - } - } - - SetResidual_BGS(geometry, config); -} diff --git a/SU2_CFD/src/solver_direct_mean.cpp b/SU2_CFD/src/solver_direct_mean.cpp index 5ac515b4373b..1550fa70ef96 100644 --- a/SU2_CFD/src/solver_direct_mean.cpp +++ b/SU2_CFD/src/solver_direct_mean.cpp @@ -179,11 +179,10 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short bool roe_turkel = (config->GetKind_Upwind_Flow() == TURKEL); bool rans = (config->GetKind_Turb_Model() != NONE); unsigned short direct_diff = config->GetDirectDiff(); - int Unst_RestartIter; - unsigned short iZone = config->GetiZone(); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + int Unst_RestartIter = 0; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -193,7 +192,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); bool fsi = config->GetFSI_Simulation(); bool multizone = config->GetMultizone_Problem(); - string filename_ = config->GetSolution_FlowFileName(); + string filename_ = "flow"; /*--- Store the multigrid level. ---*/ MGLevel = iMesh; @@ -203,27 +202,23 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short if (!(!restart || (iMesh != MESH_0) || nZone > 1)) { - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) filename_ = config->GetMultizone_FileName(filename_, iZone); - /*--- Modify file name for a dual-time unsteady restart ---*/ if (dual_time) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else if (config->GetTime_Marching() == DT_STEPPING_1ST) + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } /*--- Modify file name for a time stepping unsteady restart ---*/ if (time_stepping) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; } + + filename_ = config->GetFilename(filename_, ".meta", Unst_RestartIter); /*--- Read and store the restart metadata. ---*/ @@ -850,8 +845,8 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short /*--- Initialize the BGS residuals in FSI problems. ---*/ if (fsi || multizone){ - Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 0.0; - Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 0.0; + Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 1.0; + Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 1.0; /*--- Define some structures for locating max residuals ---*/ @@ -903,6 +898,8 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "C.FLOW"; } CEulerSolver::~CEulerSolver(void) { @@ -2237,7 +2234,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes su2double Beta = config->GetAoS()*PI_NUMBER/180.0; su2double Mach = config->GetMach(); su2double Reynolds = config->GetReynolds(); - bool unsteady = (config->GetUnsteady_Simulation() != NO); + bool unsteady = (config->GetTime_Marching() != NO); bool viscous = config->GetViscous(); bool gravity = config->GetGravityForce(); bool turbulent = (config->GetKind_Turb_Model() != NONE); @@ -2712,13 +2709,13 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes else if (config->GetSystemMeasurements() == US) Unit << "ft/s"; NonDimTable << "Velocity-X" << config->GetVelocity_FreeStream()[0] << config->GetVelocity_Ref() << Unit.str() << config->GetVelocity_FreeStreamND()[0]; NonDimTable << "Velocity-Y" << config->GetVelocity_FreeStream()[1] << config->GetVelocity_Ref() << Unit.str() << config->GetVelocity_FreeStreamND()[1]; - if (nDim == 3) { + if (nDim == 3){ NonDimTable << "Velocity-Z" << config->GetVelocity_FreeStream()[2] << config->GetVelocity_Ref() << Unit.str() << config->GetVelocity_FreeStreamND()[2]; } NonDimTable << "Velocity Magnitude" << config->GetModVel_FreeStream() << config->GetVelocity_Ref() << Unit.str() << config->GetModVel_FreeStreamND(); Unit.str(""); - - if (viscous) { + + if (viscous){ NonDimTable.PrintFooter(); if (config->GetSystemMeasurements() == SI) Unit << "N.s/m^2"; else if (config->GetSystemMeasurements() == US) Unit << "lbf.s/ft^2"; @@ -2728,7 +2725,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes else if (config->GetSystemMeasurements() == US) Unit << "lbf/ft.s.R"; NonDimTable << "Conductivity" << "-" << config->GetConductivity_Ref() << Unit.str() << "-"; Unit.str(""); - if (turbulent) { + if (turbulent){ if (config->GetSystemMeasurements() == SI) Unit << "m^2/s^2"; else if (config->GetSystemMeasurements() == US) Unit << "ft^2/s^2"; NonDimTable << "Turb. Kin. Energy" << config->GetTke_FreeStream() << config->GetTke_FreeStream()/config->GetTke_FreeStreamND() << Unit.str() << config->GetTke_FreeStreamND(); @@ -2742,7 +2739,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes NonDimTable.PrintFooter(); NonDimTable << "Mach Number" << "-" << "-" << "-" << config->GetMach(); - if (viscous) { + if (viscous){ NonDimTable << "Reynolds Number" << "-" << "-" << "-" << config->GetReynolds(); } if (gravity) { @@ -2755,9 +2752,9 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes if (unsteady){ NonDimTableOut << "-- Unsteady conditions" << endl; NonDimTable.PrintHeader(); - NonDimTable << "Total Time" << config->GetTotal_UnstTime() << config->GetTime_Ref() << "s" << config->GetTotal_UnstTimeND(); + NonDimTable << "Total Time" << config->GetMax_Time() << config->GetTime_Ref() << "s" << config->GetMax_Time()/config->GetTime_Ref(); Unit.str(""); - NonDimTable << "Time Step" << config->GetDelta_UnstTime() << config->GetTime_Ref() << "s" << config->GetDelta_UnstTimeND(); + NonDimTable << "Time Step" << config->GetTime_Step() << config->GetTime_Ref() << "s" << config->GetDelta_UnstTimeND(); Unit.str(""); NonDimTable.PrintFooter(); } @@ -2769,7 +2766,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes } -void CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { unsigned long iPoint; unsigned short iMesh, iDim; @@ -2780,12 +2777,12 @@ void CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_c unsigned short nDim = geometry[MESH_0]->GetnDim(); bool restart = (config->GetRestart() || config->GetRestart_Flow()); bool rans = (config->GetKind_Turb_Model() != NONE); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool SubsonicEngine = config->GetSubsonicEngine(); /*--- Check if a verification solution is to be computed. ---*/ - if ((VerificationSolution) && (ExtIter == 0) && !restart) { + if ((VerificationSolution) && (TimeIter == 0) && !restart) { /*--- Loop over the multigrid levels. ---*/ for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { @@ -2812,7 +2809,7 @@ void CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_c /*--- Set initial boundary condition at iteration 0 ---*/ - if ((ExtIter == 0) && (!restart)) { + if ((TimeIter == 0) && (!restart)) { su2double Velocity_Cyl[3] = {0.0, 0.0, 0.0}, Velocity_CylND[3] = {0.0, 0.0, 0.0}, Viscosity_Cyl, Density_Cyl, Density_CylND, Pressure_CylND, ModVel_Cyl, ModVel_CylND, Energy_CylND, @@ -2937,7 +2934,7 @@ void CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_c /*--- Make sure that the solution is well initialized for unsteady calculations with dual time-stepping (load additional restarts for 2nd-order). ---*/ - if (dual_time && (ExtIter == 0 || (restart && (long)ExtIter == config->GetUnst_RestartIter()))) { + if (dual_time && (TimeIter == 0 || (restart && (long)TimeIter == (long)config->GetRestart_Iter()))) { /*--- Push back the initial condition to previous solution containers for a 1st-order restart or when simply intitializing to freestream. ---*/ @@ -2953,16 +2950,16 @@ void CEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_c } } - if ((restart && (long)ExtIter == config->GetUnst_RestartIter()) && - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((restart && (long)TimeIter == (long)config->GetRestart_Iter()) && + (config->GetTime_Marching() == DT_STEPPING_2ND)) { /*--- Load an additional restart file for a 2nd-order restart ---*/ - solver_container[MESH_0][FLOW_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetUnst_RestartIter()-1), true); + solver_container[MESH_0][FLOW_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), true); /*--- Load an additional restart file for the turbulence model ---*/ if (rans) - solver_container[MESH_0][TURB_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetUnst_RestartIter()-1), false); + solver_container[MESH_0][TURB_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), false); /*--- Push back this new solution to time level N. ---*/ @@ -2983,12 +2980,12 @@ void CEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container unsigned long ErrorCounter = 0; - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool cont_adjoint = config->GetContinuous_Adjoint(); bool disc_adjoint = config->GetDiscrete_Adjoint(); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool muscl = (config->GetMUSCL_Flow() || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == ROE)); - bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); + bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED); bool center_jst = center && (config->GetKind_Centered_Flow() == JST); bool engine = ((config->GetnMarker_EngineInflow() != 0) || (config->GetnMarker_EngineExhaust() != 0)); @@ -3121,9 +3118,9 @@ void CEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, unsigned short iDim, iMarker; bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool time_steping = config->GetUnsteady_Simulation() == TIME_STEPPING; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool time_steping = config->GetTime_Marching() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); Min_Delta_Time = 1.E6; Max_Delta_Time = 0.0; @@ -3367,10 +3364,10 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain bool neg_density_i = false, neg_density_j = false, neg_pressure_i = false, neg_pressure_j = false, neg_sound_speed = false; - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); - bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); + bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); bool roe_turkel = (config->GetKind_Upwind_Flow() == TURKEL); bool ideal_gas = (config->GetKind_FluidModel() == STANDARD_AIR || config->GetKind_FluidModel() == IDEAL_GAS ); bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; @@ -3649,7 +3646,7 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain bool rotating_frame = config->GetRotating_Frame(); bool axisymmetric = config->GetAxisymmetric(); bool gravity = (config->GetGravityForce() == YES); - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); bool windgust = config->GetWind_Gust(); bool body_force = config->GetBody_Force(); @@ -3819,7 +3816,7 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over points ---*/ for (iPoint = 0; iPoint < nPointDomain; iPoint++) { @@ -5191,6 +5188,10 @@ void CEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **solver SetIterLinSolver(IterLinSol); + /*--- Set the residual --- */ + + valResidual = System.GetResidual(); + /*--- Update solution (system written in terms of increments) ---*/ if (!adjoint) { @@ -5357,12 +5358,19 @@ void CEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config node[iPoint]->SetRmatrixZero(); node[iPoint]->SetGradient_PrimitiveZero(nPrimVarGrad); + AD::StartPreacc(); + AD::SetPreaccIn(PrimVar_i, nPrimVarGrad); + AD::SetPreaccIn(Coord_i, nDim); + for (iNeigh = 0; iNeigh < geometry->node[iPoint]->GetnPoint(); iNeigh++) { jPoint = geometry->node[iPoint]->GetPoint(iNeigh); Coord_j = geometry->node[jPoint]->GetCoord(); PrimVar_j = node[jPoint]->GetPrimitive(); - + + AD::SetPreaccIn(Coord_j, nDim); + AD::SetPreaccIn(PrimVar_j, nPrimVarGrad); + weight = 0.0; for (iDim = 0; iDim < nDim; iDim++) weight += (Coord_j[iDim]-Coord_i[iDim])*(Coord_j[iDim]-Coord_i[iDim]); @@ -5389,9 +5397,11 @@ void CEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config node[iPoint]->AddGradient_Primitive(iVar,iDim, (Coord_j[iDim]-Coord_i[iDim])*(PrimVar_j[iVar]-PrimVar_i[iVar])/weight); } } - } } + AD::SetPreaccOut(node[iPoint]->GetRmatrix(), nDim, nDim); + AD::SetPreaccOut(node[iPoint]->GetGradient_Primitive(), nPrimVarGrad, nDim); + AD::EndPreacc(); } /*--- Correct the gradient values across any periodic boundaries. ---*/ @@ -5418,6 +5428,11 @@ void CEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config r12 = node[iPoint]->GetRmatrix(0,1); r22 = node[iPoint]->GetRmatrix(1,1); + AD::StartPreacc(); + AD::SetPreaccIn(r11); + AD::SetPreaccIn(r12); + AD::SetPreaccIn(r22); + if (r11 >= 0.0) r11 = sqrt(r11); else r11 = 0.0; if (r11 != 0.0) r12 = r12/r11; else r12 = 0.0; if (r22-r12*r12 >= 0.0) r22 = sqrt(r22-r12*r12); else r22 = 0.0; @@ -5427,6 +5442,11 @@ void CEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config r23_a = node[iPoint]->GetRmatrix(1,2); r23_b = node[iPoint]->GetRmatrix(2,1); r33 = node[iPoint]->GetRmatrix(2,2); + + AD::SetPreaccIn(r13); + AD::SetPreaccIn(r23_a); + AD::SetPreaccIn(r23_b); + AD::SetPreaccIn(r33); if (r11 != 0.0) r13 = r13/r11; else r13 = 0.0; if ((r22 != 0.0) && (r11*r22 != 0.0)) r23 = r23_a/r22 - r23_b*r12/(r11*r22); else r23 = 0.0; @@ -5471,6 +5491,9 @@ void CEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *config } } + AD::SetPreaccOut(Smatrix, nDim, nDim); + AD::EndPreacc(); + /*--- Computation of the gradient: S*c ---*/ for (iVar = 0; iVar < nPrimVarGrad; iVar++) { for (iDim = 0; iDim < nDim; iDim++) { @@ -5862,10 +5885,10 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns su2double Cp = Gas_Constant*Gamma / (Gamma-1.0); su2double Alpha = config->GetAoA()*PI_NUMBER/180.0; su2double Beta = config->GetAoS()*PI_NUMBER/180.0; - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) && (config->GetExtIter()!= 0)) - || (config->GetExtIter() == 1)); - bool Evaluate_BC = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0)) - || (config->GetExtIter() == 1) || (config->GetDiscrete_Adjoint())); + bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*40)) == 0) && (config->GetInnerIter()!= 0)) + || (config->GetInnerIter() == 1)); + bool Evaluate_BC = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*40)) == 0)) + || (config->GetInnerIter() == 1) || (config->GetDiscrete_Adjoint())); if ((config->GetnMarker_EngineInflow() != 0) || (config->GetnMarker_EngineExhaust() != 0)) Engine = true; if ((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) Engine = false; @@ -6871,7 +6894,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con bool ratio = (config->GetActDisk_Jump() == RATIO); unsigned long Update_BCThrust = config->GetUpdate_BCThrust(); unsigned long Iter_Fixed_NetThrust = config->GetIter_Fixed_NetThrust(); - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool Update_BCThrust_Bool = false; bool restart = (config->GetRestart() || config->GetRestart_Flow()); su2double Fan_Poly_Eff = config->GetFan_Poly_Eff(); @@ -6931,7 +6954,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con else { - if (ExtIter == 0) BCThrust_Counter = 0; + if (InnerIter == 0) BCThrust_Counter = 0; /*--- Only the fine mesh level should check the convergence criteria ---*/ @@ -6943,7 +6966,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con /*--- Reevaluate BCThrust at a fix number of iterations ---*/ - if ((ExtIter % Iter_Fixed_NetThrust == 0) && (ExtIter != 0)) { + if ((InnerIter % Iter_Fixed_NetThrust == 0) && (InnerIter != 0)) { BCThrust_Counter++; if ((BCThrust_Counter != 0) && (BCThrust_Counter != 1) && @@ -6967,7 +6990,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con /*--- If it is the first iteration, set the BCThrust to a meaning full target value, * this can be done at an initialization level, for the time being it is OK here ---*/ - if (ExtIter == 0) { + if (InnerIter == 0) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) || (config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) { @@ -7152,7 +7175,7 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con /*--- Evaluate the pressure jump at each node using the total thrust ---*/ - if ((Update_BCThrust_Bool && Output) || (ExtIter == 0)) { + if ((Update_BCThrust_Bool && Output) || (InnerIter == 0)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -7305,13 +7328,13 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain unsigned long Iter_Fixed_CL = config->GetIter_Fixed_CL(); unsigned long Update_Alpha = config->GetUpdate_Alpha(); - unsigned long ExtIter = config->GetExtIter(); - bool write_heads = ((ExtIter % Iter_Fixed_CL == 0) && (ExtIter != 0)); + unsigned long InnerIter = config->GetInnerIter(); + bool write_heads = ((InnerIter % Iter_Fixed_CL == 0) && (InnerIter != 0)); su2double Beta = config->GetAoS()*PI_NUMBER/180.0; su2double dCL_dAlpha = config->GetdCL_dAlpha()*180.0/PI_NUMBER; bool Update_AoA = false; - if (ExtIter == 0) AoA_Counter = 0; + if (InnerIter == 0) AoA_Counter = 0; /*--- Only the fine mesh level should check the convergence criteria ---*/ @@ -7323,7 +7346,7 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain /*--- Reevaluate Angle of Attack at a fixed number of iterations ---*/ - if ((ExtIter % Iter_Fixed_CL == 0) && (ExtIter != 0)) { + if ((InnerIter % Iter_Fixed_CL == 0) && (InnerIter != 0)) { AoA_Counter++; if ((AoA_Counter <= Update_Alpha)) Update_AoA = true; else Update_AoA = false; @@ -7421,11 +7444,11 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain unsigned long Iter_dCL_dAlpha = config->GetIter_dCL_dAlpha(); - if ((config->GetnExtIter()-Iter_dCL_dAlpha == ExtIter) && Output) { + if ((config->GetnInner_Iter()-Iter_dCL_dAlpha == InnerIter) && Output) { AoA_old = config->GetAoA(); - if (config->GetnExtIter()-Iter_dCL_dAlpha == ExtIter) { + if (config->GetnInner_Iter()-Iter_dCL_dAlpha == InnerIter) { Wrt_Con_Freq = SU2_TYPE::Int(su2double(config->GetIter_dCL_dAlpha())/10.0); config->SetWrt_Con_Freq(Wrt_Con_Freq); Total_CD_Prev = Total_CD; @@ -7439,7 +7462,7 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain if ((rank == MASTER_NODE) && (iMesh == MESH_0)) { - if (config->GetnExtIter()-Iter_dCL_dAlpha == ExtIter) { + if (config->GetnInner_Iter()-Iter_dCL_dAlpha == InnerIter) { cout << endl << "----------------------------- Fixed CL Mode -----------------------------" << endl; cout << " Change AoA by +0.001 deg to evaluate gradient." << endl; cout << "-------------------------------------------------------------------------" << endl << endl; @@ -7495,7 +7518,7 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain } - if (AoA_FD_Change && (config->GetnExtIter()-1 == ExtIter) && Output && (iMesh == MESH_0) && !config->GetDiscrete_Adjoint()) { + if (AoA_FD_Change && (config->GetnInner_Iter()-1 == InnerIter) && Output && (iMesh == MESH_0) && !config->GetDiscrete_Adjoint()) { /*--- Update angle of attack ---*/ @@ -12243,7 +12266,7 @@ void CEulerSolver::BC_Custom(CGeometry *geometry, /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -12338,9 +12361,9 @@ void CEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_co time discretization scheme (1st- or 2nd-order).---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); } @@ -12352,9 +12375,9 @@ void CEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_co if (implicit) { for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); } Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); @@ -12468,9 +12491,9 @@ void CEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_co due to the time discretization has a new form.---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); } @@ -12481,9 +12504,9 @@ void CEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_co if (implicit) { for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1/TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (3.0*Volume_nP1)/(2.0*TimeStep); } Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); @@ -12493,45 +12516,6 @@ void CEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_co } -void CEulerSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ - - unsigned short iVar; - unsigned long iPoint; - su2double residual; - - /*--- Set Residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++){ - SetRes_BGS(iVar,0.0); - SetRes_Max_BGS(iVar,0.0,0); - } - - /*--- Set the residuals ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - for (iVar = 0; iVar < nVar; iVar++){ - residual = node[iPoint]->GetSolution(iVar) - node[iPoint]->Get_BGSSolution_k(iVar); - AddRes_BGS(iVar,residual*residual); - AddRes_Max_BGS(iVar,fabs(residual),geometry->node[iPoint]->GetGlobalIndex(),geometry->node[iPoint]->GetCoord()); - } - } - - SetResidual_BGS(geometry, config); - -} - - -void CEulerSolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config){ - - unsigned long iPoint; - - /*--- To nPoint: The solution must be communicated beforehand ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++){ - - node[iPoint]->Set_BGSSolution_k(); - - } - -} void CEulerSolver::ComputeVerificationError(CGeometry *geometry, CConfig *config) { @@ -12545,9 +12529,9 @@ void CEulerSolver::ComputeVerificationError(CGeometry *geometry, RMS (L2) and maximum (Linf) global error norms. From these global measures, one can compute the order of accuracy. ---*/ - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) - && (config->GetExtIter()!= 0)) - || (config->GetExtIter() == 1)); + bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*40)) == 0) + && (config->GetInnerIter()!= 0)) + || (config->GetInnerIter() == 1)); if( !write_heads ) return; /*--- Check if there actually is an exact solution for this @@ -12557,7 +12541,7 @@ void CEulerSolver::ComputeVerificationError(CGeometry *geometry, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Reset the global error measures to zero. ---*/ for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -12639,21 +12623,14 @@ void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig unsigned long iPoint, index, iChildren, Point_Fine; unsigned short turb_model = config->GetKind_Turb_Model(); su2double Area_Children, Area_Parent, *Coord, *Solution_Fine; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool static_fsi = ((config->GetUnsteady_Simulation() == STEADY) && + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool static_fsi = ((config->GetTime_Marching() == STEADY) && (config->GetFSI_Simulation())); bool steady_restart = config->GetSteadyRestart(); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; bool turbulent = (config->GetKind_Turb_Model() != NONE); - string UnstExt, text_line; - ifstream restart_file; - - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); - - string restart_filename = config->GetSolution_FlowFileName(); + string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); Coord = new su2double [nDim]; for (iDim = 0; iDim < nDim; iDim++) @@ -12676,16 +12653,6 @@ void CEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig else turbVars = 1; } - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - restart_filename = config->GetMultizone_FileName(restart_filename, iZone); - - /*--- Modify file name for an unsteady restart ---*/ - - if (dual_time || time_stepping) - restart_filename = config->GetUnsteady_FileName(restart_filename, val_iter); - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ if (config->GetRead_Binary_Restart()) { @@ -14053,11 +14020,10 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) ifstream restart_file; unsigned short nZone = geometry->GetnZone(); bool restart = (config->GetRestart() || config->GetRestart_Flow()); - int Unst_RestartIter; - unsigned short iZone = config->GetiZone(); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + int Unst_RestartIter = 0; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -14066,7 +14032,7 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) bool low_mach_prec = config->Low_Mach_Preconditioning(); bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); - string filename_ = config->GetSolution_FlowFileName(); + string filename_ = "flow"; unsigned short direct_diff = config->GetDirectDiff(); bool rans = (config->GetKind_Turb_Model() != NONE); @@ -14079,27 +14045,23 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) if (!(!restart || (iMesh != MESH_0) || nZone > 1)) { - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) filename_ = config->GetMultizone_FileName(filename_, iZone); - /*--- Modify file name for a dual-time unsteady restart ---*/ if (dual_time) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else if (config->GetTime_Marching() == DT_STEPPING_1ST) + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } /*--- Modify file name for a time stepping unsteady restart ---*/ if (time_stepping) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; } + + filename_ = config->GetFilename(filename_, ".meta", Unst_RestartIter); /*--- Read and store the restart metadata. ---*/ @@ -14795,8 +14757,8 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) /*--- Initialize the BGS residuals in FSI problems. ---*/ if (config->GetMultizone_Residual()){ - Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_RMS[iVar] = 0.0; - Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 0.0; + Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_BGS[iVar] = 1.0; + Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 1.0; /*--- Define some structures for locating max residuals ---*/ @@ -14836,6 +14798,8 @@ CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "C.FLOW"; } CNSSolver::~CNSSolver(void) { @@ -14914,15 +14878,15 @@ void CNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, C unsigned long iPoint, ErrorCounter = 0; su2double StrainMag = 0.0, Omega = 0.0, *Vorticity; - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool cont_adjoint = config->GetContinuous_Adjoint(); bool disc_adjoint = config->GetDiscrete_Adjoint(); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED); bool center_jst = center && config->GetKind_Centered_Flow() == JST; - bool limiter_flow = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); - bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); - bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter())); + bool limiter_flow = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter())); bool fixed_cl = config->GetFixed_CL_Mode(); bool engine = ((config->GetnMarker_EngineInflow() != 0) || (config->GetnMarker_EngineExhaust() != 0)); bool actuator_disk = ((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)); @@ -15097,8 +15061,8 @@ void CNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CC su2double ProjVel, ProjVel_i, ProjVel_j; bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); Min_Delta_Time = 1.E6; Max_Delta_Time = 0.0; @@ -15254,7 +15218,7 @@ void CNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CC } /*--- For exact time solution use the minimum delta time of the whole mesh ---*/ - if (config->GetUnsteady_Simulation() == TIME_STEPPING) { + if (config->GetTime_Marching() == TIME_STEPPING) { #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; @@ -15264,6 +15228,8 @@ void CNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CC #endif for (iPoint = 0; iPoint < nPointDomain; iPoint++) node[iPoint]->SetDelta_Time(Global_Delta_Time); + + config->SetDelta_UnstTimeND(Global_Delta_Time); } /*--- Recompute the unsteady time step for the dual time strategy @@ -15598,7 +15564,7 @@ void CNSSolver::Friction_Forces(CGeometry *geometry, CConfig *config) { } } - + /*--- Project forces and store the non-dimensional coefficients ---*/ if (Monitoring == YES) { diff --git a/SU2_CFD/src/solver_direct_mean_fem.cpp b/SU2_CFD/src/solver_direct_mean_fem.cpp index f0fb30ceb801..2c06eee59ea2 100644 --- a/SU2_CFD/src/solver_direct_mean_fem.cpp +++ b/SU2_CFD/src/solver_direct_mean_fem.cpp @@ -732,6 +732,9 @@ CFEM_DG_EulerSolver::CFEM_DG_EulerSolver(CGeometry *geometry, CConfig *config, u computation of the spatial residual, while for ADER this list contains the tasks to be done for one space time step. */ SetUpTaskList(config); + + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "DG FLOW"; } CFEM_DG_EulerSolver::~CFEM_DG_EulerSolver(void) { @@ -799,7 +802,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, su2double Beta = config->GetAoS()*PI_NUMBER/180.0; su2double Mach = config->GetMach(); su2double Reynolds = config->GetReynolds(); - bool unsteady = (config->GetUnsteady_Simulation() != NO); + bool unsteady = (config->GetTime_Marching() != NO); bool viscous = config->GetViscous(); bool grid_movement = config->GetGrid_Movement(); bool turbulent = (config->GetKind_Solver() == FEM_RANS) || (config->GetKind_Solver() == FEM_LES); @@ -1295,9 +1298,9 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, if (unsteady){ NonDimTableOut << "-- Unsteady conditions" << endl; NonDimTable.PrintHeader(); - NonDimTable << "Total Time" << config->GetTotal_UnstTime() << config->GetTime_Ref() << "s" << config->GetTotal_UnstTimeND(); + NonDimTable << "Total Time" << config->GetMax_Time() << config->GetTime_Ref() << "s" << config->GetMax_Time()/config->GetTime_Ref(); Unit.str(""); - NonDimTable << "Time Step" << config->GetDelta_UnstTime() << config->GetTime_Ref() << "s" << config->GetDelta_UnstTimeND(); + NonDimTable << "Time Step" << config->GetTime_Step() << config->GetTime_Ref() << "s" << config->GetDelta_UnstTimeND(); Unit.str(""); NonDimTable.PrintFooter(); } @@ -3115,10 +3118,10 @@ bool CFEM_DG_EulerSolver::Complete_MPI_ReverseCommunication(CConfig *config, return true; } -void CFEM_DG_EulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CFEM_DG_EulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { /*--- Check if a verification solution is to be computed. ---*/ - if ((VerificationSolution) && (ExtIter == 0)) { + if ((VerificationSolution) && (TimeIter == 0)) { /* Loop over the owned elements. */ for(unsigned long i=0; iGetUnsteady_Simulation() == HARMONIC_BALANCE; + const bool harmonic_balance = config->GetTime_Marching() == HARMONIC_BALANCE; if(config->GetGrid_Movement() && !harmonic_balance) { /*--- Determine the type of grid motion. ---*/ @@ -3242,10 +3245,10 @@ void CFEM_DG_EulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_co CURRENT_FUNCTION); /* Determine whether or not it is needed to compute the motion data. */ - const unsigned long ExtIter = config->GetExtIter(); + const unsigned long TimeIter = config->GetTimeIter(); bool computeMotion = false, firstTime = false; - if(ExtIter == 0 && iStep == 0) computeMotion = firstTime = true; + if(TimeIter == 0 && iStep == 0) computeMotion = firstTime = true; if(iStep == 1 || iStep == 3) computeMotion = true; if( computeMotion ) { @@ -3257,7 +3260,7 @@ void CFEM_DG_EulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_co /* Determine the time for which the motion data must be determined. */ const su2double deltaT = config->GetDelta_UnstTimeND(); - su2double tNew = ExtIter*deltaT; + su2double tNew = TimeIter*deltaT; if( iStep ) tNew += 0.25*(iStep+1)*deltaT; /* Determine the time for which the currently stored position was @@ -3595,7 +3598,7 @@ void CFEM_DG_EulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_con unsigned short iMesh, unsigned long Iteration) { /* Check whether or not a time stepping scheme is used. */ - const bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + const bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; /* Initialize the minimum and maximum time step. */ Min_Delta_Time = 1.e25; Max_Delta_Time = 0.0; @@ -3741,6 +3744,8 @@ void CFEM_DG_EulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_con if (time_stepping) { for(unsigned long l=0; lSetDelta_UnstTimeND(Min_Delta_Time); } } } @@ -5768,7 +5773,7 @@ void CFEM_DG_EulerSolver::Volume_Residual(CConfig *config, /*--- Get the physical time for MMS if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /* Determine the number of elements that are treated simultaneously in the matrix products to obtain good gemm performance. */ @@ -7327,9 +7332,9 @@ void CFEM_DG_EulerSolver::ComputeVerificationError(CGeometry *geometry, RMS (L2) and maximum (Linf) global error norms. From these global measures, one can compute the order of accuracy. ---*/ - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) - && (config->GetExtIter()!= 0)) - || (config->GetExtIter() == 1)); + bool write_heads = ((((config->GetTimeIter() % (config->GetWrt_Con_Freq()*40)) == 0) + && (config->GetTimeIter()!= 0)) + || (config->GetTimeIter() == 1)); if( !write_heads ) return; /*--- Check if there actually is an exact solution for this @@ -7339,7 +7344,7 @@ void CFEM_DG_EulerSolver::ComputeVerificationError(CGeometry *geometry, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Reset the global error measures to zero. ---*/ for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -8674,7 +8679,7 @@ void CFEM_DG_EulerSolver::BC_Custom(CConfig *config, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over the requested range of surface faces. Multiple faces are treated simultaneously to improve the performance of the matrix @@ -9403,12 +9408,9 @@ void CFEM_DG_EulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, C unsigned short iVar; unsigned long index; - string UnstExt, text_line; - ifstream restart_file; - const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); - string restart_filename = config->GetSolution_FlowFileName(); + string restart_filename = config->GetSolution_FileName(); int counter = 0; long iPoint_Local = 0; unsigned long iPoint_Global = 0; @@ -9418,6 +9420,8 @@ void CFEM_DG_EulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, C /*--- Skip coordinates ---*/ unsigned short skipVars = geometry[MESH_0]->GetnDim(); + + restart_filename = config->GetFilename(restart_filename, "", val_iter); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ @@ -10407,7 +10411,7 @@ void CFEM_DG_NSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai unsigned short iMesh, unsigned long Iteration) { /* Check whether or not a time stepping scheme is used. */ - const bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + const bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; /* Allocate the memory for the work array and initialize it to zero to avoid warnings in debug mode about uninitialized memory when padding is applied. */ @@ -10811,6 +10815,8 @@ void CFEM_DG_NSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai if (time_stepping) { for(unsigned long l=0; lSetDelta_UnstTimeND(Min_Delta_Time); } } } @@ -12669,7 +12675,7 @@ void CFEM_DG_NSSolver::Volume_Residual(CConfig *config, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /* Constant factor present in the heat flux vector. */ const su2double factHeatFlux_Lam = Gamma/Prandtl_Lam; @@ -15571,7 +15577,7 @@ void CFEM_DG_NSSolver::BC_Custom(CConfig *config, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over the requested range of surface faces. Multiple faces are treated simultaneously to improve the performance of the matrix diff --git a/SU2_CFD/src/solver_direct_mean_inc.cpp b/SU2_CFD/src/solver_direct_mean_inc.cpp index cf15c1b7bc1a..735535228893 100644 --- a/SU2_CFD/src/solver_direct_mean_inc.cpp +++ b/SU2_CFD/src/solver_direct_mean_inc.cpp @@ -107,16 +107,16 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned ifstream restart_file; unsigned short nZone = geometry->GetnZone(); bool restart = (config->GetRestart() || config->GetRestart_Flow()); - string filename = config->GetSolution_FlowFileName(); + string filename = config->GetSolution_FileName(); int Unst_RestartIter; unsigned short iZone = config->GetiZone(); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); bool fsi = config->GetFSI_Simulation(); bool multizone = config->GetMultizone_Problem(); - string filename_ = config->GetSolution_FlowFileName(); + string filename_ = config->GetSolution_FileName(); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -133,29 +133,29 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned /*--- Multizone problems require the number of the zone to be appended. ---*/ - if (nZone > 1) filename_ = config->GetMultizone_FileName(filename_, iZone); + if (nZone > 1) filename_ = config->GetMultizone_FileName(filename_, iZone, ".dat"); /*--- Modify file name for a dual-time unsteady restart ---*/ if (dual_time) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else if (config->GetTime_Marching() == DT_STEPPING_1ST) + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; + filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter, ".dat"); } /*--- Modify file name for a time stepping unsteady restart ---*/ if (time_stepping) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter, ".dat"); } /*--- Read and store the restart metadata. ---*/ - Read_SU2_Restart_Metadata(geometry, config, false, filename_); +// Read_SU2_Restart_Metadata(geometry, config, false, filename_); } @@ -583,8 +583,8 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned /*--- Initialize the BGS residuals in FSI problems. ---*/ if (fsi || multizone){ - Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_RMS[iVar] = 0.0; - Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 0.0; + Residual_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_RMS[iVar] = 1.0; + Residual_Max_BGS = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) Residual_Max_BGS[iVar] = 1.0; /*--- Define some structures for locating max residuals ---*/ @@ -623,7 +623,10 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); - + + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "INC.FLOW"; + } CIncEulerSolver::~CIncEulerSolver(void) { @@ -831,7 +834,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i su2double Mach = config->GetMach(); su2double Reynolds = config->GetReynolds(); - bool unsteady = (config->GetUnsteady_Simulation() != NO); + bool unsteady = (config->GetTime_Marching() != NO); bool viscous = config->GetViscous(); bool turbulent = ((config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS)); @@ -1219,7 +1222,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i NonDimTable << "Mu(T) Poly. Coeff. " + ss.str() << config->GetMu_PolyCoeff(iVar) << config->GetMu_PolyCoeff(iVar)/config->GetMu_PolyCoeffND(iVar) << "-" << config->GetMu_PolyCoeffND(iVar); } Unit.str(""); - NonDimTable.PrintFooter(); + NonDimTable.PrintFooter(); break; } @@ -1382,11 +1385,11 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i ModelTable.PrintFooter(); if (unsteady){ + NonDimTableOut << "-- Unsteady conditions" << endl; NonDimTable.PrintHeader(); - NonDimTableOut << "-- Unsteady conditions" << endl; - NonDimTable << "Total Time" << config->GetTotal_UnstTime() << config->GetTime_Ref() << "s" << config->GetTotal_UnstTimeND(); + NonDimTable << "Total Time" << config->GetMax_Time() << config->GetTime_Ref() << "s" << config->GetMax_Time()/config->GetTime_Ref(); Unit.str(""); - NonDimTable << "Time Step" << config->GetDelta_UnstTime() << config->GetTime_Ref() << "s" << config->GetDelta_UnstTimeND(); + NonDimTable << "Time Step" << config->GetTime_Step() << config->GetTime_Ref() << "s" << config->GetDelta_UnstTimeND(); Unit.str(""); NonDimTable.PrintFooter(); } @@ -1400,7 +1403,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i } -void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long ExtIter) { +void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_container, CConfig *config, unsigned long TimeIter) { unsigned long iPoint, Point_Fine; unsigned short iMesh, iChildren, iVar; @@ -1409,11 +1412,11 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve bool restart = (config->GetRestart() || config->GetRestart_Flow()); bool rans = ((config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS)); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Check if a verification solution is to be computed. ---*/ - if ((VerificationSolution) && (ExtIter == 0) && !restart) { + if ((VerificationSolution) && (TimeIter == 0) && !restart) { /*--- Loop over the multigrid levels. ---*/ for (iMesh = 0; iMesh <= config->GetnMGLevels(); iMesh++) { @@ -1436,7 +1439,7 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve /*--- If restart solution, then interpolate the flow solution to all the multigrid levels, this is important with the dual time strategy ---*/ - if (restart && (ExtIter == 0)) { + if (restart && (TimeIter == 0)) { Solution = new su2double[nVar]; for (iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { @@ -1489,7 +1492,7 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve /*--- The value of the solution for the first iteration of the dual time ---*/ - if (dual_time && (ExtIter == 0 || (restart && (long)ExtIter == config->GetUnst_RestartIter()))) { + if (dual_time && (TimeIter == 0 || (restart && (long)TimeIter == (long)config->GetRestart_Iter()))) { /*--- Push back the initial condition to previous solution containers for a 1st-order restart or when simply intitializing to freestream. ---*/ @@ -1505,16 +1508,16 @@ void CIncEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve } } - if ((restart && (long)ExtIter == config->GetUnst_RestartIter()) && - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)) { + if ((restart && (long)TimeIter == (long)config->GetRestart_Iter()) && + (config->GetTime_Marching() == DT_STEPPING_2ND)) { /*--- Load an additional restart file for a 2nd-order restart ---*/ - solver_container[MESH_0][FLOW_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetUnst_RestartIter()-1), true); + solver_container[MESH_0][FLOW_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), true); /*--- Load an additional restart file for the turbulence model ---*/ if (rans) - solver_container[MESH_0][TURB_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetUnst_RestartIter()-1), false); + solver_container[MESH_0][TURB_SOL]->LoadRestart(geometry, solver_container, config, SU2_TYPE::Int(config->GetRestart_Iter()-1), false); /*--- Push back this new solution to time level N. ---*/ @@ -1534,12 +1537,12 @@ void CIncEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contai unsigned long ErrorCounter = 0; - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool cont_adjoint = config->GetContinuous_Adjoint(); bool disc_adjoint = config->GetDiscrete_Adjoint(); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool muscl = (config->GetMUSCL_Flow() || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == ROE)); - bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); + bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); bool center = ((config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED)); bool center_jst = center && (config->GetKind_Centered_Flow() == JST); bool fixed_cl = config->GetFixed_CL_Mode(); @@ -1651,9 +1654,9 @@ void CIncEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contain unsigned short iDim, iMarker; bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool time_steping = config->GetUnsteady_Simulation() == TIME_STEPPING; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool time_steping = config->GetTime_Marching() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); Min_Delta_Time = 1.E6; Max_Delta_Time = 0.0; @@ -1908,10 +1911,10 @@ void CIncEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_cont unsigned long iEdge, iPoint, jPoint, counter_local = 0, counter_global = 0; unsigned short iDim, iVar; - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool muscl = (config->GetMUSCL_Flow() && (iMesh == MESH_0)); - bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); + bool limiter = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; /*--- Loop over all the edges ---*/ @@ -2234,7 +2237,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over points ---*/ for (iPoint = 0; iPoint < nPointDomain; iPoint++) { @@ -3481,6 +3484,10 @@ void CIncEulerSolver::ImplicitEuler_Iteration(CGeometry *geometry, CSolver **sol SetIterLinSolver(IterLinSol); + /*--- Set the residual --- */ + + valResidual = System.GetResidual(); + /*--- Update solution (system written in terms of increments) ---*/ if (!adjoint) { @@ -3642,12 +3649,19 @@ void CIncEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *con node[iPoint]->SetRmatrixZero(); node[iPoint]->SetGradient_PrimitiveZero(nPrimVarGrad); + AD::StartPreacc(); + AD::SetPreaccIn(PrimVar_i, nPrimVarGrad); + AD::SetPreaccIn(Coord_i, nDim); + for (iNeigh = 0; iNeigh < geometry->node[iPoint]->GetnPoint(); iNeigh++) { jPoint = geometry->node[iPoint]->GetPoint(iNeigh); Coord_j = geometry->node[jPoint]->GetCoord(); PrimVar_j = node[jPoint]->GetPrimitive(); + AD::SetPreaccIn(Coord_j, nDim); + AD::SetPreaccIn(PrimVar_j, nPrimVarGrad); + weight = 0.0; for (iDim = 0; iDim < nDim; iDim++) weight += (Coord_j[iDim]-Coord_i[iDim])*(Coord_j[iDim]-Coord_i[iDim]); @@ -3677,6 +3691,9 @@ void CIncEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *con } } + AD::SetPreaccOut(node[iPoint]->GetRmatrix(), nDim, nDim); + AD::SetPreaccOut(node[iPoint]->GetGradient_Primitive(), nPrimVarGrad, nDim); + AD::EndPreacc(); } /*--- Correct the gradient values across any periodic boundaries. ---*/ @@ -3703,6 +3720,11 @@ void CIncEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *con r12 = node[iPoint]->GetRmatrix(0,1); r22 = node[iPoint]->GetRmatrix(1,1); + AD::StartPreacc(); + AD::SetPreaccIn(r11); + AD::SetPreaccIn(r12); + AD::SetPreaccIn(r22); + if (r11 >= 0.0) r11 = sqrt(r11); else r11 = 0.0; if (r11 != 0.0) r12 = r12/r11; else r12 = 0.0; if (r22-r12*r12 >= 0.0) r22 = sqrt(r22-r12*r12); else r22 = 0.0; @@ -3713,6 +3735,11 @@ void CIncEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *con r23_b = node[iPoint]->GetRmatrix(2,1); r33 = node[iPoint]->GetRmatrix(2,2); + AD::SetPreaccIn(r13); + AD::SetPreaccIn(r23_a); + AD::SetPreaccIn(r23_b); + AD::SetPreaccIn(r33); + if (r11 != 0.0) r13 = r13/r11; else r13 = 0.0; if ((r22 != 0.0) && (r11*r22 != 0.0)) r23 = r23_a/r22 - r23_b*r12/(r11*r22); else r23 = 0.0; if (r33-r23*r23-r13*r13 >= 0.0) r33 = sqrt(r33-r23*r23-r13*r13); else r33 = 0.0; @@ -3756,6 +3783,9 @@ void CIncEulerSolver::SetPrimitive_Gradient_LS(CGeometry *geometry, CConfig *con } } + AD::SetPreaccOut(Smatrix, nDim, nDim); + AD::EndPreacc(); + /*--- Computation of the gradient: S*c ---*/ for (iVar = 0; iVar < nPrimVarGrad; iVar++) { for (iDim = 0; iDim < nDim; iDim++) { @@ -4088,13 +4118,13 @@ void CIncEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_cont unsigned long Iter_Fixed_CL = config->GetIter_Fixed_CL(); unsigned long Update_Alpha = config->GetUpdate_Alpha(); - unsigned long ExtIter = config->GetExtIter(); - bool write_heads = ((ExtIter % Iter_Fixed_CL == 0) && (ExtIter != 0)); + unsigned long InnerIter = config->GetInnerIter(); + bool write_heads = ((InnerIter % Iter_Fixed_CL == 0) && (InnerIter != 0)); su2double Beta = config->GetAoS()*PI_NUMBER/180.0; su2double dCL_dAlpha = config->GetdCL_dAlpha()*180.0/PI_NUMBER; bool Update_AoA = false; - if (ExtIter == 0) AoA_Counter = 0; + if (InnerIter == 0) AoA_Counter = 0; /*--- Only the fine mesh level should check the convergence criteria ---*/ @@ -4106,7 +4136,7 @@ void CIncEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_cont /*--- Reevaluate Angle of Attack at a fixed number of iterations ---*/ - if ((ExtIter % Iter_Fixed_CL == 0) && (ExtIter != 0)) { + if ((InnerIter % Iter_Fixed_CL == 0) && (InnerIter != 0)) { AoA_Counter++; if ((AoA_Counter <= Update_Alpha)) Update_AoA = true; Update_AoA = true; @@ -5674,7 +5704,7 @@ void CIncEulerSolver::BC_Custom(CGeometry *geometry, /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -5806,9 +5836,9 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver contribution, as the time derivative should always be zero. ---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); } @@ -5830,9 +5860,9 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][jVar] *= Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][jVar] *= (Volume_nP1*3.0)/(2.0*TimeStep); } } @@ -6034,9 +6064,9 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver due to the time discretization has a new form.---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); } @@ -6055,9 +6085,9 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][jVar] *= Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][jVar] *= (Volume_nP1*3.0)/(2.0*TimeStep); } } @@ -6086,9 +6116,9 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, bool axisymmetric = config->GetAxisymmetric(); - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) - && (config->GetExtIter()!= 0)) - || (config->GetExtIter() == 1)); + bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*40)) == 0) + && (config->GetInnerIter()!= 0)) + || (config->GetInnerIter() == 1)); /*--- Get the number of outlet markers and check for any mass flow BCs. ---*/ @@ -6289,46 +6319,6 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } -void CIncEulerSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ - - unsigned short iVar; - unsigned long iPoint; - su2double residual; - - /*--- Set Residuals to zero ---*/ - - for (iVar = 0; iVar < nVar; iVar++){ - SetRes_BGS(iVar,0.0); - SetRes_Max_BGS(iVar,0.0,0); - } - - /*--- Set the residuals ---*/ - for (iPoint = 0; iPoint < nPointDomain; iPoint++){ - for (iVar = 0; iVar < nVar; iVar++){ - residual = node[iPoint]->GetSolution(iVar) - node[iPoint]->Get_BGSSolution_k(iVar); - AddRes_BGS(iVar,residual*residual); - AddRes_Max_BGS(iVar,fabs(residual),geometry->node[iPoint]->GetGlobalIndex(),geometry->node[iPoint]->GetCoord()); - } - } - - SetResidual_BGS(geometry, config); - -} - - -void CIncEulerSolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config){ - - unsigned long iPoint; - - /*--- To nPoint: The solution must be communicated beforehand ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++){ - - node[iPoint]->Set_BGSSolution_k(); - - } - -} - void CIncEulerSolver::ComputeVerificationError(CGeometry *geometry, CConfig *config) { @@ -6341,9 +6331,9 @@ void CIncEulerSolver::ComputeVerificationError(CGeometry *geometry, RMS (L2) and maximum (Linf) global error norms. From these global measures, one can compute the order of accuracy. ---*/ - bool write_heads = ((((config->GetExtIter() % (config->GetWrt_Con_Freq()*40)) == 0) - && (config->GetExtIter()!= 0)) - || (config->GetExtIter() == 1)); + bool write_heads = ((((config->GetInnerIter() % (config->GetWrt_Con_Freq()*40)) == 0) + && (config->GetInnerIter()!= 0)) + || (config->GetInnerIter() == 1)); if( !write_heads ) return; /*--- Check if there actually is an exact solution for this @@ -6353,7 +6343,7 @@ void CIncEulerSolver::ComputeVerificationError(CGeometry *geometry, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetUnsteady_Simulation()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching()) time = config->GetPhysicalTime(); /*--- Reset the global error measures to zero. ---*/ for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -6437,21 +6427,14 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf unsigned long iPoint, index, iChildren, Point_Fine; unsigned short turb_model = config->GetKind_Turb_Model(); su2double Area_Children, Area_Parent, *Coord, *Solution_Fine; - bool static_fsi = ((config->GetUnsteady_Simulation() == STEADY) && + bool static_fsi = ((config->GetTime_Marching() == STEADY) && (config->GetFSI_Simulation())); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool steady_restart = config->GetSteadyRestart(); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; bool turbulent = (config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS); - string UnstExt, text_line; - ifstream restart_file; - - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); - - string restart_filename = config->GetSolution_FlowFileName(); + string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); Coord = new su2double [nDim]; for (iDim = 0; iDim < nDim; iDim++) @@ -6486,16 +6469,6 @@ void CIncEulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf if ((!energy) && (!weakly_coupled_heat)) nVar_Restart--; Solution[nVar-1] = GetTemperature_Inf(); - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - restart_filename = config->GetMultizone_FileName(restart_filename, iZone); - - /*--- Modify file name for an unsteady restart ---*/ - - if (dual_time || time_stepping) - restart_filename = config->GetUnsteady_FileName(restart_filename, val_iter); - /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ if (config->GetRead_Binary_Restart()) { @@ -6740,11 +6713,11 @@ CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short bool restart = (config->GetRestart() || config->GetRestart_Flow()); int Unst_RestartIter; unsigned short iZone = config->GetiZone(); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); - string filename_ = config->GetSolution_FlowFileName(); + string filename_ = config->GetSolution_FileName(); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -6761,29 +6734,29 @@ CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short /*--- Multizone problems require the number of the zone to be appended. ---*/ - if (nZone > 1) filename_ = config->GetMultizone_FileName(filename_, iZone); + if (nZone > 1) filename_ = config->GetMultizone_FileName(filename_, iZone, ".dat"); /*--- Modify file name for a dual-time unsteady restart ---*/ if (dual_time) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else if (config->GetTime_Marching() == DT_STEPPING_1ST) + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; + filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter, ".dat"); } /*--- Modify file name for a time stepping unsteady restart ---*/ if (time_stepping) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter); + else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + filename_ = config->GetUnsteady_FileName(filename_, Unst_RestartIter, ".dat"); } /*--- Read and store the restart metadata. ---*/ - Read_SU2_Restart_Metadata(geometry, config, false, filename_); +// Read_SU2_Restart_Metadata(geometry, config, false, filename_); } @@ -7316,6 +7289,9 @@ CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "INC.FLOW"; + } CIncNSSolver::~CIncNSSolver(void) { @@ -7387,15 +7363,15 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container unsigned long iPoint, ErrorCounter = 0; su2double StrainMag = 0.0, Omega = 0.0, *Vorticity; - unsigned long ExtIter = config->GetExtIter(); + unsigned long InnerIter = config->GetInnerIter(); bool cont_adjoint = config->GetContinuous_Adjoint(); bool disc_adjoint = config->GetDiscrete_Adjoint(); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); bool center = ((config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED) || (cont_adjoint && config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED)); bool center_jst = center && config->GetKind_Centered_Flow() == JST; - bool limiter_flow = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); - bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter()); - bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (ExtIter <= config->GetLimiterIter())); + bool limiter_flow = (config->GetKind_SlopeLimit_Flow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter()); + bool limiter_adjflow = (cont_adjoint && (config->GetKind_SlopeLimit_AdjFlow() != NO_LIMITER) && (InnerIter <= config->GetLimiterIter())); bool fixed_cl = config->GetFixed_CL_Mode(); bool van_albada = config->GetKind_SlopeLimit_Flow() == VAN_ALBADA_EDGE; bool outlet = ((config->GetnMarker_Outlet() != 0)); @@ -7543,8 +7519,8 @@ void CIncNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, su2double ProjVel, ProjVel_i, ProjVel_j; bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool energy = config->GetEnergy_Equation(); Min_Delta_Time = 1.E6; Max_Delta_Time = 0.0; @@ -7708,7 +7684,7 @@ void CIncNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, } /*--- For exact time solution use the minimum delta time of the whole mesh ---*/ - if (config->GetUnsteady_Simulation() == TIME_STEPPING) { + if (config->GetTime_Marching() == TIME_STEPPING) { #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; diff --git a/SU2_CFD/src/solver_direct_transition.cpp b/SU2_CFD/src/solver_direct_transition.cpp index 64349e88bf41..4c18ad313f55 100644 --- a/SU2_CFD/src/solver_direct_transition.cpp +++ b/SU2_CFD/src/solver_direct_transition.cpp @@ -165,7 +165,7 @@ CTransLMSolver::CTransLMSolver(CGeometry *geometry, CConfig *config, unsigned sh cout << "No LM restart yet!!" << endl; // TODO, Aniket int j; cin >> j; - string mesh_filename = config->GetSolution_FlowFileName(); + string mesh_filename = config->GetSolution_FileName(); cstr = new char [mesh_filename.size()+1]; strcpy (cstr, mesh_filename.c_str()); restart_file.open(cstr, ios::in); @@ -183,6 +183,9 @@ CTransLMSolver::CTransLMSolver(CGeometry *geometry, CConfig *config, unsigned sh restart_file.close(); } + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "TRANS"; + } CTransLMSolver::~CTransLMSolver(void) { diff --git a/SU2_CFD/src/solver_direct_turbulent.cpp b/SU2_CFD/src/solver_direct_turbulent.cpp index 8f9d866fb150..4a23ba9e0966 100644 --- a/SU2_CFD/src/solver_direct_turbulent.cpp +++ b/SU2_CFD/src/solver_direct_turbulent.cpp @@ -536,9 +536,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con } for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = ( Density_nP1*U_time_nP1[iVar] - Density_n*U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = ( 3.0*Density_nP1*U_time_nP1[iVar] - 4.0*Density_n*U_time_n[iVar] +1.0*Density_nM1*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); } @@ -546,9 +546,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con } else { for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = ( 3.0*U_time_nP1[iVar] - 4.0*U_time_n[iVar] +1.0*U_time_nM1[iVar])*Volume_nP1 / (2.0*TimeStep); } @@ -561,9 +561,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con if (implicit) { for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); } Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); @@ -724,9 +724,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con } for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (Density_nP1*U_time_nP1[iVar] - Density_n*U_time_n[iVar])*(Volume_nP1/TimeStep); - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = (Density_nP1*U_time_nP1[iVar] - Density_n*U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) + (Density_nM1*U_time_nM1[iVar] - Density_n*U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); } @@ -734,9 +734,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con } else { for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(Volume_nP1/TimeStep); - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*(3.0*Volume_nP1/(2.0*TimeStep)) + (U_time_nM1[iVar] - U_time_n[iVar])*(Volume_nM1/(2.0*TimeStep)); } @@ -749,9 +749,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con if (implicit) { for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1/TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (3.0*Volume_nP1)/(2.0*TimeStep); } Jacobian.AddBlock(iPoint, iPoint, Jacobian_i); @@ -769,25 +769,8 @@ void CTurbSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * unsigned short iVar, iMesh; unsigned long iPoint, index, iChildren, Point_Fine; su2double Area_Children, Area_Parent, *Solution_Fine; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = (config->GetUnsteady_Simulation() == TIME_STEPPING); - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); - - string UnstExt, text_line; - ifstream restart_file; - string restart_filename = config->GetSolution_FlowFileName(); - - /*--- Modify file name for multizone problems ---*/ - if (nZone >1) - restart_filename = config->GetMultizone_FileName(restart_filename, iZone); - - /*--- Modify file name for an unsteady restart ---*/ - - if (dual_time|| time_stepping) - restart_filename = config->GetUnsteady_FileName(restart_filename, val_iter); + string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", val_iter); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ if (config->GetRead_Binary_Restart()) { @@ -1124,6 +1107,8 @@ CTurbSASolver::CTurbSASolver(CGeometry *geometry, CConfig *config, unsigned shor SetImplicitPeriodic(true); + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "SA"; } CTurbSASolver::~CTurbSASolver(void) { @@ -1159,7 +1144,7 @@ CTurbSASolver::~CTurbSASolver(void) { void CTurbSASolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { unsigned long iPoint; - bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (config->GetExtIter() <= config->GetLimiterIter()); + bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (config->GetInnerIter() <= config->GetLimiterIter()); unsigned short kind_hybridRANSLES = config->GetKind_HybridRANSLES(); su2double** PrimGrad_Flow = NULL; su2double* Vorticity = NULL; @@ -1240,7 +1225,7 @@ void CTurbSASolver::Source_Residual(CGeometry *geometry, CSolver **solver_contai CConfig *config, unsigned short iMesh) { unsigned long iPoint; - bool harmonic_balance = (config->GetUnsteady_Simulation() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); bool transition = (config->GetKind_Trans_Model() == LM); bool transition_BC = (config->GetKind_Trans_Model() == BC); @@ -3442,7 +3427,10 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh implicit flag in case we have periodic BCs. ---*/ SetImplicitPeriodic(true); - + + /*--- Add the solver name (max 8 characters) ---*/ + SolverName = "K-W SST"; + } CTurbSSTSolver::~CTurbSSTSolver(void) { @@ -3481,7 +3469,7 @@ void CTurbSSTSolver::Preprocessing(CGeometry *geometry, CSolver **solver_contain unsigned long iPoint; - bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (config->GetExtIter() <= config->GetLimiterIter()); + bool limiter_turb = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) && (config->GetInnerIter() <= config->GetLimiterIter()); for (iPoint = 0; iPoint < nPoint; iPoint ++) { diff --git a/SU2_CFD/src/solver_structure.cpp b/SU2_CFD/src/solver_structure.cpp index 1d96521d5b34..1ecc24e93b58 100644 --- a/SU2_CFD/src/solver_structure.cpp +++ b/SU2_CFD/src/solver_structure.cpp @@ -49,6 +49,7 @@ #include "../../Common/include/toolboxes/MMS/CRinglebSolution.hpp" #include "../../Common/include/toolboxes/MMS/CTGVSolution.hpp" #include "../../Common/include/toolboxes/MMS/CUserDefinedSolution.hpp" +#include "../../Common/include/toolboxes/printing_toolbox.hpp" CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { @@ -101,6 +102,8 @@ CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { Restart_Data = NULL; node = NULL; nOutputVariables = 0; + valResidual = 0.0; + /*--- Inlet profile data structures. ---*/ @@ -133,6 +136,9 @@ CSolver::CSolver(bool mesh_deform_mode) : System(mesh_deform_mode) { VertexTractionAdjoint = NULL; + nPrimVarGrad = 0; + nPrimVar = 0; + } CSolver::~CSolver(void) { @@ -1890,7 +1896,7 @@ void CSolver::InitiateComms(CGeometry *geometry, MPI_TYPE = COMM_TYPE_DOUBLE; break; case SOLUTION_FEA: - if (config->GetDynamic_Analysis() == DYNAMIC) + if (config->GetTime_Domain()) COUNT_PER_POINT = nVar*3; else COUNT_PER_POINT = nVar; @@ -2026,7 +2032,7 @@ void CSolver::InitiateComms(CGeometry *geometry, case SOLUTION_FEA: for (iVar = 0; iVar < nVar; iVar++) { bufDSend[buf_offset+iVar] = node[iPoint]->GetSolution(iVar); - if (config->GetDynamic_Analysis() == DYNAMIC) { + if (config->GetTime_Domain()) { bufDSend[buf_offset+nVar+iVar] = node[iPoint]->GetSolution_Vel(iVar); bufDSend[buf_offset+nVar*2+iVar] = node[iPoint]->GetSolution_Accel(iVar); } @@ -2188,7 +2194,7 @@ void CSolver::CompleteComms(CGeometry *geometry, case SOLUTION_FEA: for (iVar = 0; iVar < nVar; iVar++) { node[iPoint]->SetSolution(iVar, bufDRecv[buf_offset+iVar]); - if (config->GetDynamic_Analysis() == DYNAMIC) { + if (config->GetTime_Domain()) { node[iPoint]->SetSolution_Vel(iVar, bufDRecv[buf_offset+nVar+iVar]); node[iPoint]->SetSolution_Accel(iVar, bufDRecv[buf_offset+nVar*2+iVar]); } @@ -2362,9 +2368,9 @@ void CSolver::SetResidual_BGS(CGeometry *geometry, CConfig *config) { for (iVar = 0; iVar < nVar; iVar++) { - if (GetRes_BGS(iVar) != GetRes_BGS(iVar)) { - SU2_MPI::Error("SU2 has diverged.", CURRENT_FUNCTION); - } +// if (GetRes_BGS(iVar) != GetRes_BGS(iVar)) { +// SU2_MPI::Error("SU2 has diverged.", CURRENT_FUNCTION); +// } SetRes_BGS(iVar, max(EPS*EPS, sqrt(GetRes_BGS(iVar)/geometry->GetnPoint()))); @@ -2393,11 +2399,11 @@ void CSolver::SetResidual_BGS(CGeometry *geometry, CConfig *config) { for (iVar = 0; iVar < nVar; iVar++) { - if (rbuf_residual[iVar] != rbuf_residual[iVar]) { +// if (rbuf_residual[iVar] != rbuf_residual[iVar]) { - SU2_MPI::Error("SU2 has diverged (NaN detected)", CURRENT_FUNCTION); +// SU2_MPI::Error("SU2 has diverged (NaN detected)", CURRENT_FUNCTION); - } +// } SetRes_BGS(iVar, max(EPS*EPS, sqrt(rbuf_residual[iVar]/Global_nPointDomain))); @@ -3682,7 +3688,7 @@ void CSolver::Gauss_Elimination(su2double** A, su2double* rhs, unsigned short nV } -void CSolver::Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometry, CConfig *config, unsigned long ExtIter) { +void CSolver::Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometry, CConfig *config, unsigned long TimeIter) { /*--- Variables used for Aeroelastic case ---*/ @@ -3724,7 +3730,7 @@ void CSolver::Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometr su2double Omega, dt, psi; dt = config->GetDelta_UnstTimeND(); Omega = (config->GetRotation_Rate(2)/config->GetOmega_Ref()); - psi = Omega*(dt*ExtIter); + psi = Omega*(dt*TimeIter); /*--- Correct for the airfoil starting position (This is hardcoded in here) ---*/ if (Monitoring_Tag == "Airfoil1") { @@ -3754,7 +3760,7 @@ void CSolver::Aeroelastic(CSurfaceMovement *surface_movement, CGeometry *geometr } /*--- Compute the new surface node locations ---*/ - surface_movement->AeroelasticDeform(geometry, config, ExtIter, iMarker, iMarker_Monitoring, structural_solution); + surface_movement->AeroelasticDeform(geometry, config, TimeIter, iMarker, iMarker_Monitoring, structural_solution); } @@ -3966,13 +3972,10 @@ void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { /*--- This function is intended for dual time simulations ---*/ - unsigned long index; - int Unst_RestartIter; ifstream restart_file_n; - unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry->GetnZone(); - string filename = config->GetSolution_FlowFileName(); + + string filename = config->GetSolution_FileName(); string filename_n; /*--- Auxiliary vector for storing the coordinates ---*/ @@ -3985,18 +3988,13 @@ void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { unsigned long iPoint_Global_Local = 0, iPoint_Global = 0; unsigned short rbuf_NotMatching, sbuf_NotMatching; - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); - /*--- First, we load the restart file for time n ---*/ /*-------------------------------------------------------------------------------------------*/ /*--- Modify file name for an unsteady restart ---*/ - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - filename_n = config->GetUnsteady_FileName(filename, Unst_RestartIter); + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + filename_n = config->GetFilename(filename, ".csv", Unst_RestartIter); /*--- Open the restart file, throw an error if this fails. ---*/ @@ -4017,7 +4015,7 @@ void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { getline (restart_file_n, text_line); - istringstream point_line(text_line); + vector point_line = PrintingToolbox::split(text_line, ','); /*--- Retrieve local index. If this node from the restart file lives on the current processor, we will load and instantiate the vars. ---*/ @@ -4025,10 +4023,12 @@ void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { iPoint_Local = geometry->GetGlobal_to_Local_Point(iPoint_Global); if (iPoint_Local > -1) { - - if (nDim == 2) point_line >> index >> Coord[0] >> Coord[1]; - if (nDim == 3) point_line >> index >> Coord[0] >> Coord[1] >> Coord[2]; - + + Coord[0] = PrintingToolbox::stod(point_line[1]); + Coord[1] = PrintingToolbox::stod(point_line[2]); + if (nDim == 3){ + Coord[2] = PrintingToolbox::stod(point_line[3]); + } geometry->node[iPoint_Local]->SetCoord_n(Coord); iPoint_Global_Local++; @@ -4060,19 +4060,19 @@ void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { /*--- Now, we load the restart file for time n-1, if the simulation is 2nd Order ---*/ - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) { + if (config->GetTime_Marching() == DT_STEPPING_2ND) { ifstream restart_file_n1; string filename_n1; /*--- Modify file name for an unsteady restart ---*/ - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; - filename_n1 = config->GetUnsteady_FileName(filename, Unst_RestartIter); + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; + filename_n1 = config->GetFilename(filename, ".csv", Unst_RestartIter); /*--- Open the restart file, throw an error if this fails. ---*/ - restart_file_n.open(filename_n1.data(), ios::in); - if (restart_file_n.fail()) { + restart_file_n1.open(filename_n1.data(), ios::in); + if (restart_file_n1.fail()) { SU2_MPI::Error(string("There is no flow restart file ") + filename_n1, CURRENT_FUNCTION); } @@ -4083,23 +4083,26 @@ void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { /*--- Read all lines in the restart file ---*/ /*--- The first line is the header ---*/ - getline (restart_file_n, text_line); + getline (restart_file_n1, text_line); for (iPoint_Global = 0; iPoint_Global < geometry->GetGlobal_nPointDomain(); iPoint_Global++ ) { - getline (restart_file_n, text_line); - - istringstream point_line(text_line); + getline (restart_file_n1, text_line); + vector point_line = PrintingToolbox::split(text_line, ','); + /*--- Retrieve local index. If this node from the restart file lives on the current processor, we will load and instantiate the vars. ---*/ iPoint_Local = geometry->GetGlobal_to_Local_Point(iPoint_Global); if (iPoint_Local > -1) { - - if (nDim == 2) point_line >> index >> Coord[0] >> Coord[1]; - if (nDim == 3) point_line >> index >> Coord[0] >> Coord[1] >> Coord[2]; + + Coord[0] = PrintingToolbox::stod(point_line[1]); + Coord[1] = PrintingToolbox::stod(point_line[2]); + if (nDim == 3){ + Coord[2] = PrintingToolbox::stod(point_line[3]); + } geometry->node[iPoint_Local]->SetCoord_n1(Coord); @@ -4144,15 +4147,19 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, CConfig *config, strin ifstream restart_file; string text_line, Tag; unsigned short iVar; - long index, iPoint_Local = 0; unsigned long iPoint_Global = 0; + long iPoint_Local = 0; unsigned long iPoint_Global = 0; int counter = 0; - config->fields.clear(); + fields.clear(); Restart_Vars = new int[5]; + + string error_string = "Note: ASCII restart files must be in CSV format since v7.0.\n" + "Check https://su2code.github.io/docs/Guide-to-v7 for more information."; /*--- First, check that this is not a binary restart file. ---*/ char fname[100]; + val_filename += ".csv"; strcpy(fname, val_filename.c_str()); int magic_number; @@ -4203,7 +4210,8 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, CConfig *config, strin /*--- Error check opening the file. ---*/ if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + SU2_MPI::Error(string("SU2 ASCII restart file ") + string(fname) + string(" not found.\n") + error_string, + CURRENT_FUNCTION); } /*--- Have the master attempt to read the magic number. ---*/ @@ -4236,22 +4244,29 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, CConfig *config, strin /*--- In case there is no restart file ---*/ if (restart_file.fail()) { - SU2_MPI::Error(string("SU2 ASCII solution file ") + string(fname) + string(" not found."), CURRENT_FUNCTION); + SU2_MPI::Error(string("SU2 ASCII restart file ") + string(fname) + string(" not found.\n") + error_string, + CURRENT_FUNCTION); } /*--- Identify the number of fields (and names) in the restart file ---*/ getline (restart_file, text_line); - stringstream ss(text_line); - while (ss >> Tag) { - config->fields.push_back(Tag); - if (ss.peek() == ',') ss.ignore(); + + char delimiter = ','; + fields = PrintingToolbox::split(text_line, delimiter); + + if (fields.size() <= 1) { + SU2_MPI::Error(string("Restart file does not seem to be a CSV file.\n") + error_string, CURRENT_FUNCTION); + } + + for (unsigned short iField = 0; iField < fields.size(); iField++){ + PrintingToolbox::trim(fields[iField]); } /*--- Set the number of variables, one per field in the restart file (without including the PointID) ---*/ - Restart_Vars[1] = (int)config->fields.size() - 1; + Restart_Vars[1] = (int)fields.size() - 1; /*--- Allocate memory for the restart data. ---*/ @@ -4262,8 +4277,8 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, CConfig *config, strin for (iPoint_Global = 0; iPoint_Global < geometry->GetGlobal_nPointDomain(); iPoint_Global++ ) { getline (restart_file, text_line); - - istringstream point_line(text_line); + + vector point_line = PrintingToolbox::split(text_line, delimiter); /*--- Retrieve local index. If this node from the restart file lives on the current processor, we will load and instantiate the vars. ---*/ @@ -4271,15 +4286,11 @@ void CSolver::Read_SU2_Restart_ASCII(CGeometry *geometry, CConfig *config, strin iPoint_Local = geometry->GetGlobal_to_Local_Point(iPoint_Global); if (iPoint_Local > -1) { - - /*--- The PointID is not stored --*/ - - point_line >> index; - + /*--- Store the solution (starting with node coordinates) --*/ for (iVar = 0; iVar < Restart_Vars[1]; iVar++) - point_line >> Restart_Data[counter*Restart_Vars[1] + iVar]; + Restart_Data[counter*Restart_Vars[1] + iVar] = SU2_TYPE::GetValue(PrintingToolbox::stod(point_line[iVar+1])); /*--- Increment our local point counter. ---*/ @@ -4294,10 +4305,11 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, stri char str_buf[CGNS_STRING_SIZE], fname[100]; unsigned short iVar; + val_filename += ".dat"; strcpy(fname, val_filename.c_str()); int nRestart_Vars = 5, nFields; Restart_Vars = new int[5]; - config->fields.clear(); + fields.clear(); #ifndef HAVE_MPI @@ -4339,13 +4351,13 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, stri needed for when we read the strings later. We pad the beginning of the variable string vector with the Point_ID tag that wasn't written. ---*/ - config->fields.push_back("Point_ID"); + fields.push_back("Point_ID"); for (iVar = 0; iVar < nFields; iVar++) { ret = fread(str_buf, sizeof(char), CGNS_STRING_SIZE, fhw); if (ret != (unsigned long)CGNS_STRING_SIZE) { SU2_MPI::Error("Error reading restart file.", CURRENT_FUNCTION); } - config->fields.push_back(str_buf); + fields.push_back(str_buf); } /*--- For now, create a temp 1D buffer to read the data from file. ---*/ @@ -4430,7 +4442,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, stri /*--- Now parse the string names and load into the config class in case we need them for writing visualization files (SU2_SOL). ---*/ - config->fields.push_back("Point_ID"); + fields.push_back("Point_ID"); for (iVar = 0; iVar < nFields; iVar++) { index = iVar*CGNS_STRING_SIZE; field_buf.append("\""); @@ -4439,7 +4451,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, CConfig *config, stri } field_buf.append(str_buf); field_buf.append("\""); - config->fields.push_back(field_buf.c_str()); + fields.push_back(field_buf.c_str()); field_buf.clear(); } @@ -4511,346 +4523,99 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo su2double dCMy_dCL_ = config->GetdCMy_dCL(); su2double dCMz_dCL_ = config->GetdCMz_dCL(); string::size_type position; - unsigned long ExtIter_ = 0; + unsigned long InnerIter_ = 0; ifstream restart_file; bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); - - if (config->GetRead_Binary_Restart()) { - - char fname[100]; - strcpy(fname, val_filename.c_str()); - int nVar_Buf = 5; - int var_buf[5]; - int Restart_Iter = 0; - passivedouble Restart_Meta_Passive[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - su2double Restart_Meta[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - -#ifndef HAVE_MPI - - /*--- Serial binary input. ---*/ - - FILE *fhw; - fhw = fopen(fname,"rb"); - size_t ret; - - /*--- Error check for opening the file. ---*/ - - if (!fhw) { - SU2_MPI::Error(string("Unable to open restart file ") + string(fname), CURRENT_FUNCTION); - } - - /*--- First, read the number of variables and points. ---*/ - - ret = fread(var_buf, sizeof(int), nVar_Buf, fhw); - if (ret != (unsigned long)nVar_Buf) { - SU2_MPI::Error("Error reading restart file.", CURRENT_FUNCTION); - } - - /*--- Check that this is an SU2 binary file. SU2 binary files - have the hex representation of "SU2" as the first int in the file. ---*/ - - if (var_buf[0] != 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); - } - - /*--- Compute (negative) displacements and grab the metadata. ---*/ - - ret = sizeof(int) + 8*sizeof(passivedouble); - fseek(fhw,-ret, SEEK_END); - - /*--- Read the external iteration. ---*/ - - ret = fread(&Restart_Iter, sizeof(int), 1, fhw); - if (ret != 1) { - SU2_MPI::Error("Error reading restart file.", CURRENT_FUNCTION); - } - - /*--- Read the metadata. ---*/ - - ret = fread(Restart_Meta_Passive, sizeof(passivedouble), 8, fhw); - if (ret != 8) { - SU2_MPI::Error("Error reading restart file.", CURRENT_FUNCTION); - } - - for (unsigned short iVar = 0; iVar < 8; iVar++) - Restart_Meta[iVar] = Restart_Meta_Passive[iVar]; - - /*--- Close the file. ---*/ - - fclose(fhw); - -#else - - /*--- Parallel binary input using MPI I/O. ---*/ - - MPI_File fhw; - MPI_Offset disp; - int ierr; - - /*--- All ranks open the file using MPI. ---*/ - - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); - - /*--- Error check opening the file. ---*/ - - if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); - } - - /*--- First, read the number of variables and points (i.e., cols and rows), - which we will need in order to read the file later. Also, read the - variable string names here. Only the master rank reads the header. ---*/ - - if (rank == MASTER_NODE) - MPI_File_read(fhw, var_buf, nVar_Buf, MPI_INT, MPI_STATUS_IGNORE); - - /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - - SU2_MPI::Bcast(var_buf, nVar_Buf, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - /*--- Check that this is an SU2 binary file. SU2 binary files - have the hex representation of "SU2" as the first int in the file. ---*/ - - if (var_buf[0] != 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); - } - - /*--- Access the metadata. ---*/ - - if (rank == MASTER_NODE) { - - /*--- External iteration. ---*/ - - disp = (nVar_Buf*sizeof(int) + var_buf[1]*CGNS_STRING_SIZE*sizeof(char) + - var_buf[1]*var_buf[2]*sizeof(passivedouble)); - MPI_File_read_at(fhw, disp, &Restart_Iter, 1, MPI_INT, MPI_STATUS_IGNORE); - - /*--- Additional doubles for AoA, AoS, etc. ---*/ - - disp = (nVar_Buf*sizeof(int) + var_buf[1]*CGNS_STRING_SIZE*sizeof(char) + - var_buf[1]*var_buf[2]*sizeof(passivedouble) + 1*sizeof(int)); - MPI_File_read_at(fhw, disp, Restart_Meta_Passive, 8, MPI_DOUBLE, MPI_STATUS_IGNORE); - - } - - /*--- Communicate metadata. ---*/ - - SU2_MPI::Bcast(&Restart_Iter, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - /*--- Copy to a su2double structure (because of the SU2_MPI::Bcast - doesn't work with passive data)---*/ - - for (unsigned short iVar = 0; iVar < 8; iVar++) - Restart_Meta[iVar] = Restart_Meta_Passive[iVar]; - - SU2_MPI::Bcast(Restart_Meta, 8, MPI_DOUBLE, MASTER_NODE, MPI_COMM_WORLD); - - /*--- All ranks close the file after writing. ---*/ - - MPI_File_close(&fhw); - -#endif - - /*--- Store intermediate vals from file I/O in correct variables. ---*/ - - ExtIter_ = Restart_Iter; - AoA_ = Restart_Meta[0]; - AoS_ = Restart_Meta[1]; - BCThrust_ = Restart_Meta[2]; - dCD_dCL_ = Restart_Meta[3]; - dCMx_dCL_ = Restart_Meta[4]; - dCMy_dCL_ = Restart_Meta[5]; - dCMz_dCL_ = Restart_Meta[6]; - - } else { - - /*--- First, check that this is not a binary restart file. ---*/ - - char fname[100]; - strcpy(fname, val_filename.c_str()); - int magic_number; - -#ifndef HAVE_MPI - - /*--- Serial binary input. ---*/ - - FILE *fhw; - fhw = fopen(fname,"rb"); - size_t ret; - - /*--- Error check for opening the file. ---*/ - - if (!fhw) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); - } - - /*--- Attempt to read the first int, which should be our magic number. ---*/ - - ret = fread(&magic_number, sizeof(int), 1, fhw); - if (ret != 1) { - SU2_MPI::Error("Error reading restart file.", CURRENT_FUNCTION); - } - - /*--- Check that this is an SU2 binary file. SU2 binary files - have the hex representation of "SU2" as the first int in the file. ---*/ - - if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); - } - - fclose(fhw); - -#else - - /*--- Parallel binary input using MPI I/O. ---*/ - - MPI_File fhw; - int ierr; - - /*--- All ranks open the file using MPI. ---*/ - - ierr = MPI_File_open(MPI_COMM_WORLD, fname, MPI_MODE_RDONLY, MPI_INFO_NULL, &fhw); - - /*--- Error check opening the file. ---*/ - - if (ierr) { - SU2_MPI::Error(string("Unable to open SU2 restart file ") + string(fname), CURRENT_FUNCTION); + + /*--- Carry on with ASCII metadata reading. ---*/ + + restart_file.open(val_filename.data(), ios::in); + if (restart_file.fail()) { + if (rank == MASTER_NODE) { + cout << " Warning: There is no restart file (" << val_filename.data() << ")."<< endl; + cout << " Computation will continue without updating metadata parameters." << endl; } - - /*--- Have the master attempt to read the magic number. ---*/ - - if (rank == MASTER_NODE) - MPI_File_read(fhw, &magic_number, 1, MPI_INT, MPI_STATUS_IGNORE); - - /*--- Broadcast the number of variables to all procs and store clearly. ---*/ - - SU2_MPI::Bcast(&magic_number, 1, MPI_INT, MASTER_NODE, MPI_COMM_WORLD); - - /*--- Check that this is an SU2 binary file. SU2 binary files - have the hex representation of "SU2" as the first int in the file. ---*/ - - if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); + } else { + + string text_line; + + /*--- Space for extra info (if any) ---*/ + + while (getline (restart_file, text_line)) { + + /*--- External iteration ---*/ + + position = text_line.find ("EXT_ITER=",0); + if (position != string::npos) { + text_line.erase (0,9); InnerIter_ = atoi(text_line.c_str()); + } + + /*--- Angle of attack ---*/ + + position = text_line.find ("AOA=",0); + if (position != string::npos) { + text_line.erase (0,4); AoA_ = atof(text_line.c_str()); + } + + /*--- Sideslip angle ---*/ + + position = text_line.find ("SIDESLIP_ANGLE=",0); + if (position != string::npos) { + text_line.erase (0,15); AoS_ = atof(text_line.c_str()); + } + + /*--- BCThrust angle ---*/ + + position = text_line.find ("INITIAL_BCTHRUST=",0); + if (position != string::npos) { + text_line.erase (0,17); BCThrust_ = atof(text_line.c_str()); + } + + if (adjoint_run) { + + if (config->GetEval_dOF_dCX() == true) { + + /*--- dCD_dCL coefficient ---*/ + + position = text_line.find ("DCD_DCL_VALUE=",0); + if (position != string::npos) { + text_line.erase (0,14); dCD_dCL_ = atof(text_line.c_str()); + } + + /*--- dCMx_dCL coefficient ---*/ + + position = text_line.find ("DCMX_DCL_VALUE=",0); + if (position != string::npos) { + text_line.erase (0,15); dCMx_dCL_ = atof(text_line.c_str()); + } + + /*--- dCMy_dCL coefficient ---*/ + + position = text_line.find ("DCMY_DCL_VALUE=",0); + if (position != string::npos) { + text_line.erase (0,15); dCMy_dCL_ = atof(text_line.c_str()); + } + + /*--- dCMz_dCL coefficient ---*/ + + position = text_line.find ("DCMZ_DCL_VALUE=",0); + if (position != string::npos) { + text_line.erase (0,15); dCMz_dCL_ = atof(text_line.c_str()); + } + + } + + } + } - MPI_File_close(&fhw); -#endif - - /*--- Carry on with ASCII metadata reading. ---*/ - - restart_file.open(val_filename.data(), ios::in); - if (restart_file.fail()) { - if (rank == MASTER_NODE) { - cout << " Warning: There is no restart file (" << val_filename.data() << ")."<< endl; - cout << " Computation will continue without updating metadata parameters." << endl; - } - } else { - - unsigned long iPoint_Global = 0; - string text_line; - - /*--- The first line is the header (General description) ---*/ - - getline (restart_file, text_line); - - /*--- Space for the solution ---*/ - - for (iPoint_Global = 0; iPoint_Global < geometry->GetGlobal_nPointDomain(); iPoint_Global++ ) { - - getline (restart_file, text_line); - - } - - /*--- Space for extra info (if any) ---*/ - - while (getline (restart_file, text_line)) { - - /*--- External iteration ---*/ - - position = text_line.find ("EXT_ITER=",0); - if (position != string::npos) { - text_line.erase (0,9); ExtIter_ = atoi(text_line.c_str()); - } - - /*--- Angle of attack ---*/ - - position = text_line.find ("AOA=",0); - if (position != string::npos) { - text_line.erase (0,4); AoA_ = atof(text_line.c_str()); - } - - /*--- Sideslip angle ---*/ - - position = text_line.find ("SIDESLIP_ANGLE=",0); - if (position != string::npos) { - text_line.erase (0,15); AoS_ = atof(text_line.c_str()); - } - - /*--- BCThrust angle ---*/ - - position = text_line.find ("INITIAL_BCTHRUST=",0); - if (position != string::npos) { - text_line.erase (0,17); BCThrust_ = atof(text_line.c_str()); - } - - if (adjoint_run) { - - if (config->GetEval_dOF_dCX() == true) { - - /*--- dCD_dCL coefficient ---*/ - - position = text_line.find ("DCD_DCL_VALUE=",0); - if (position != string::npos) { - text_line.erase (0,14); dCD_dCL_ = atof(text_line.c_str()); - } - - /*--- dCMx_dCL coefficient ---*/ - - position = text_line.find ("DCMX_DCL_VALUE=",0); - if (position != string::npos) { - text_line.erase (0,15); dCMx_dCL_ = atof(text_line.c_str()); - } - - /*--- dCMy_dCL coefficient ---*/ - - position = text_line.find ("DCMY_DCL_VALUE=",0); - if (position != string::npos) { - text_line.erase (0,15); dCMy_dCL_ = atof(text_line.c_str()); - } - - /*--- dCMz_dCL coefficient ---*/ - - position = text_line.find ("DCMZ_DCL_VALUE=",0); - if (position != string::npos) { - text_line.erase (0,15); dCMz_dCL_ = atof(text_line.c_str()); - } - - } - - } - - } - - - /*--- Close the restart meta file. ---*/ - - restart_file.close(); - - } - } + /*--- Close the restart meta file. ---*/ + + restart_file.close(); + + } + /*--- Load the metadata. ---*/ @@ -4994,7 +4759,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo /*--- External iteration ---*/ if ((config->GetDiscard_InFiles() == false) && (!adjoint || (adjoint && config->GetRestart()))) - config->SetExtIter_OffSet(ExtIter_); + config->SetExtIter_OffSet(InnerIter_); } @@ -5132,9 +4897,9 @@ void CSolver::LoadInletProfile(CGeometry **geometry, unsigned short iDim, iVar, iMesh, iMarker, jMarker; unsigned long iPoint, iVertex, index, iChildren, Point_Fine, iRow; su2double Area_Children, Area_Parent, *Coord, dist, min_dist; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; string UnstExt, text_line; ifstream restart_file; @@ -5155,12 +4920,12 @@ void CSolver::LoadInletProfile(CGeometry **geometry, /*--- Multizone problems require the number of the zone to be appended. ---*/ if (nZone > 1) - profile_filename = config->GetMultizone_FileName(profile_filename, iZone); + profile_filename = config->GetMultizone_FileName(profile_filename, iZone, ".dat"); /*--- Modify file name for an unsteady restart ---*/ if (dual_time || time_stepping) - profile_filename = config->GetUnsteady_FileName(profile_filename, val_iter); + profile_filename = config->GetUnsteady_FileName(profile_filename, val_iter, ".dat"); /*--- Open the file and check for problems. If a file can not be found, then a warning will be printed, but the calculation will continue @@ -5593,6 +5358,46 @@ void CSolver::SetVerificationSolution(unsigned short nDim, } } +void CSolver::ComputeResidual_Multizone(CGeometry *geometry, CConfig *config){ + + unsigned short iVar; + unsigned long iPoint; + su2double residual; + + /*--- Set Residuals to zero ---*/ + + for (iVar = 0; iVar < nVar; iVar++){ + SetRes_BGS(iVar,0.0); + SetRes_Max_BGS(iVar,0.0,0); + } + + /*--- Set the residuals ---*/ + for (iPoint = 0; iPoint < nPointDomain; iPoint++){ + for (iVar = 0; iVar < nVar; iVar++){ + residual = node[iPoint]->GetSolution(iVar) - node[iPoint]->Get_BGSSolution_k(iVar); + AddRes_BGS(iVar,residual*residual); + AddRes_Max_BGS(iVar,fabs(residual),geometry->node[iPoint]->GetGlobalIndex(),geometry->node[iPoint]->GetCoord()); + } + } + + SetResidual_BGS(geometry, config); + +} + + +void CSolver::UpdateSolution_BGS(CGeometry *geometry, CConfig *config){ + + unsigned long iPoint; + + /*--- To nPoint: The solution must be communicated beforehand ---*/ + for (iPoint = 0; iPoint < nPoint; iPoint++){ + + node[iPoint]->Set_BGSSolution_k(); + + } + +} + CBaselineSolver::CBaselineSolver(void) : CSolver() { } CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config) { @@ -5609,7 +5414,7 @@ CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config) { /*--- Routines to access the number of variables and string names. ---*/ SetOutputVariables(geometry, config); - + /*--- Initialize a zero solution and instantiate the CVariable class. ---*/ Solution = new su2double[nVar]; @@ -5626,14 +5431,16 @@ CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config) { } -CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config, unsigned short nVar, vector field_names) { +CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config, unsigned short val_nvar, vector field_names) { unsigned long iPoint; unsigned short iVar; + nVar = val_nvar; + nPoint = geometry->GetnPoint(); - config->fields = field_names; + fields = field_names; Solution = new su2double[nVar]; @@ -5663,12 +5470,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- Open the restart file and extract the nVar and field names. ---*/ - string Tag, text_line, AdjExt, UnstExt; - unsigned long iExtIter = config->GetExtIter(); - bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); - - unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry->GetnZone(); + string Tag, text_line; ifstream restart_file; string filename; @@ -5678,30 +5480,18 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { if (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()) { filename = config->GetSolution_AdjFileName(); filename = config->GetObjFunc_Extension(filename); - } else if (fem) { - filename = config->GetSolution_FEMFileName(); } else { - filename = config->GetSolution_FlowFileName(); + filename = config->GetSolution_FileName(); } - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) - filename = config->GetMultiInstance_FileName(filename, config->GetiInst()); - - /*--- Unsteady problems require an iteration number to be appended. ---*/ - if (config->GetWrt_Unsteady()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); - } else if (config->GetWrt_Dynamic()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); - } /*--- Read only the number of variables in the restart file. ---*/ if (config->GetRead_Binary_Restart()) { + + /*--- Multizone problems require the number of the zone to be appended. ---*/ + + filename = config->GetFilename(filename, ".dat", config->GetTimeIter()); char fname[100]; strcpy(fname, filename.c_str()); @@ -5742,13 +5532,22 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- Close the file. ---*/ fclose(fhw); + + /*--- Set the number of variables, one per field in the + restart file (without including the PointID) ---*/ + nVar = var_buf[1]; #else /*--- Parallel binary input using MPI I/O. ---*/ MPI_File fhw; int ierr; + MPI_Offset disp; + unsigned short iVar; + unsigned long index, iChar; + string field_buf; + char str_buf[CGNS_STRING_SIZE]; /*--- All ranks open the file using MPI. ---*/ @@ -5782,18 +5581,53 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { string("possible with the WRT_BINARY_RESTART / READ_BINARY_RESTART options."), CURRENT_FUNCTION); } - /*--- All ranks close the file after writing. ---*/ - - MPI_File_close(&fhw); -#endif /*--- Set the number of variables, one per field in the restart file (without including the PointID) ---*/ nVar = var_buf[1]; - + + /*--- Read the variable names from the file. Note that we are adopting a + fixed length of 33 for the string length to match with CGNS. This is + needed for when we read the strings later. ---*/ + + char *mpi_str_buf = new char[nVar*CGNS_STRING_SIZE]; + if (rank == MASTER_NODE) { + disp = nVar_Buf*sizeof(int); + MPI_File_read_at(fhw, disp, mpi_str_buf, nVar*CGNS_STRING_SIZE, + MPI_CHAR, MPI_STATUS_IGNORE); + } + + /*--- Broadcast the string names of the variables. ---*/ + + SU2_MPI::Bcast(mpi_str_buf, nVar*CGNS_STRING_SIZE, MPI_CHAR, + MASTER_NODE, MPI_COMM_WORLD); + + fields.push_back("Point_ID"); + + for (iVar = 0; iVar < nVar; iVar++) { + index = iVar*CGNS_STRING_SIZE; + field_buf.append("\""); + for (iChar = 0; iChar < (unsigned long)CGNS_STRING_SIZE; iChar++) { + str_buf[iChar] = mpi_str_buf[index + iChar]; + } + field_buf.append(str_buf); + field_buf.append("\""); + fields.push_back(field_buf.c_str()); + field_buf.clear(); + } + + /*--- All ranks close the file after writing. ---*/ + + MPI_File_close(&fhw); + +#endif } else { + + /*--- Multizone problems require the number of the zone to be appended. ---*/ + + filename = config->GetFilename(filename, ".csv", config->GetTimeIter()); /*--- First, check that this is not a binary restart file. ---*/ @@ -5888,12 +5722,12 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { getline (restart_file, text_line); - stringstream ss(text_line); - while (ss >> Tag) { - config->fields.push_back(Tag); - if (ss.peek() == ',') ss.ignore(); + fields = PrintingToolbox::split(text_line, ','); + + for (unsigned short iField = 0; iField < fields.size(); iField++){ + PrintingToolbox::trim(fields[iField]); } - + /*--- Close the file (the solution date is read later). ---*/ restart_file.close(); @@ -5901,11 +5735,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { /*--- Set the number of variables, one per field in the restart file (without including the PointID) ---*/ - nVar = config->fields.size() - 1; - - /*--- Clear the fields vector since we'll read it again. ---*/ - - config->fields.clear(); + nVar = fields.size() - 1; } @@ -5917,14 +5747,8 @@ void CBaselineSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf string filename; unsigned long index; - string UnstExt, text_line, AdjExt; - ifstream solution_file; unsigned short iDim, iVar; - unsigned long iExtIter = config->GetExtIter(); - bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); bool adjoint = ( config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint() ); - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); unsigned short iInst = config->GetiInst(); bool steady_restart = config->GetSteadyRestart(); unsigned short turb_model = config->GetKind_Turb_Model(); @@ -5942,27 +5766,11 @@ void CBaselineSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf if (adjoint) { filename = config->GetSolution_AdjFileName(); filename = config->GetObjFunc_Extension(filename); - } else if (fem) { - filename = config->GetSolution_FEMFileName(); } else { - filename = config->GetSolution_FlowFileName(); + filename = config->GetSolution_FileName(); } - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1 ) - filename = config->GetMultizone_FileName(filename, iZone); - - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) - filename = config->GetMultiInstance_FileName(filename, config->GetiInst()); - - /*--- Unsteady problems require an iteration number to be appended. ---*/ - - if (config->GetWrt_Unsteady() || config->GetUnsteady_Simulation() != HARMONIC_BALANCE) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); - } else if (config->GetWrt_Dynamic()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); - } + filename = config->GetFilename(filename, "", val_iter); /*--- Output the file name to the console. ---*/ @@ -6075,36 +5883,20 @@ void CBaselineSolver::LoadRestart_FSI(CGeometry *geometry, CConfig *config, int /*--- Restart the solution from file information ---*/ string filename; unsigned long index; - string UnstExt, text_line, AdjExt; - ifstream solution_file; unsigned short iVar; - unsigned long iExtIter = config->GetExtIter(); - bool fem = (config->GetKind_Solver() == FEM_ELASTICITY); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); - unsigned short iZone = config->GetiZone(); - unsigned short nZone = geometry->GetnZone(); /*--- Retrieve filename from config ---*/ if (adjoint) { filename = config->GetSolution_AdjFileName(); filename = config->GetObjFunc_Extension(filename); - } else if (fem) { - filename = config->GetSolution_FEMFileName(); } else { - filename = config->GetSolution_FlowFileName(); + filename = config->GetSolution_FileName(); } /*--- Multizone problems require the number of the zone to be appended. ---*/ - if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); - - /*--- Unsteady problems require an iteration number to be appended. ---*/ - if (config->GetWrt_Unsteady() || config->GetUnsteady_Simulation() != HARMONIC_BALANCE) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); - } else if (config->GetWrt_Dynamic()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); - } + filename = config->GetFilename(filename, "", val_iter); /*--- Output the file name to the console. ---*/ @@ -6219,19 +6011,19 @@ void CBaselineSolver_FEM::SetOutputVariables(CGeometry *geometry, CConfig *confi /*--- Open the restart file and extract the nVar and field names. ---*/ string Tag, text_line, AdjExt, UnstExt; - unsigned long iExtIter = config->GetExtIter(); + unsigned long TimeIter = config->GetTimeIter(); ifstream restart_file; string filename; /*--- Retrieve filename from config ---*/ - filename = config->GetSolution_FlowFileName(); + filename = config->GetSolution_FileName(); /*--- Unsteady problems require an iteration number to be appended. ---*/ - if (config->GetWrt_Unsteady()) { - filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(iExtIter)); + if (config->GetTime_Domain()) { + filename = config->GetUnsteady_FileName(filename, SU2_TYPE::Int(TimeIter), ".dat"); } /*--- Read only the number of variables in the restart file. ---*/ @@ -6445,13 +6237,10 @@ void CBaselineSolver_FEM::LoadRestart(CGeometry **geometry, CSolver ***solver, C unsigned short iVar; unsigned long index; - string UnstExt, text_line; - ifstream restart_file; - - string restart_filename = config->GetSolution_FlowFileName(); + string restart_filename = config->GetSolution_FileName(); - if (config->GetWrt_Unsteady()) { - restart_filename = config->GetUnsteady_FileName(restart_filename, SU2_TYPE::Int(val_iter)); + if (config->GetTime_Domain()) { + restart_filename = config->GetUnsteady_FileName(restart_filename, SU2_TYPE::Int(val_iter), ""); } int counter = 0; diff --git a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp index 437440c9cf9b..c9a66616f636 100644 --- a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp @@ -231,7 +231,7 @@ void CDiscAdjMeshSolver::SetSensitivity(CGeometry *geometry, CSolver **solver, C unsigned long iPoint; unsigned short iDim; su2double Sensitivity, eps; - bool time_stepping = (config->GetUnsteady_Simulation() != STEADY); + bool time_stepping = (config->GetTime_Marching() != STEADY); /*--- Extract the sensitivities ---*/ ExtractAdjoint_Solution(geometry, config); diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 80c64b9666fa..628f63f1a7b4 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -71,8 +71,6 @@ CMeshSolver::CMeshSolver(CGeometry *geometry, CConfig *config) : CFEASolver(true nPointDomain = geometry->GetnPointDomain(); nElement = geometry->GetnElem(); - valResidual = 0.0; - MinVolume_Ref = 0.0; MinVolume_Curr = 0.0; @@ -135,15 +133,6 @@ CMeshSolver::CMeshSolver(CGeometry *geometry, CConfig *config) : CFEASolver(true /*--- Element container structure ---*/ - /*--- First level: only the FEA_TERM is considered ---*/ - element_container = new CElement** [1]; - element_container[FEA_TERM] = new CElement* [MAX_FE_KINDS]; - - /*--- Initialize all subsequent levels ---*/ - for (unsigned short iKind = 0; iKind < MAX_FE_KINDS; iKind++) { - element_container[FEA_TERM][iKind] = NULL; - } - if (nDim == 2) { element_container[FEA_TERM][EL_TRIA] = new CTRIA1(nDim, config); element_container[FEA_TERM][EL_QUAD] = new CQUAD4(nDim, config); @@ -216,29 +205,9 @@ CMeshSolver::CMeshSolver(CGeometry *geometry, CConfig *config) : CFEASolver(true } CMeshSolver::~CMeshSolver(void) { - - unsigned short iDim; - - delete [] Residual; - delete [] Solution; - - for (iDim = 0; iDim < nDim; iDim++) { - delete [] mZeros_Aux[iDim]; - delete [] mId_Aux[iDim]; - delete [] Jacobian_ij[iDim]; - } - delete [] mZeros_Aux; - delete [] mId_Aux; - delete [] Jacobian_ij; - - if (element_container != NULL) { - for (unsigned short jVar = 0; jVar < MAX_FE_KINDS; jVar++) { - if (element_container[FEA_TERM][jVar] != NULL) delete element_container[FEA_TERM][jVar]; - } - delete [] element_container[FEA_TERM]; - delete [] element_container; - } - + + if (Coordinate != NULL) delete [] Coordinate; + if (element !=NULL ) delete [] element; } void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool updated) { @@ -250,15 +219,10 @@ void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool upd su2double MaxVolume, MinVolume; int EL_KIND = 0; - bool discrete_adjoint = config->GetDiscrete_Adjoint(); - bool RightVol = true; su2double ElemVolume; - if ((rank == MASTER_NODE) && (!discrete_adjoint)) - cout << "Computing volumes of the grid elements." << endl; - MaxVolume = -1E22; MinVolume = 1E22; /*--- Loops over all the elements ---*/ @@ -500,22 +464,11 @@ void CMeshSolver::SetMesh_Stiffness(CGeometry **geometry, CNumerics **numerics, void CMeshSolver::DeformMesh(CGeometry **geometry, CNumerics **numerics, CConfig *config){ - bool discrete_adjoint = config->GetDiscrete_Adjoint(); - if (multizone) SetSolution_Old(); /*--- Initialize sparse matrix ---*/ Jacobian.SetValZero(); - /*--- Compute the minimum and maximum area/volume for the mesh. ---*/ - if (rank == MASTER_NODE) { - if (discrete_adjoint) cout << scientific; // Ensure the mesh deformation output, if requested, remains scientific - else{ - if (nDim == 2) cout << scientific << "Min. area in the undeformed mesh: "<< MinVolume_Ref <<", max. area: " << MaxVolume_Ref <<"." << endl; - else cout << scientific << "Min. volume in the undeformed mesh: "<< MinVolume_Ref <<", max. volume: " << MaxVolume_Ref <<"." << endl; - } - } - /*--- Compute the stiffness matrix. ---*/ Compute_StiffMatrix(geometry[MESH_0], numerics, config); @@ -554,12 +507,6 @@ void CMeshSolver::DeformMesh(CGeometry **geometry, CNumerics **numerics, CConfig /*--- In order to do this, we recompute the minimum and maximum area/volume for the mesh using the current coordinates. ---*/ SetMinMaxVolume(geometry[MESH_0], config, true); - if ((rank == MASTER_NODE) && (!discrete_adjoint)) { - cout << scientific << "Linear solver iter.: " << IterLinSol << ". "; - if (nDim == 2) cout << "Min. area in the deformed mesh: " << MinVolume_Curr << ". Error: " << valResidual << "." << endl; - else cout << "Min. volume in the deformed mesh: " << MinVolume_Curr << ". Error: " << valResidual << "." << endl; - } - /*--- The Grid Velocity is only computed if the problem is time domain ---*/ if (time_domain) ComputeGridVelocity(geometry[MESH_0], config); @@ -642,9 +589,9 @@ void CMeshSolver::ComputeGridVelocity(CGeometry *geometry, CConfig *config){ /*--- Compute mesh velocity with 1st or 2nd-order approximation ---*/ for (iDim = 0; iDim < nDim; iDim++) { - if (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == DT_STEPPING_1ST) GridVel = ( Disp_nP1[iDim] - Disp_n[iDim] ) / TimeStep; - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == DT_STEPPING_2ND) GridVel = ( 3.0*Disp_nP1[iDim] - 4.0*Disp_n[iDim] + 1.0*Disp_nM1[iDim] ) / (2.0*TimeStep); @@ -764,35 +711,21 @@ void CMeshSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * /*--- Restart the solution from file information ---*/ unsigned short iDim; unsigned long index; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool time_stepping = config->GetUnsteady_Simulation() == TIME_STEPPING; su2double curr_coord, displ; string UnstExt, text_line; ifstream restart_file; - unsigned short iZone = config->GetiZone(); - unsigned short nZone = config->GetnZone(); - - string restart_filename = config->GetSolution_FlowFileName(); + string restart_filename = config->GetSolution_FileName(); int counter = 0; long iPoint_Local = 0; unsigned long iPoint_Global = 0; unsigned long iPoint_Global_Local = 0; unsigned short rbuf_NotMatching = 0, sbuf_NotMatching = 0; - /*--- Multizone problems require the number of the zone to be appended. ---*/ - - if (nZone > 1) - restart_filename = config->GetMultizone_FileName(restart_filename, iZone); - - /*--- Modify file name for an unsteady restart ---*/ - - if (dual_time || time_stepping) - restart_filename = config->GetUnsteady_FileName(restart_filename, val_iter); - + restart_filename = config->GetFilename(restart_filename, "", val_iter); + /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ if (config->GetRead_Binary_Restart()) { @@ -919,7 +852,7 @@ void CMeshSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { unsigned short iZone = config->GetiZone(); unsigned short nZone = geometry->GetnZone(); unsigned short iDim; - string filename = config->GetSolution_FlowFileName(); + string filename = config->GetSolution_FileName(); string filename_n; /*--- Auxiliary variables for storing the coordinates ---*/ @@ -934,15 +867,15 @@ void CMeshSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { /*--- Multizone problems require the number of the zone to be appended. ---*/ if (nZone > 1) - filename = config->GetMultizone_FileName(filename, iZone); + filename = config->GetMultizone_FileName(filename, iZone, ""); /*-------------------------------------------------------------------------------------------*/ /*----------------------- First, load the restart file for time n ---------------------------*/ /*-------------------------------------------------------------------------------------------*/ /*--- Modify file name for an unsteady restart ---*/ - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-1; - filename_n = config->GetUnsteady_FileName(filename, Unst_RestartIter); + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; + filename_n = config->GetUnsteady_FileName(filename, Unst_RestartIter, ""); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ @@ -1007,7 +940,7 @@ void CMeshSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { /*------------ Now, load the restart file for time n-1, if the simulation is 2nd Order ------*/ /*-------------------------------------------------------------------------------------------*/ - if (config->GetUnsteady_Simulation() == DT_STEPPING_2ND) { + if (config->GetTime_Marching() == DT_STEPPING_2ND) { ifstream restart_file_n1; string filename_n1; @@ -1017,8 +950,8 @@ void CMeshSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { rbuf_NotMatching = 0; sbuf_NotMatching = 0; /*--- Modify file name for an unsteady restart ---*/ - Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_RestartIter())-2; - filename_n1 = config->GetUnsteady_FileName(filename, Unst_RestartIter); + Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; + filename_n1 = config->GetUnsteady_FileName(filename, Unst_RestartIter, ""); /*--- Read the restart data from either an ASCII or binary SU2 file. ---*/ diff --git a/SU2_CFD/src/variables/CAdjEulerVariable.cpp b/SU2_CFD/src/variables/CAdjEulerVariable.cpp index bca84cd6548f..d97a308fa0ec 100644 --- a/SU2_CFD/src/variables/CAdjEulerVariable.cpp +++ b/SU2_CFD/src/variables/CAdjEulerVariable.cpp @@ -54,8 +54,8 @@ CAdjEulerVariable::CAdjEulerVariable(su2double val_psirho, su2double *val_phi, s unsigned short iVar, iDim, iMesh, nMGSmooth = 0; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Array initialization ---*/ Psi = NULL; @@ -131,12 +131,14 @@ CAdjEulerVariable::CAdjEulerVariable(su2double val_psirho, su2double *val_phi, s IntBoundary_Jump[iVar] = 0.0; /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { HB_Source = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) HB_Source[iVar] = 0.0; } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CAdjEulerVariable::CAdjEulerVariable(su2double *val_solution, unsigned short val_nDim, unsigned short val_nvar, @@ -144,8 +146,8 @@ CAdjEulerVariable::CAdjEulerVariable(su2double *val_solution, unsigned short val unsigned short iVar, iDim, iMesh, nMGSmooth = 0; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Array initialization ---*/ Psi = NULL; @@ -216,12 +218,14 @@ CAdjEulerVariable::CAdjEulerVariable(su2double *val_solution, unsigned short val IntBoundary_Jump[iVar] = 0.0; /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { HB_Source = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) HB_Source[iVar] = 0.0; } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CAdjEulerVariable::~CAdjEulerVariable(void) { diff --git a/SU2_CFD/src/variables/CAdjTurbVariable.cpp b/SU2_CFD/src/variables/CAdjTurbVariable.cpp index 4b329d683ecc..eb7a671f35dc 100644 --- a/SU2_CFD/src/variables/CAdjTurbVariable.cpp +++ b/SU2_CFD/src/variables/CAdjTurbVariable.cpp @@ -74,7 +74,9 @@ CAdjTurbVariable::CAdjTurbVariable(su2double val_psinu_inf, unsigned short val_n Limiter = new su2double [nVar]; for (iVar = 0; iVar < nVar; iVar++) Limiter[iVar] = 0.0; - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CAdjTurbVariable::~CAdjTurbVariable(void) { diff --git a/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp b/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp index ec77b8cd9bf2..bc10bc8fa15a 100644 --- a/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjFEAVariable.cpp @@ -65,7 +65,6 @@ CDiscAdjFEAVariable::CDiscAdjFEAVariable() : CVariable(){ Geometry_CrossTerm_Derivative = NULL; Solution_BGS = NULL; - Solution_BGS_k = NULL; } @@ -108,22 +107,22 @@ CDiscAdjFEAVariable::CDiscAdjFEAVariable(su2double* val_solution, unsigned short } Solution_BGS = NULL; - Solution_BGS_k = NULL; Cross_Term_Derivative = NULL; Geometry_CrossTerm_Derivative = NULL; if (fsi){ Cross_Term_Derivative = new su2double[nDim]; Geometry_CrossTerm_Derivative = new su2double[nDim]; Solution_BGS = new su2double[nDim]; - Solution_BGS_k = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { Geometry_CrossTerm_Derivative [iDim] = 0.0; Cross_Term_Derivative[iDim] = 0.0; Solution_BGS[iDim] = 0.0; - Solution_BGS_k[iDim] = 0.0; } } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); + } CDiscAdjFEAVariable::CDiscAdjFEAVariable(su2double* val_solution, su2double* val_solution_accel, su2double* val_solution_vel, @@ -241,6 +240,5 @@ CDiscAdjFEAVariable::~CDiscAdjFEAVariable(){ if (Geometry_CrossTerm_Derivative != NULL) delete [] Geometry_CrossTerm_Derivative; if (Solution_BGS != NULL) delete [] Solution_BGS; - if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; } diff --git a/SU2_CFD/src/variables/CDiscAdjVariable.cpp b/SU2_CFD/src/variables/CDiscAdjVariable.cpp index dc2558f59cb0..c84c43b8ad4d 100644 --- a/SU2_CFD/src/variables/CDiscAdjVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjVariable.cpp @@ -64,8 +64,8 @@ CDiscAdjVariable::CDiscAdjVariable() : CVariable() { CDiscAdjVariable::CDiscAdjVariable(su2double* val_solution, unsigned short val_ndim, unsigned short val_nvar, CConfig *config) : CVariable(val_ndim, val_nvar, config) { - bool dual_time = (config->GetUnsteady_Simulation() == DT_STEPPING_1ST) - || (config->GetUnsteady_Simulation() == DT_STEPPING_2ND); + bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) + || (config->GetTime_Marching() == DT_STEPPING_2ND); bool fsi = config->GetFSI_Simulation(); @@ -83,7 +83,6 @@ CDiscAdjVariable::CDiscAdjVariable(su2double* val_solution, unsigned short val_n Cross_Term_Derivative = NULL; Solution_BGS = NULL; - Solution_BGS_k = NULL; Solution_Geometry_BGS_k = NULL; Geometry_CrossTerm_Derivative = NULL; @@ -126,7 +125,6 @@ CDiscAdjVariable::CDiscAdjVariable(su2double* val_solution, unsigned short val_n Geometry_CrossTerm_Derivative_Flow = new su2double[nDim]; Cross_Term_Derivative = new su2double[nVar]; Solution_BGS = new su2double[nVar]; - Solution_BGS_k = new su2double[nVar]; Solution_Geometry_BGS_k = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { Geometry_Direct[iDim] = 0.0; @@ -139,9 +137,11 @@ CDiscAdjVariable::CDiscAdjVariable(su2double* val_solution, unsigned short val_n for (iVar = 0; iVar < nVar; iVar++) { Cross_Term_Derivative[iVar] = 0.0; Solution_BGS[iVar] = 0.0; - Solution_BGS_k[iVar] = 0.0; } } + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } @@ -154,7 +154,6 @@ CDiscAdjVariable::~CDiscAdjVariable() { if (Geometry_CrossTerm_Derivative != NULL) delete [] Geometry_CrossTerm_Derivative; if (Geometry_CrossTerm_Derivative_Flow != NULL) delete [] Geometry_CrossTerm_Derivative_Flow; if (Solution_BGS != NULL) delete [] Solution_BGS; - if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; if (Solution_Geometry_BGS_k != NULL) delete [] Solution_Geometry_BGS_k; if (Solution_Direct != NULL) delete [] Solution_Direct; diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index 00348a2b926b..17a939b2bff5 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -62,20 +62,17 @@ CEulerVariable::CEulerVariable(void) : CVariable() { Solution_New = NULL; - Solution_BGS_k = NULL; } CEulerVariable::CEulerVariable(su2double val_density, su2double *val_velocity, su2double val_energy, unsigned short val_nDim, unsigned short val_nvar, CConfig *config) : CVariable(val_nDim, val_nvar, config) { unsigned short iVar, iDim, iMesh, nMGSmooth = 0; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool viscous = config->GetViscous(); bool windgust = config->GetWind_Gust(); bool classical_rk4 = (config->GetKind_TimeIntScheme_Flow() == CLASSICAL_RK4_EXPLICIT); - bool fsi = config->GetFSI_Simulation(); - bool multizone = config->GetMultizone_Problem(); /*--- Array initialization ---*/ @@ -190,7 +187,7 @@ CEulerVariable::CEulerVariable(su2double val_density, su2double *val_velocity, s /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { HB_Source = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) HB_Source[iVar] = 0.0; } @@ -226,29 +223,19 @@ CEulerVariable::CEulerVariable(su2double val_density, su2double *val_velocity, s for (iDim = 0; iDim < nDim; iDim++) Gradient_Secondary[iVar][iDim] = 0.0; } - - Solution_BGS_k = NULL; - if (fsi || multizone){ - Solution_BGS_k = new su2double [nVar]; - Solution_BGS_k[0] = val_density; - for (iDim = 0; iDim < nDim; iDim++) { - Solution_BGS_k[iDim+1] = val_density*val_velocity[iDim]; - } - Solution_BGS_k[nVar-1] = val_density*val_energy; - } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CEulerVariable::CEulerVariable(su2double *val_solution, unsigned short val_nDim, unsigned short val_nvar, CConfig *config) : CVariable(val_nDim, val_nvar, config) { unsigned short iVar, iDim, iMesh, nMGSmooth = 0; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool viscous = config->GetViscous(); bool windgust = config->GetWind_Gust(); bool classical_rk4 = (config->GetKind_TimeIntScheme_Flow() == CLASSICAL_RK4_EXPLICIT); - bool fsi = config->GetFSI_Simulation(); - bool multizone = config->GetMultizone_Problem(); /*--- Array initialization ---*/ @@ -355,7 +342,7 @@ CEulerVariable::CEulerVariable(su2double *val_solution, unsigned short val_nDim, /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { HB_Source = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) HB_Source[iVar] = 0.0; } @@ -392,15 +379,9 @@ CEulerVariable::CEulerVariable(su2double *val_solution, unsigned short val_nDim, for (iDim = 0; iDim < nDim; iDim++) Gradient_Secondary[iVar][iDim] = 0.0; } - - Solution_BGS_k = NULL; - if (fsi || multizone){ - Solution_BGS_k = new su2double [nVar]; - for (iVar = 0; iVar < nVar; iVar++) { - Solution_BGS_k[iVar] = val_solution[iVar]; - } - } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CEulerVariable::~CEulerVariable(void) { @@ -426,9 +407,6 @@ CEulerVariable::~CEulerVariable(void) { } if (Solution_New != NULL) delete [] Solution_New; - - if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; - } void CEulerVariable::SetGradient_PrimitiveZero(unsigned short val_primvar) { diff --git a/SU2_CFD/src/variables/CFEAVariable.cpp b/SU2_CFD/src/variables/CFEAVariable.cpp index 6f42ba78f965..a953cc5c5917 100644 --- a/SU2_CFD/src/variables/CFEAVariable.cpp +++ b/SU2_CFD/src/variables/CFEAVariable.cpp @@ -55,9 +55,6 @@ CFEAVariable::CFEAVariable(void) : CVariable() { Prestretch = NULL; // Prestretch geometry Reference_Geometry = NULL; // Reference geometry for optimization purposes - - Solution_BGS_k = NULL; // Old solution stored to check convergence in the BGS loop - } CFEAVariable::CFEAVariable(su2double *val_fea, unsigned short val_nDim, unsigned short val_nvar, @@ -73,7 +70,7 @@ CFEAVariable::CFEAVariable(su2double *val_fea, unsigned short val_nDim, unsigned bool refgeom = config->GetRefGeom(); // Reference geometry needs to be stored - bool dynamic_analysis = (config->GetDynamic_Analysis() == DYNAMIC); + bool dynamic_analysis = (config->GetTime_Domain()); bool fsi_analysis = (config->GetnMarker_Fluid_Load() > 0); VonMises_Stress = 0.0; @@ -93,8 +90,6 @@ CFEAVariable::CFEAVariable(su2double *val_fea, unsigned short val_nDim, unsigned Prestretch = NULL; // Prestretch geometry Reference_Geometry = NULL; // Reference geometry for optimization purposes - Solution_BGS_k = NULL; // Old solution stored to check convergence in the BGS loop - if (nDim == 2) Stress = new su2double [3]; else if (nDim == 3) Stress = new su2double [6]; @@ -115,15 +110,12 @@ CFEAVariable::CFEAVariable(su2double *val_fea, unsigned short val_nDim, unsigned Solution_Accel_time_n[iVar] = val_fea[iVar+2*nVar]; } } - if (fsi_analysis) { Solution_Pred = new su2double [nVar]; - Solution_Pred_Old = new su2double [nVar]; - Solution_BGS_k = new su2double [nVar]; + Solution_Pred_Old = new su2double [nVar]; for (iVar = 0; iVar < nVar; iVar++) { Solution_Pred[iVar] = val_fea[iVar]; Solution_Pred_Old[iVar] = val_fea[iVar]; - Solution_BGS_k[iVar] = 0.0; } } @@ -151,7 +143,9 @@ CFEAVariable::CFEAVariable(su2double *val_fea, unsigned short val_nDim, unsigned if (refgeom) Reference_Geometry = new su2double [nVar]; if (prestretch_fem) Prestretch = new su2double [nVar]; - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CFEAVariable::~CFEAVariable(void) { @@ -171,7 +165,5 @@ CFEAVariable::~CFEAVariable(void) { if (Reference_Geometry != NULL) delete [] Reference_Geometry; if (Prestretch != NULL) delete [] Prestretch; - if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; - } diff --git a/SU2_CFD/src/variables/CHeatFVMVariable.cpp b/SU2_CFD/src/variables/CHeatFVMVariable.cpp index 1d7cf9cf78f3..d140958f7b84 100644 --- a/SU2_CFD/src/variables/CHeatFVMVariable.cpp +++ b/SU2_CFD/src/variables/CHeatFVMVariable.cpp @@ -50,13 +50,11 @@ CHeatFVMVariable::CHeatFVMVariable(su2double val_Heat, unsigned short val_nDim, unsigned short iVar, iMesh, nMGSmooth = 0; bool low_fidelity = false; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); - bool multizone = config->GetMultizone_Problem(); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Array initialization ---*/ Solution_Direct = NULL; - Solution_BGS_k = NULL; /*--- Initialization of heat variable ---*/ Solution[0] = val_Heat; Solution_Old[0] = val_Heat; @@ -88,15 +86,12 @@ CHeatFVMVariable::CHeatFVMVariable(su2double val_Heat, unsigned short val_nDim, if (config->GetKind_ConvNumScheme_Heat() == SPACE_CENTERED) { Undivided_Laplacian = new su2double [nVar]; } - - if (multizone){ - Solution_BGS_k = new su2double [1]; - Solution_BGS_k[0] = val_Heat; - } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); + } CHeatFVMVariable::~CHeatFVMVariable(void) { - if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; if (Solution_Direct != NULL) delete [] Solution_Direct; } diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 62b997113a8b..8b2b1adab61a 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -52,9 +52,6 @@ CIncEulerVariable::CIncEulerVariable(void) : CVariable() { nSecondaryVar = 0; nSecondaryVarGrad = 0; - - Solution_BGS_k = NULL; - } CIncEulerVariable::CIncEulerVariable(su2double val_pressure, su2double *val_velocity, su2double val_temperature, @@ -63,12 +60,10 @@ CIncEulerVariable::CIncEulerVariable(su2double val_pressure, su2double *val_velo unsigned short iVar, iDim, iMesh, nMGSmooth = 0; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool viscous = config->GetViscous(); bool axisymmetric = config->GetAxisymmetric(); - bool fsi = config->GetFSI_Simulation(); - bool multizone = config->GetMultizone_Problem(); /*--- Array initialization ---*/ @@ -174,16 +169,6 @@ CIncEulerVariable::CIncEulerVariable(su2double val_pressure, su2double *val_velo if (axisymmetric && viscous) Grad_AuxVar = new su2double[nDim]; - Solution_BGS_k = NULL; - if (fsi || multizone){ - Solution_BGS_k = new su2double [nVar]; - Solution_BGS_k[0] = val_pressure; - for (iDim = 0; iDim < nDim; iDim++) { - Solution_BGS_k[iDim+1] = val_velocity[iDim]*config->GetDensity_FreeStreamND(); - } - Solution_BGS_k[nDim+1] = val_temperature; - } - } CIncEulerVariable::CIncEulerVariable(su2double *val_solution, unsigned short val_nDim, unsigned short val_nvar, @@ -191,12 +176,10 @@ CIncEulerVariable::CIncEulerVariable(su2double *val_solution, unsigned short val unsigned short iVar, iDim, iMesh, nMGSmooth = 0; - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); bool viscous = config->GetViscous(); bool axisymmetric = config->GetAxisymmetric(); - bool fsi = config->GetFSI_Simulation(); - bool multizone = config->GetMultizone_Problem(); /*--- Array initialization ---*/ @@ -294,15 +277,10 @@ CIncEulerVariable::CIncEulerVariable(su2double *val_solution, unsigned short val if (axisymmetric && viscous) Grad_AuxVar = new su2double[nDim]; - - Solution_BGS_k = NULL; - if (fsi || multizone){ - Solution_BGS_k = new su2double [nVar]; - for (iVar = 0; iVar < nVar; iVar++) { - Solution_BGS_k[iVar] = val_solution[iVar]; - } - } - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); + } CIncEulerVariable::~CIncEulerVariable(void) { @@ -317,8 +295,6 @@ CIncEulerVariable::~CIncEulerVariable(void) { delete [] Gradient_Primitive; } - if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; - } void CIncEulerVariable::SetGradient_PrimitiveZero(unsigned short val_primvar) { diff --git a/SU2_CFD/src/variables/CTransLMVariable.cpp b/SU2_CFD/src/variables/CTransLMVariable.cpp index bfcd3f928617..e2ed54b47016 100644 --- a/SU2_CFD/src/variables/CTransLMVariable.cpp +++ b/SU2_CFD/src/variables/CTransLMVariable.cpp @@ -45,7 +45,9 @@ CTransLMVariable::CTransLMVariable(su2double val_nu_tilde, su2double val_intermi // Initialization of variables Solution[0] = val_intermittency; Solution_Old[0] = val_intermittency; Solution[1] = val_REth; Solution_Old[1] = val_REth; - + + if (config->GetMultizone_Problem()) + Set_BGSSolution_k(); } CTransLMVariable::~CTransLMVariable(void) { } diff --git a/SU2_CFD/src/variables/CTurbSAVariable.cpp b/SU2_CFD/src/variables/CTurbSAVariable.cpp index 9bb9654008cd..cb8a897c1fc8 100644 --- a/SU2_CFD/src/variables/CTurbSAVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSAVariable.cpp @@ -43,8 +43,8 @@ CTurbSAVariable::CTurbSAVariable(void) : CTurbVariable() { } CTurbSAVariable::CTurbSAVariable(su2double val_nu_tilde, su2double val_muT, unsigned short val_nDim, unsigned short val_nvar, CConfig *config) : CTurbVariable(val_nDim, val_nvar, config) { - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Initialization of S-A variables ---*/ Solution[0] = val_nu_tilde; Solution_Old[0] = val_nu_tilde; diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index 01c5e010345e..3e8c11b9f4b5 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -44,8 +44,8 @@ CTurbSSTVariable::CTurbSSTVariable(su2double val_kine, su2double val_omega, su2d unsigned short val_nDim, unsigned short val_nvar, su2double *constants, CConfig *config) : CTurbVariable(val_nDim, val_nvar, config) { - bool dual_time = ((config->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config->GetUnsteady_Simulation() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || + (config->GetTime_Marching() == DT_STEPPING_2ND)); /*--- Initialization of variables ---*/ diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index e9a1d90b0149..a7ff233deb01 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -55,7 +55,7 @@ CTurbVariable::CTurbVariable(unsigned short val_nDim, unsigned short val_nvar, C /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == HARMONIC_BALANCE) { HB_Source = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) HB_Source[iVar] = 0.0; diff --git a/SU2_CFD/src/variables/CVariable.cpp b/SU2_CFD/src/variables/CVariable.cpp index b948adfc98e3..1a36edec7b3f 100644 --- a/SU2_CFD/src/variables/CVariable.cpp +++ b/SU2_CFD/src/variables/CVariable.cpp @@ -56,6 +56,7 @@ CVariable::CVariable(void) { Residual_Old = NULL; Residual_Sum = NULL; Solution_Adj_Old = NULL; + Solution_BGS_k = NULL; } @@ -77,6 +78,7 @@ CVariable::CVariable(unsigned short val_nvar, CConfig *config) { Residual_Old = NULL; Residual_Sum = NULL; Solution_Adj_Old = NULL; + Solution_BGS_k = NULL; /*--- Initialize the number of solution variables. This version of the constructor will be used primarily for converting the @@ -90,6 +92,9 @@ CVariable::CVariable(unsigned short val_nvar, CConfig *config) { for (unsigned short iVar = 0; iVar < nVar; iVar++) Solution[iVar] = 0.0; + if (config->GetMultizone_Problem()){ + Solution_BGS_k = new su2double[nVar](); + } } CVariable::CVariable(unsigned short val_nDim, unsigned short val_nvar, CConfig *config) { @@ -112,6 +117,7 @@ CVariable::CVariable(unsigned short val_nDim, unsigned short val_nvar, CConfig * Residual_Old = NULL; Residual_Sum = NULL; Solution_Adj_Old = NULL; + Solution_BGS_k = NULL; /*--- Initializate the number of dimension and number of variables ---*/ nDim = val_nDim; @@ -135,11 +141,11 @@ CVariable::CVariable(unsigned short val_nDim, unsigned short val_nvar, CConfig * Gradient[iVar][iDim] = 0.0; } - if (config->GetUnsteady_Simulation() != NO) { + if (config->GetTime_Marching() != NO) { Solution_time_n = new su2double [nVar]; Solution_time_n1 = new su2double [nVar]; } - else if (config->GetDynamic_Analysis() == DYNAMIC) { + else if (config->GetTime_Domain()) { Solution_time_n = new su2double [nVar]; for (iVar = 0; iVar < nVar; iVar++) Solution_time_n[iVar] = 0.0; } @@ -156,7 +162,13 @@ CVariable::CVariable(unsigned short val_nDim, unsigned short val_nvar, CConfig * Rmatrix[iDim][jDim] = 0.0; } } - + + if (config->GetMultizone_Problem()){ + Solution_BGS_k = new su2double[nVar](); + } + + Delta_Time = 0.0; + } CVariable::~CVariable(void) { @@ -175,6 +187,7 @@ CVariable::~CVariable(void) { if (Residual_Old != NULL) delete [] Residual_Old; if (Residual_Sum != NULL) delete [] Residual_Sum; if (Solution_Adj_Old != NULL) delete [] Solution_Adj_Old; + if (Solution_BGS_k != NULL) delete [] Solution_BGS_k; if (Gradient != NULL) { for (iVar = 0; iVar < nVar; iVar++) diff --git a/SU2_DEF/include/SU2_DEF.hpp b/SU2_DEF/include/SU2_DEF.hpp index c265a996a02e..99f7c9caa5ae 100644 --- a/SU2_DEF/include/SU2_DEF.hpp +++ b/SU2_DEF/include/SU2_DEF.hpp @@ -46,7 +46,7 @@ #include #include "../../SU2_CFD/include/solver_structure.hpp" -#include "../../SU2_CFD/include/output_structure.hpp" +#include "../../SU2_CFD/include/output/CMeshOutput.hpp" #include "../../Common/include/geometry_structure.hpp" #include "../../Common/include/config_structure.hpp" #include "../../Common/include/grid_movement_structure.hpp" diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index 33caa9d1bc3d..ad035c7f17e7 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { CGeometry **geometry_container = NULL; CSurfaceMovement **surface_movement = NULL; CVolumetricMovement **grid_movement = NULL; - COutput *output = NULL; + COutput **output = NULL; CConfig *driver_config = NULL; /*--- Load in the number of zones and spatial dimensions in the mesh file @@ -89,6 +89,7 @@ int main(int argc, char *argv[]) { geometry_container = new CGeometry*[nZone]; surface_movement = new CSurfaceMovement*[nZone]; grid_movement = new CVolumetricMovement*[nZone]; + output = new COutput*[nZone]; driver_config = NULL; @@ -97,6 +98,7 @@ int main(int argc, char *argv[]) { geometry_container[iZone] = NULL; surface_movement[iZone] = NULL; grid_movement[iZone] = NULL; + output[iZone] = NULL; } /*--- Initialize the configuration of the driver ---*/ @@ -210,25 +212,57 @@ int main(int argc, char *argv[]) { geometry_container[iZone]->SetBoundControlVolume(config_container[iZone], ALLOCATE); } - /*--- Create the point-to-point MPI communication structures. ---*/ geometry_container[iZone]->PreprocessP2PComms(geometry_container[iZone], config_container[iZone]); + /*--- Allocate the mesh output ---*/ + + output[iZone] = new CMeshOutput(config_container[iZone], geometry_container[iZone]->GetnDim()); + + /*--- Preprocess the volume output ---*/ + + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + + /*--- Preprocess history --- */ + + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + + } - /*--- initialization of output structure ---*/ - - output = new COutput(config_container[ZONE_0]); - + /*--- Output original grid for visualization, if requested (surface and volumetric) ---*/ if ((config_container[ZONE_0]->GetVisualize_Volume_Def() || config_container[ZONE_0]->GetVisualize_Surface_Def()) && config_container[ZONE_0]->GetDesign_Variable(0) != NO_DEFORMATION) { - output->SetMesh_Files(geometry_container, config_container, nZone, true, false); - + for (iZone = 0; iZone < nZone; iZone++){ + +// /*--- Load the data --- */ + +// output[iZone]->Load_Data(geometry_container[iZone], config_container[iZone], NULL); + +// if (config_container[iZone]->GetVisualize_Volume_Def()){ + +// /*--- If requested, write the volume output for visualization purposes --- */ + +// output[iZone]->SetVolume_Output(geometry_container[iZone], config_container[iZone], config->GetOutput_FileFormat(), false); + +// } + +// if (config_container[iZone]->GetVisualize_Surface_Def()){ + +// /*--- If requested, write the volume output for visualization purposes --- */ + +// output[iZone]->SetSurface_Output(geometry_container[iZone], config_container[iZone], config->GetOutput_FileFormat(), false); + +// } + +// output[iZone]->DeallocateData_Parallel(); + + } } /*--- Surface grid deformation using design variables ---*/ @@ -304,11 +338,30 @@ int main(int argc, char *argv[]) { /*--- Output deformed grid for visualization, if requested (surface and volumetric), in parallel requires to move all the data to the master node---*/ - - bool NewFile = false; - if (config_container[ZONE_0]->GetDesign_Variable(0) == NO_DEFORMATION) NewFile = true; - - output->SetMesh_Files(geometry_container, config_container, nZone, NewFile, true); + + for (iZone = 0; iZone < nZone; iZone++){ + + /*--- Load the data --- */ + + output[iZone]->Load_Data(geometry_container[iZone], config_container[iZone], NULL); + + output[iZone]->WriteToFile(config_container[iZone], geometry_container[iZone], MESH, config->GetMesh_Out_FileName()); + + /*--- Set the file names for the visualization files ---*/ + + output[iZone]->SetVolume_Filename("volume_deformed"); + output[iZone]->SetSurface_Filename("surface_deformed"); + + if (config_container[iZone]->GetVisualize_Volume_Def()){ + for (unsigned short iFile = 0; iFile < config_container[iZone]->GetnVolumeOutputFiles(); iFile++){ + unsigned short* FileFormat = config_container[iZone]->GetVolumeOutputFiles(); + if (FileFormat[iFile] != RESTART_ASCII && FileFormat[iFile] != RESTART_BINARY) + output[iZone]->WriteToFile(config_container[iZone], geometry_container[iZone], FileFormat[iFile]); + } + } + + } + if ((config_container[ZONE_0]->GetDesign_Variable(0) != NO_DEFORMATION) && (config_container[ZONE_0]->GetDesign_Variable(0) != SCALE_GRID) && @@ -366,9 +419,16 @@ int main(int argc, char *argv[]) { } delete [] config_container; } + if (output != NULL) { + for (iZone = 0; iZone < nZone; iZone++) { + if (output[iZone] != NULL) { + delete output[iZone]; + } + } + delete [] output; + } if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; - if (output != NULL) delete output; if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; /*--- Synchronization point after a single solver iteration. Compute the diff --git a/SU2_DEF/src/meson.build b/SU2_DEF/src/meson.build index ea534acd1707..de64bb1c555f 100644 --- a/SU2_DEF/src/meson.build +++ b/SU2_DEF/src/meson.build @@ -2,19 +2,30 @@ su2_def_src = ['SU2_DEF.cpp'] if get_option('enable-normal') su2_cfd_obj = su2_cfd.extract_objects(['solver_structure.cpp', - 'output_structure.cpp', - 'output_cgns.cpp', - 'output_fieldview.cpp', - 'output_paraview.cpp', - 'output_physics.cpp', - 'output_su2.cpp', - 'output_tecplot.cpp', - 'variables/CBaselineVariable.cpp', - 'variables/CVariable.cpp']) + 'output/COutput.cpp', + 'output/CMeshOutput.cpp', + 'output/output_structure_legacy.cpp', + 'variables/CBaselineVariable.cpp', + 'variables/CVariable.cpp', + 'output/filewriter/CParallelDataSorter.cpp', + 'output/filewriter/CFVMDataSorter.cpp', + 'output/filewriter/CFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFVMDataSorter.cpp', + 'output/filewriter/CParallelFileWriter.cpp', + 'output/filewriter/CParaviewFileWriter.cpp', + 'output/filewriter/CParaviewBinaryFileWriter.cpp', + 'output/filewriter/CTecplotFileWriter.cpp', + 'output/filewriter/CTecplotBinaryFileWriter.cpp', + 'output/filewriter/CCSVFileWriter.cpp', + 'output/filewriter/CSU2FileWriter.cpp', + 'output/filewriter/CSU2BinaryFileWriter.cpp', + 'output/filewriter/CSU2MeshFileWriter.cpp']) + su2_def = executable('SU2_DEF', - su2_def_src, - install: true, - dependencies: [su2_deps, common_dep], - objects : su2_cfd_obj, - cpp_args :[default_warning_flags, su2_cpp_args]) + su2_def_src, + install: true, + dependencies: [su2_deps, common_dep], + objects : su2_cfd_obj, + cpp_args :[default_warning_flags, su2_cpp_args]) endif diff --git a/SU2_DOT/include/SU2_DOT.hpp b/SU2_DOT/include/SU2_DOT.hpp index 557d4bca0a5b..5a557974f616 100644 --- a/SU2_DOT/include/SU2_DOT.hpp +++ b/SU2_DOT/include/SU2_DOT.hpp @@ -46,9 +46,11 @@ #include #include "../../Common/include/geometry_structure.hpp" +#include "../../Common/include/fem_geometry_structure.hpp" #include "../../Common/include/config_structure.hpp" #include "../../Common/include/grid_movement_structure.hpp" -#include "../../SU2_CFD/include/output_structure.hpp" +#include "../../SU2_CFD/include/output/CBaselineOutput.hpp" +#include "../../SU2_CFD/include/solver_structure.hpp" using namespace std; @@ -81,3 +83,13 @@ void SetProjection_AD(CGeometry *geometry, CConfig *config, CSurfaceMovement *su */ void OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_file); + +/*! + * \brief Write the sensitivity (including mesh sensitivity) computed with the discrete adjoint method + * on the surface and in the volume to a file. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] val_nZone - Number of Zones. + */ + +void SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned short val_nZone); diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 3f5e17b2abc6..0bfca1658ddf 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -70,7 +70,6 @@ int main(int argc, char *argv[]) { CGeometry ***geometry_container = NULL; CSurfaceMovement **surface_movement = NULL; CVolumetricMovement **grid_movement = NULL; - COutput *output = NULL; unsigned short *nInst = NULL; /*--- Load in the number of zones and spatial dimensions in the mesh file (if no config @@ -94,6 +93,7 @@ int main(int argc, char *argv[]) { geometry_container = new CGeometry**[nZone]; surface_movement = new CSurfaceMovement*[nZone]; grid_movement = new CVolumetricMovement*[nZone]; + nInst = new unsigned short[nZone]; driver_config = NULL; @@ -114,9 +114,9 @@ int main(int argc, char *argv[]) { /*--- Loop over all zones to initialize the various classes. In most cases, nZone is equal to one. This represents the solution of a partial differential equation on a single block, unstructured mesh. ---*/ - + for (iZone = 0; iZone < nZone; iZone++) { - + /*--- Definition of the configuration option class for all zones. In this constructor, the input configuration file is parsed and all options are read and stored. ---*/ @@ -312,8 +312,7 @@ int main(int argc, char *argv[]) { if (config_container[ZONE_0]->GetDiscrete_Adjoint()){ if (rank == MASTER_NODE) cout << endl <<"------------------------ Mesh sensitivity Output ------------------------" << endl; - output = new COutput(config_container[ZONE_0]); - output->SetSensitivity_Files(geometry_container, config_container, nZone); + SetSensitivity_Files(geometry_container, config_container, nZone); } if ((config_container[ZONE_0]->GetDesign_Variable(0) != NONE) && @@ -430,9 +429,6 @@ int main(int argc, char *argv[]) { } if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; - if (output != NULL) delete output; - if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; - if (cstr != NULL) delete cstr; /*--- Synchronization point after a single solver iteration. Compute the @@ -900,3 +896,129 @@ void OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_fi } } } + + +void SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned short val_nZone) { + + unsigned short iMarker,iDim, nDim, iVar, nMarker, nVar; + unsigned long iVertex, iPoint, nPoint, nVertex; + su2double *Normal, Prod, Sens = 0.0, SensDim, Area; + + unsigned short iZone; + + CSolver *solver = NULL; + COutput *output = NULL; + + + for (iZone = 0; iZone < val_nZone; iZone++) { + + nPoint = geometry[iZone][INST_0]->GetnPoint(); + nDim = geometry[iZone][INST_0]->GetnDim(); + nMarker = config[iZone]->GetnMarker_All(); + nVar = nDim + 1; + + /*--- We create a baseline solver to easily merge the sensitivity information ---*/ + + vector fieldnames; + fieldnames.push_back("\"Point\""); + fieldnames.push_back("\"x\""); + fieldnames.push_back("\"y\""); + if (nDim == 3) { + fieldnames.push_back("\"z\""); + } + fieldnames.push_back("\"Sensitivity_x\""); + fieldnames.push_back("\"Sensitivity_y\""); + if (nDim == 3) { + fieldnames.push_back("\"Sensitivity_z\""); + } + fieldnames.push_back("\"Surface_Sensitivity\""); + + solver = new CBaselineSolver(geometry[iZone][INST_0], config[iZone], nVar+nDim, fieldnames); + + for (iPoint = 0; iPoint < nPoint; iPoint++) { + for (iDim = 0; iDim < nDim; iDim++) { + solver->node[iPoint]->SetSolution(iDim, geometry[iZone][INST_0]->node[iPoint]->GetCoord(iDim)); + } + for (iVar = 0; iVar < nDim; iVar++) { + solver->node[iPoint]->SetSolution(iVar+nDim, geometry[iZone][INST_0]->GetSensitivity(iPoint, iVar)); + } + } + + /*--- Compute the sensitivity in normal direction ---*/ + + for (iMarker = 0; iMarker < nMarker; iMarker++) { + + if((config[iZone]->GetMarker_All_KindBC(iMarker) == HEAT_FLUX ) || + (config[iZone]->GetMarker_All_KindBC(iMarker) == EULER_WALL ) || + (config[iZone]->GetMarker_All_KindBC(iMarker) == ISOTHERMAL ) || + (config[iZone]->GetMarker_All_KindBC(iMarker) == CHT_WALL_INTERFACE )) { + + + nVertex = geometry[iZone][INST_0]->GetnVertex(iMarker); + + for (iVertex = 0; iVertex < nVertex; iVertex++) { + iPoint = geometry[iZone][INST_0]->vertex[iMarker][iVertex]->GetNode(); + Normal = geometry[iZone][INST_0]->vertex[iMarker][iVertex]->GetNormal(); + Prod = 0.0; + Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + + /*--- Retrieve the gradient calculated with discrete adjoint method ---*/ + + SensDim = geometry[iZone][INST_0]->GetSensitivity(iPoint, iDim); + + /*--- Calculate scalar product for projection onto the normal vector ---*/ + + Prod += Normal[iDim]*SensDim; + + Area += Normal[iDim]*Normal[iDim]; + } + + Area = sqrt(Area); + + /*--- Projection of the gradient onto the normal vector of the surface ---*/ + + Sens = Prod/Area; + + solver->node[iPoint]->SetSolution(2*nDim, Sens); + + } + } + } + + output = new CBaselineOutput(config[iZone], geometry[iZone][INST_0]->GetnDim(), solver); + output->PreprocessVolumeOutput(config[iZone]); + output->PreprocessHistoryOutput(config[iZone], false); + + /*--- Load the data --- */ + + output->Load_Data(geometry[iZone][INST_0], config[iZone], &solver); + + /*--- Set the surface filename ---*/ + + output->SetSurface_Filename(config[iZone]->GetSurfSens_FileName()); + + /*--- Set the surface filename ---*/ + + output->SetVolume_Filename(config[iZone]->GetVolSens_FileName()); + + /*--- Write to file ---*/ + + for (unsigned short iFile = 0; iFile < config[iZone]->GetnVolumeOutputFiles(); iFile++){ + unsigned short* FileFormat = config[iZone]->GetVolumeOutputFiles(); + if (FileFormat[iFile] != RESTART_ASCII && + FileFormat[iFile] != RESTART_BINARY && + FileFormat[iFile] != CSV) + output->WriteToFile(config[iZone], geometry[iZone][INST_0], FileFormat[iFile]); + } + + /*--- Free memory ---*/ + + delete output; + delete solver; + + } + + +} + diff --git a/SU2_DOT/src/meson.build b/SU2_DOT/src/meson.build index 76d3ccd61a23..50396bb79251 100644 --- a/SU2_DOT/src/meson.build +++ b/SU2_DOT/src/meson.build @@ -1,35 +1,58 @@ su2_dot_src = ['SU2_DOT.cpp'] if get_option('enable-normal') su2_cfd_obj = su2_cfd.extract_objects(['solver_structure.cpp', - 'output_structure.cpp', - 'output_cgns.cpp', - 'output_fieldview.cpp', - 'output_paraview.cpp', - 'output_physics.cpp', - 'output_su2.cpp', - 'output_tecplot.cpp', - 'variables/CBaselineVariable.cpp', - 'variables/CVariable.cpp']) + 'output/COutput.cpp', + 'output/output_structure_legacy.cpp', + 'output/CBaselineOutput.cpp', + 'output/filewriter/CParallelDataSorter.cpp', + 'output/filewriter/CParallelFileWriter.cpp', + 'output/filewriter/CFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFEMDataSorter.cpp', + 'output/filewriter/CFVMDataSorter.cpp', + 'output/filewriter/CSurfaceFVMDataSorter.cpp', + 'output/filewriter/CCSVFileWriter.cpp', + 'output/filewriter/CTecplotFileWriter.cpp', + 'output/filewriter/CTecplotBinaryFileWriter.cpp', + 'output/filewriter/CParaviewFileWriter.cpp', + 'output/filewriter/CParaviewBinaryFileWriter.cpp', + 'output/filewriter/CSU2FileWriter.cpp', + 'output/filewriter/CSU2BinaryFileWriter.cpp', + 'output/filewriter/CSU2MeshFileWriter.cpp', + 'variables/CBaselineVariable.cpp', + 'variables/CVariable.cpp']) + su2_dot = executable('SU2_DOT', - su2_dot_src, - install: true, - dependencies: [su2_deps, common_dep], - objects : su2_cfd_obj, - cpp_args :[default_warning_flags, su2_cpp_args]) + su2_dot_src, + install: true, + dependencies: [su2_deps, common_dep], + objects : su2_cfd_obj, + cpp_args :[default_warning_flags, su2_cpp_args]) + endif if get_option('enable-autodiff') su2_dot_src_ad = ['SU2_DOT.cpp'] su2_cfd_obj_ad = su2_cfd_ad.extract_objects(['solver_structure.cpp', - 'output_structure.cpp', - 'output_cgns.cpp', - 'output_fieldview.cpp', - 'output_paraview.cpp', - 'output_physics.cpp', - 'output_su2.cpp', - 'output_tecplot.cpp', + 'output/COutput.cpp', + 'output/output_structure_legacy.cpp', + 'output/CBaselineOutput.cpp', + 'output/filewriter/CParallelDataSorter.cpp', + 'output/filewriter/CParallelFileWriter.cpp', + 'output/filewriter/CFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFEMDataSorter.cpp', + 'output/filewriter/CFVMDataSorter.cpp', + 'output/filewriter/CSurfaceFVMDataSorter.cpp', + 'output/filewriter/CCSVFileWriter.cpp', + 'output/filewriter/CTecplotFileWriter.cpp', + 'output/filewriter/CTecplotBinaryFileWriter.cpp', + 'output/filewriter/CParaviewFileWriter.cpp', + 'output/filewriter/CParaviewBinaryFileWriter.cpp', + 'output/filewriter/CSU2FileWriter.cpp', + 'output/filewriter/CSU2BinaryFileWriter.cpp', + 'output/filewriter/CSU2MeshFileWriter.cpp', 'variables/CBaselineVariable.cpp', 'variables/CVariable.cpp']) + su2_dot_ad = executable('SU2_DOT_AD', su2_dot_src_ad, install: true, diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index 78e00c57482f..9059ed22de1a 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -61,7 +61,6 @@ int main(int argc, char *argv[]) { vector *Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; vector Xcoord_Fan, Ycoord_Fan, Zcoord_Fan; char config_file_name[MAX_STRING_SIZE]; - char *cstr; bool Local_MoveSurface, MoveSurface = false; ofstream Gradient_file, ObjFunc_file; int rank, size; @@ -153,6 +152,8 @@ int main(int argc, char *argv[]) { } + bool tabTecplot = config_container[ZONE_0]->GetTabular_FileFormat() == TAB_TECPLOT; + /*--- Set up a timer for performance benchmarking (preprocessing time is included) ---*/ #ifdef HAVE_MPI @@ -507,18 +508,21 @@ int main(int argc, char *argv[]) { } /*--- Write the objective function in a external file ---*/ - - cstr = new char [config_container[ZONE_0]->GetObjFunc_Value_FileName().size()+1]; - strcpy (cstr, config_container[ZONE_0]->GetObjFunc_Value_FileName().c_str()); - ObjFunc_file.open(cstr, ios::out); - ObjFunc_file << "TITLE = \"SU2_GEO Evaluation\"" << endl; + string filename = config_container[ZONE_0]->GetObjFunc_Value_FileName(); + unsigned short lastindex = filename.find_last_of("."); + filename = filename.substr(0, lastindex); + if (tabTecplot) filename += ".dat"; + else filename += ".csv"; + ObjFunc_file.open(filename.c_str(), ios::out); + if (tabTecplot) ObjFunc_file << "TITLE = \"SU2_GEO Evaluation\"" << endl; if (geometry_container[ZONE_0]->GetnDim() == 2) { - ObjFunc_file << "VARIABLES = \"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; + if (tabTecplot) ObjFunc_file << "VARIABLES =//" << endl; + ObjFunc_file << "\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; } else if (geometry_container[ZONE_0]->GetnDim() == 3) { - ObjFunc_file << "VARIABLES = "; + if (tabTecplot) ObjFunc_file << "VARIABLES = //" << endl; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { ObjFunc_file << "\"FUSELAGE_VOLUME\",\"FUSELAGE_WETTED_AREA\",\"FUSELAGE_MIN_WIDTH\",\"FUSELAGE_MAX_WIDTH\",\"FUSELAGE_MIN_WATERLINE_WIDTH\",\"FUSELAGE_MAX_WATERLINE_WIDTH\",\"FUSELAGE_MIN_HEIGHT\",\"FUSELAGE_MAX_HEIGHT\",\"FUSELAGE_MAX_CURVATURE\","; @@ -558,7 +562,8 @@ int main(int argc, char *argv[]) { } - ObjFunc_file << "\nZONE T= \"Geometrical variables (value)\"" << endl; + if (tabTecplot) ObjFunc_file << "\nZONE T= \"Geometrical variables (value)\"" << endl; + else ObjFunc_file << endl; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { @@ -609,9 +614,12 @@ int main(int argc, char *argv[]) { /*--- Write the gradient in a external file ---*/ if (rank == MASTER_NODE) { - cstr = new char [config_container[ZONE_0]->GetObjFunc_Grad_FileName().size()+1]; - strcpy (cstr, config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str()); - Gradient_file.open(cstr, ios::out); + string filename = config_container[ZONE_0]->GetObjFunc_Grad_FileName(); + unsigned short lastindex = filename.find_last_of("."); + filename = filename.substr(0, lastindex); + if (tabTecplot) filename += ".dat"; + else filename += ".csv"; + Gradient_file.open(filename.c_str(), ios::out); } for (iDV = 0; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { @@ -1133,15 +1141,16 @@ int main(int argc, char *argv[]) { if (iDV == 0) { - Gradient_file << "TITLE = \"SU2_GEO Gradient\"" << endl; + if (tabTecplot) Gradient_file << "TITLE = \"SU2_GEO Gradient\"" << endl; + if (tabTecplot) Gradient_file << "VARIABLES = //" << endl; if (geometry_container[ZONE_0]->GetnDim() == 2) { - Gradient_file << "VARIABLES = \"DESIGN_VARIABLE\",\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; + Gradient_file << "\"DESIGN_VARIABLE\",\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; } else if (geometry_container[ZONE_0]->GetnDim() == 3) { if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - Gradient_file << "VARIABLES = \"DESIGN_VARIABLE\","; + Gradient_file << "\"DESIGN_VARIABLE\","; Gradient_file << "\"FUSELAGE_VOLUME\",\"FUSELAGE_WETTED_AREA\",\"FUSELAGE_MIN_WIDTH\",\"FUSELAGE_MAX_WIDTH\",\"FUSELAGE_MIN_WATERLINE_WIDTH\",\"FUSELAGE_MAX_WATERLINE_WIDTH\",\"FUSELAGE_MIN_HEIGHT\",\"FUSELAGE_MAX_HEIGHT\",\"FUSELAGE_MAX_CURVATURE\","; for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_AREA\","; for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_LENGTH\","; @@ -1153,7 +1162,7 @@ int main(int argc, char *argv[]) { } } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { - Gradient_file << "VARIABLES = \"DESIGN_VARIABLE\","; + Gradient_file << "\"DESIGN_VARIABLE\","; Gradient_file << "\"NACELLE_VOLUME\",\"NACELLE_MIN_THICKNESS\",\"NACELLE_MAX_THICKNESS\",\"NACELLE_MIN_CHORD\",\"NACELLE_MAX_CHORD\",\"NACELLE_MIN_LE_RADIUS\",\"NACELLE_MAX_LE_RADIUS\",\"NACELLE_MIN_TOC\",\"NACELLE_MAX_TOC\",\"NACELLE_OBJFUN_MIN_TOC\",\"NACELLE_MAX_TWIST\","; for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_AREA\","; for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_THICKNESS\","; @@ -1166,7 +1175,7 @@ int main(int argc, char *argv[]) { } } else { - Gradient_file << "VARIABLES = \"DESIGN_VARIABLE\","; + Gradient_file << "\"DESIGN_VARIABLE\","; Gradient_file << "\"WING_VOLUME\",\"WING_MIN_THICKNESS\",\"WING_MAX_THICKNESS\",\"WING_MIN_CHORD\",\"WING_MAX_CHORD\",\"WING_MIN_LE_RADIUS\",\"WING_MAX_LE_RADIUS\",\"WING_MIN_TOC\",\"WING_MAX_TOC\",\"WING_OBJFUN_MIN_TOC\",\"WING_MAX_TWIST\",\"WING_MAX_CURVATURE\",\"WING_MAX_DIHEDRAL\","; for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_AREA\","; for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_THICKNESS\","; @@ -1181,8 +1190,8 @@ int main(int argc, char *argv[]) { } - Gradient_file << "\nZONE T= \"Geometrical variables (gradient)\"" << endl; - + if (tabTecplot) Gradient_file << "\nZONE T= \"Geometrical variables (gradient)\"" << endl; + else Gradient_file << endl; } Gradient_file << (iDV) <<","; diff --git a/SU2_MSH/src/SU2_MSH.cpp b/SU2_MSH/src/SU2_MSH.cpp index 18ed10d9a7d9..eb57a65c6ee2 100644 --- a/SU2_MSH/src/SU2_MSH.cpp +++ b/SU2_MSH/src/SU2_MSH.cpp @@ -2,37 +2,37 @@ * \file SU2_MSH.cpp * \brief Main file of Mesh Adaptation Code (SU2_MSH). * \author F. Palacios, T. Economon - * \version 6.2.0 "Falcon" - * - * The current SU2 release has been coordinated by the - * SU2 International Developers Society - * with selected contributions from the open-source community. - * - * The main research teams contributing to the current release are: - * - Prof. Juan J. Alonso's group at Stanford University. - * - Prof. Piero Colonna's group at Delft University of Technology. - * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. - * - Prof. Alberto Guardone's group at Polytechnic University of Milan. - * - Prof. Rafael Palacios' group at Imperial College London. - * - Prof. Vincent Terrapon's group at the University of Liege. - * - Prof. Edwin van der Weide's group at the University of Twente. - * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. - * - * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, - * Tim Albring, and the SU2 contributors. - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . + * \version 6.2.0 "Falcon" + * + * The current SU2 release has been coordinated by the + * SU2 International Developers Society + * with selected contributions from the open-source community. + * + * The main research teams contributing to the current release are: + * - Prof. Juan J. Alonso's group at Stanford University. + * - Prof. Piero Colonna's group at Delft University of Technology. + * - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. + * - Prof. Alberto Guardone's group at Polytechnic University of Milan. + * - Prof. Rafael Palacios' group at Imperial College London. + * - Prof. Vincent Terrapon's group at the University of Liege. + * - Prof. Edwin van der Weide's group at the University of Twente. + * - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. + * + * Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, + * Tim Albring, and the SU2 contributors. + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . */ #include "../include/SU2_MSH.hpp" @@ -115,8 +115,8 @@ int main(int argc, char *argv[]) { /*--- Color the initial grid and set the send-receive domains (ParMETIS) ---*/ geometry_aux->SetColorGrid_Parallel(config_container[iZone]); - - /*--- Build the grid data structures using the ParMETIS coloring. ---*/ + + /*--- Build the grid data structures using the ParMETIS coloring. ---*/ geometry_container[iZone] = new CPhysicalGeometry(geometry_aux, config_container[iZone]); @@ -165,9 +165,9 @@ int main(int argc, char *argv[]) { cout << "Set control volume structure." << endl; geometry_container[ZONE_0]->SetControlVolume(config_container[ZONE_0], ALLOCATE); geometry_container[ZONE_0]->SetBoundControlVolume(config_container[ZONE_0], ALLOCATE); - - /*--- Create the point-to-point MPI communication structures. ---*/ - + + /*--- Create the point-to-point MPI communication structures. ---*/ + geometry_container[ZONE_0]->PreprocessP2PComms(geometry_container[ZONE_0], config_container[ZONE_0]); if ((config_container[ZONE_0]->GetKind_Adaptation() != NONE) && (config_container[ZONE_0]->GetKind_Adaptation() != PERIODIC)) { @@ -277,7 +277,7 @@ int main(int argc, char *argv[]) { if ((config_container[ZONE_0]->GetKind_Adaptation() != SMOOTHING) && (config_container[ZONE_0]->GetKind_Adaptation() != FULL) && (config_container[ZONE_0]->GetKind_Adaptation() != WAKE) && (config_container[ZONE_0]->GetKind_Adaptation() != SUPERSONIC_SHOCK)) - grid_adaptation->SetRestart_FlowSolution(config_container[ZONE_0], geo_adapt, config_container[ZONE_0]->GetRestart_FlowFileName()); + grid_adaptation->SetRestart_FlowSolution(config_container[ZONE_0], geo_adapt, config_container[ZONE_0]->GetRestart_FileName()); if ((config_container[ZONE_0]->GetKind_Adaptation() == GRAD_FLOW_ADJ) || (config_container[ZONE_0]->GetKind_Adaptation() == GRAD_ADJOINT) || (config_container[ZONE_0]->GetKind_Adaptation() == FULL_ADJOINT) || (config_container[ZONE_0]->GetKind_Adaptation() == COMPUTABLE) || @@ -285,30 +285,30 @@ int main(int argc, char *argv[]) { grid_adaptation->SetRestart_AdjSolution(config_container[ZONE_0], geo_adapt, config_container[ZONE_0]->GetRestart_AdjFileName()); } - - if (rank == MASTER_NODE) - cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; - - if (geometry_container != NULL) { - for (iZone = 0; iZone < nZone; iZone++) { - if (geometry_container[iZone] != NULL) { - delete geometry_container[iZone]; - } - } - delete [] geometry_container; - } - if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; - - - if (config_container != NULL) { - for (iZone = 0; iZone < nZone; iZone++) { - if (config_container[iZone] != NULL) { - delete config_container[iZone]; - } - } - delete [] config_container; - } - if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; + + if (rank == MASTER_NODE) + cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; + + if (geometry_container != NULL) { + for (iZone = 0; iZone < nZone; iZone++) { + if (geometry_container[iZone] != NULL) { + delete geometry_container[iZone]; + } + } + delete [] geometry_container; + } + if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; + + + if (config_container != NULL) { + for (iZone = 0; iZone < nZone; iZone++) { + if (config_container[iZone] != NULL) { + delete config_container[iZone]; + } + } + delete [] config_container; + } + if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; delete config; config = NULL; @@ -343,4 +343,4 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; } - + diff --git a/SU2_PY/FSI/FSIInterface.py b/SU2_PY/FSI/FSIInterface.py index 7a1c30d49974..96afc4231346 100644 --- a/SU2_PY/FSI/FSIInterface.py +++ b/SU2_PY/FSI/FSIInterface.py @@ -158,7 +158,7 @@ def __init__(self, FSI_config, FluidSolver, SolidSolver, have_MPI): self.MPIPrint('Fluid solver : SU2_CFD') self.MPIPrint('Solid solver : {}'.format(FSI_config['CSD_SOLVER'])) - if FSI_config['UNSTEADY_SIMULATION'] == 'YES': + if FSI_config['TIME_MARCHING'] == 'YES': self.MPIPrint('Unsteady coupled simulation with physical time step : {} s'.format(FSI_config['UNST_TIMESTEP'])) self.unsteady = True else: diff --git a/SU2_PY/FSI/PitchPlungeAirfoilStructuralTester.py b/SU2_PY/FSI/PitchPlungeAirfoilStructuralTester.py index 31b2d21a68a3..c65eb137e650 100755 --- a/SU2_PY/FSI/PitchPlungeAirfoilStructuralTester.py +++ b/SU2_PY/FSI/PitchPlungeAirfoilStructuralTester.py @@ -133,7 +133,7 @@ def __init__(self, config_fileName): self.Mesh_file = self.Config['MESH_FILE'] self.FSI_marker = self.Config['MOVING_MARKER'] - self.Unsteady = (self.Config['UNSTEADY_SIMULATION']=="YES") + self.Unsteady = (self.Config['TIME_MARCHING']=="YES") if self.Unsteady: print('Dynamic computation.') if self.Config['STRUCT_TYPE'] == "AIRFOIL": @@ -224,7 +224,7 @@ def __readConfig(self): break #string values - if case("UNSTEADY_SIMULATION") : pass + if case("TIME_MARCHING") : pass if case("MESH_FILE") : pass if case("CSD_SOLVER") : pass if case("MOVING_MARKER") : pass diff --git a/SU2_PY/FSI/io/FSI_config.py b/SU2_PY/FSI/io/FSI_config.py index 22769a22bb41..ee848d43cba9 100644 --- a/SU2_PY/FSI/io/FSI_config.py +++ b/SU2_PY/FSI/io/FSI_config.py @@ -115,7 +115,7 @@ def readConfig(self): if case("MESH_INTERP_METHOD") : pass if case("DISP_PRED") : pass if case("AITKEN_RELAX") : pass - if case("UNSTEADY_SIMULATION") : pass + if case("TIME_MARCHING") : pass if case("INTERNAL_FLOW") : #if case("MESH_DEF_METHOD") : pass self._ConfigContent[this_param] = this_value diff --git a/SU2_PY/Makefile.am b/SU2_PY/Makefile.am index 4809bee01553..ec9151027334 100644 --- a/SU2_PY/Makefile.am +++ b/SU2_PY/Makefile.am @@ -70,6 +70,7 @@ nobase_dist_mypkg_DATA= \ SU2/io/redirect.py \ SU2/io/state.py \ SU2/io/tools.py \ + SU2/io/historyMap.py \ SU2/io/__init__.py \ SU2/mesh/adapt.py \ SU2/mesh/tools.py \ diff --git a/SU2_PY/SU2/eval/functions.py b/SU2_PY/SU2/eval/functions.py index 28ea181c61f6..1293c5c79d63 100644 --- a/SU2_PY/SU2/eval/functions.py +++ b/SU2_PY/SU2/eval/functions.py @@ -94,9 +94,13 @@ def function( func_name, config, state=None ): if not func_name_string in state['FUNCTIONS']: # Aerodynamics - if multi_objective or func_name == 'ALL' or func_name in su2io.optnames_aero + su2io.grad_names_directdiff + su2io.optnames_turbo: + if multi_objective or func_name == 'ALL': aerodynamics( config, state ) - + + elif func_name in su2io.historyOutFields: + if su2io.historyOutFields[func_name]['TYPE'] == 'COEFFICIENT' or su2io.historyOutFields[func_name]['TYPE'] == 'D_COEFFICIENT': + aerodynamics( config, state ) + # Stability elif func_name in su2io.optnames_stab: stability( config, state ) @@ -199,13 +203,17 @@ def aerodynamics( config, state=None ): # ---------------------------------------------------- # Direct Solution # ---------------------------------------------------- - + opt_names = [] + for key in su2io.historyOutFields: + if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + opt_names.append(key) + # redundancy check - direct_done = all([key in state.FUNCTIONS for key in su2io.optnames_aero[:9]]) + direct_done = all([key in state.FUNCTIONS for key in opt_names]) if direct_done: # return aerodynamic function values aero = su2util.ordered_bunch() - for key in su2io.optnames_aero: + for key in opt_names: if key in state.FUNCTIONS: aero[key] = state.FUNCTIONS[key] return copy.deepcopy(aero) @@ -220,6 +228,9 @@ def aerodynamics( config, state=None ): name = su2io.expand_part(name,config) link.extend(name) + if 'FLOW_META' in files: + pull.append(files['FLOW_META']) + # files: direct solution if 'DIRECT' in files: name = files['DIRECT'] @@ -272,11 +283,14 @@ def aerodynamics( config, state=None ): if 'TARGET_HEATFLUX' in info.FILES: push.append(info.FILES['TARGET_HEATFLUX']) + if 'FLOW_META' in info.FILES: + push.append(info.FILES['FLOW_META']) + #: with output redirection su2io.update_persurface(config,state) # return output funcs = su2util.ordered_bunch() - for key in su2io.optnames_aero + su2io.grad_names_directdiff + su2io.optnames_turbo: + for key in su2io.historyOutFields: if key in state['FUNCTIONS']: funcs[key] = state['FUNCTIONS'][key] diff --git a/SU2_PY/SU2/eval/gradients.py b/SU2_PY/SU2/eval/gradients.py index 51715f525f7e..997a05871cab 100644 --- a/SU2_PY/SU2/eval/gradients.py +++ b/SU2_PY/SU2/eval/gradients.py @@ -101,11 +101,13 @@ def gradient( func_name, method, config, state=None ): if any([method == 'CONTINUOUS_ADJOINT', method == 'DISCRETE_ADJOINT']): # Aerodynamics - if func_output in su2io.optnames_aero + su2io.optnames_turbo: - grads = adjoint( func_name, config, state ) + if func_output in su2io.historyOutFields: + if su2io.historyOutFields[func_output]['TYPE'] == 'COEFFICIENT': + grads = adjoint( func_name, config, state ) - elif func_name in su2io.optnames_aero + su2io.optnames_turbo: - grads = adjoint( func_name, config, state ) + elif func_name in su2io.historyOutFields: + if su2io.historyOutFields[func_name]['TYPE'] == 'COEFFICIENT': + grads = adjoint( func_name, config, state ) # Stability elif func_output in su2io.optnames_stab: @@ -243,7 +245,10 @@ def adjoint( func_name, config, state=None ): name = su2io.expand_zones(name,config) name = su2io.expand_time(name,config) link.extend(name) - + + if 'FLOW_META' in files: + pull.append(files['FLOW_META']) + # files: adjoint solution if ADJ_NAME in files: name = files[ADJ_NAME] @@ -265,6 +270,13 @@ def adjoint( func_name, config, state=None ): # files: target heat flux coefficient if 'INV_DESIGN_HEATFLUX' in special_cases: pull.append(files['TARGET_HEATFLUX']) + + if not 'OUTPUT_FILES' in config: + config['OUTPUT_FILES'] = ['RESTART'] + + if not 'SURFACE_CSV' in config['OUTPUT_FILES']: + config['OUTPUT_FILES'].append('SURFACE_CSV') + # output redirection with redirect_folder( ADJ_NAME, pull, link ) as push: @@ -702,7 +714,10 @@ def findiff( config, state=None ): # ---------------------------------------------------- # master redundancy check - opt_names = su2io.optnames_aero + su2io.optnames_geo + opt_names = [] + for key in sorted(su2io.historyOutFields): + if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + opt_names.append(key) findiff_todo = all([key in state.GRADIENTS for key in opt_names]) if findiff_todo: grads = state['GRADIENTS'] @@ -721,7 +736,7 @@ def findiff( config, state=None ): grad_filename = config['GRAD_OBJFUNC_FILENAME'] grad_filename = os.path.splitext( grad_filename )[0] - output_format = config['OUTPUT_FORMAT'] + output_format = config['TABULAR_FORMAT'] plot_extension = su2io.get_extension(output_format) grad_filename = grad_filename + '_findiff' + plot_extension @@ -742,8 +757,7 @@ def findiff( config, state=None ): dvs_base = konfig['DV_VALUE_NEW'] # initialize gradients - func_keys = list(func_base.keys()) - func_keys = ['VARIABLE'] + func_keys + ['FINDIFF_STEP'] + func_keys = ['VARIABLE'] + opt_names + ['FINDIFF_STEP'] grads = su2util.ordered_bunch.fromkeys(func_keys) for key in grads.keys(): grads[key] = [] @@ -806,6 +820,12 @@ def findiff( config, state=None ): meshfiles = this_state.FILES.MESH meshfiles = su2io.expand_part(meshfiles,this_konfig) for name in meshfiles: os.remove(name) + + for key in grads.keys(): + if key == 'VARIABLE' or key == 'FINDIFF_STEP': + pass + elif not key in func_step: + del grads[key] # calc finite difference and store for key in grads.keys(): @@ -996,7 +1016,11 @@ def directdiff( config, state=None ): # ---------------------------------------------------- # master redundancy check - opt_names = su2io.optnames_aero + su2io.optnames_geo + opt_names = [] + for key in sorted(su2io.historyOutFields): + if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + opt_names.append(key) + directdiff_todo = all([key in state.GRADIENTS for key in opt_names]) if directdiff_todo: grads = state['GRADIENTS'] @@ -1008,7 +1032,7 @@ def directdiff( config, state=None ): grad_filename = config['GRAD_OBJFUNC_FILENAME'] grad_filename = os.path.splitext( grad_filename )[0] - output_format = config['OUTPUT_FORMAT'] + output_format = config.get('TABULAR_FORMAT', 'CSV') plot_extension = su2io.get_extension(output_format) grad_filename = grad_filename + '_directdiff' + plot_extension @@ -1022,7 +1046,7 @@ def directdiff( config, state=None ): n_dv = sum(Definition_DV['SIZE']) # initialize gradients - func_keys = list(su2io.grad_names_map.keys()) + func_keys = opt_names func_keys = ['VARIABLE'] + func_keys grads = su2util.ordered_bunch.fromkeys(func_keys) for key in grads.keys(): grads[key] = [] @@ -1034,6 +1058,10 @@ def directdiff( config, state=None ): name = files['MESH'] name = su2io.expand_part(name,konfig) link.extend(name) + + if 'FLOW_META' in files: + pull.append(files['FLOW_META']) + # files: direct solution if 'DIRECT' in files: name = files['DIRECT'] @@ -1076,15 +1104,19 @@ def directdiff( config, state=None ): # Direct Solution func_step = function( 'ALL', this_konfig, this_state ) + # delete keys not returned by the solver + for key in grads.keys(): + if key == 'VARIABLE': + pass + elif not 'D_' + key in func_step: + del grads[key] + # store for key in grads.keys(): if key == 'VARIABLE': grads[key].append(i_dv) else: - if su2io.grad_names_map[key] in func_step: - this_grad = func_step[su2io.grad_names_map[key]] - else: - this_grad = 0.0 + this_grad = func_step['D_' + key] grads[key].append(this_grad) #: for each grad name diff --git a/SU2_PY/SU2/io/__init__.py b/SU2_PY/SU2/io/__init__.py index 3c9419ac93c5..d79c0aa59c28 100644 --- a/SU2_PY/SU2/io/__init__.py +++ b/SU2_PY/SU2/io/__init__.py @@ -8,3 +8,4 @@ from .config import Config from .state import State_Factory as State +from .historyMap import history_header_map as historyOutFields diff --git a/SU2_PY/SU2/io/config.py b/SU2_PY/SU2/io/config.py index aa6c10427533..7285a8854daa 100755 --- a/SU2_PY/SU2/io/config.py +++ b/SU2_PY/SU2/io/config.py @@ -407,14 +407,25 @@ def read_config(filename): # int parameters if case("NUMBER_PART") or\ case("AVAILABLE_PROC") or\ - case("EXT_ITER") or\ + case("ITER") or\ case("TIME_INSTANCES") or\ case("UNST_ADJOINT_ITER") or\ case("ITER_AVERAGE_OBJ") or\ + case("INNER_ITER") or\ + case("OUTER_ITER") or\ + case("TIME_ITER") or\ case("ADAPT_CYCLES") : data_dict[this_param] = int(this_value) break + if case("OUTPUT_FILES"): + data_dict[this_param] = this_value.strip("()").split(",") + data_dict[this_param] = [i.strip(" ") for i in data_dict[this_param]] + break + if case("HISTORY_OUTPUT"): + data_dict[this_param] = this_value.strip("()").split(",") + data_dict[this_param] = [i.strip(" ") for i in data_dict[this_param]] + break # unitary design variable definition if case("DEFINITION_DV"): @@ -729,7 +740,9 @@ def read_config(filename): Mesh_List += str(Mesh_Filename) Mesh_List += ")" data_dict['MULTIPOINT_MESH_FILENAME'] = Mesh_List - + + if 'HISTORY_OUTPUT' not in data_dict: + data_dict['HISTORY_OUTPUT'] = ['ITER', 'RMS_RES'] # # Default values for optimization parameters (needed for some eval functions @@ -840,7 +853,24 @@ def write_config(filename,param_dict): output_file.write(", ") output_file.write(" )") break + if case("OUTPUT_FILES"): + n_lists = len(new_value) + output_file.write("(") + for i_value in range(n_lists): + output_file.write(new_value[i_value]) + if i_value+1 < n_lists: + output_file.write(", ") + output_file.write(")") + break + if case("HISTORY_OUTPUT"): + n_lists = len(new_value) + for i_value in range(n_lists): + output_file.write(new_value[i_value]) + if i_value+1 < n_lists: + output_file.write(", ") + break + # semicolon delimited lists of comma delimited lists if case("DV_PARAM") : @@ -877,7 +907,10 @@ def write_config(filename,param_dict): if case("TIME_INSTANCES") : pass if case("AVAILABLE_PROC") : pass if case("UNST_ADJOINT_ITER") : pass - if case("EXT_ITER") : + if case("ITER") or\ + case("TIME_ITER") or\ + case("INNER_ITER") or\ + case("OUTER_ITER"): output_file.write("%i" % new_value) break diff --git a/SU2_PY/SU2/io/historyMap.py b/SU2_PY/SU2/io/historyMap.py new file mode 100644 index 000000000000..9e6c867c7750 --- /dev/null +++ b/SU2_PY/SU2/io/historyMap.py @@ -0,0 +1,855 @@ +history_header_map = {'ADJOINT_DISP_X': {'DESCRIPTION': '', + 'GROUP': 'RESIDUALS', + 'HEADER': 'Res[Ux_adj]', + 'TYPE': 'DEFAULT'}, + 'ADJOINT_DISP_Y': {'DESCRIPTION': '', + 'GROUP': 'RESIDUALS', + 'HEADER': 'Res[Uy_adj]', + 'TYPE': 'DEFAULT'}, + 'ADJOINT_DISP_Z': {'DESCRIPTION': '', + 'GROUP': 'RESIDUALS', + 'HEADER': 'Res[Uz_adj]', + 'TYPE': 'DEFAULT'}, + 'AEROCDRAG': {'DESCRIPTION': 'Aero CD drag', + 'GROUP': 'ENGINE_OUTPUT', + 'HEADER': 'AeroCDrag', + 'TYPE': 'COEFFICIENT'}, + 'AOA': {'DESCRIPTION': 'Angle of attack', + 'GROUP': 'AOA', + 'HEADER': 'AoA', + 'TYPE': 'DEFAULT'}, + 'AVG_DENSITY': {'DESCRIPTION': 'Total average density on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_Density', + 'TYPE': 'COEFFICIENT'}, + 'AVG_ENTHALPY': {'DESCRIPTION': 'Total average enthalpy on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_Enthalpy', + 'TYPE': 'COEFFICIENT'}, + 'AVG_MACH': {'DESCRIPTION': 'Total average mach number on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_Mach', + 'TYPE': 'COEFFICIENT'}, + 'AVG_MASSFLOW': {'DESCRIPTION': 'Total average mass flow on all markers set ' + 'in MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_Massflow', + 'TYPE': 'COEFFICIENT'}, + 'AVG_NORMALVEL': {'DESCRIPTION': 'Total average normal velocity on all ' + 'markers set in MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_NormalVel', + 'TYPE': 'COEFFICIENT'}, + 'AVG_PRESS': {'DESCRIPTION': 'Total average pressure on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_Press', + 'TYPE': 'COEFFICIENT'}, + 'AVG_TEMP': {'DESCRIPTION': 'Total average temperature on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_Temp', + 'TYPE': 'COEFFICIENT'}, + 'AVG_TEMPERATURE': {'DESCRIPTION': 'Total average temperature on all surfaces ' + 'defined in MARKER_MONITORING', + 'GROUP': 'HEAT', + 'HEADER': 'AvgTemp', + 'TYPE': 'COEFFICIENT'}, + 'AVG_TOTALPRESS': {'DESCRIPTION': 'Total average total pressure on all ' + 'markers set in MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_TotalPress', + 'TYPE': 'COEFFICIENT'}, + 'AVG_TOTALTEMP': {'DESCRIPTION': 'Total average total temperature all markers ' + 'set in MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Avg_TotalTemp', + 'TYPE': 'COEFFICIENT'}, + 'BGS_ADJ_DENSITY': {'DESCRIPTION': 'BGS residual of the adjoint density.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_Rho]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_DISSIPATION': {'DESCRIPTION': 'BGS residual of the adjoint ' + 'dissipation.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_w]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_ENERGY': {'DESCRIPTION': 'BGS residual of the adjoint energy.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_E]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_HEAT': {'DESCRIPTION': 'BGS residual of the adjoint temperature.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_T]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_MOMENTUM-X': {'DESCRIPTION': 'BGS residual of the adjoint momentum ' + 'x-component', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_RhoU]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_MOMENTUM-Y': {'DESCRIPTION': 'BGS residual of the adjoint momentum ' + 'y-component', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_RhoV]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_MOMENTUM-Z': {'DESCRIPTION': 'BGS residual of the adjoint momentum ' + 'z-component', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_RhoW]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_NU_TILDE': {'DESCRIPTION': 'BGS residual of the adjoint nu tilde.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_nu]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_PRESSURE': {'DESCRIPTION': 'BGS residual of the adjoint Pressure.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_Rho]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_TKE': {'DESCRIPTION': 'BGS residual of the adjoint kinetic energy.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_k]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_VELOCITY-X': {'DESCRIPTION': 'BGS residual of the adjoint Velocity ' + 'x-component', + 'GROUP': 'BGS_RES', + 'HEADER': 'bsg[A_RhoU]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_VELOCITY-Y': {'DESCRIPTION': 'BGS residual of the adjoint Velocity ' + 'y-component', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_RhoV]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ADJ_VELOCITY-Z': {'DESCRIPTION': 'BGS residual of the adjoint Velocity ' + 'z-component', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[A_RhoW]', + 'TYPE': 'RESIDUAL'}, + 'BGS_DENSITY': {'DESCRIPTION': 'BGS residual of the density.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[Rho]', + 'TYPE': 'RESIDUAL'}, + 'BGS_DISP_X': {'DESCRIPTION': '', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[DispX]', + 'TYPE': 'RESIDUAL'}, + 'BGS_DISP_Y': {'DESCRIPTION': '', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[DispY]', + 'TYPE': 'RESIDUAL'}, + 'BGS_DISP_Z': {'DESCRIPTION': '', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[DispZ]', + 'TYPE': 'RESIDUAL'}, + 'BGS_DISSIPATION': {'DESCRIPTION': 'BGS residual of dissipation (SST model).', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[w]', + 'TYPE': 'RESIDUAL'}, + 'BGS_ENERGY': {'DESCRIPTION': 'BGS residual of the energy.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[RhoE]', + 'TYPE': 'RESIDUAL'}, + 'BGS_MOMENTUM-X': {'DESCRIPTION': 'BGS residual of the momentum x-component.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[RhoU]', + 'TYPE': 'RESIDUAL'}, + 'BGS_MOMENTUM-Y': {'DESCRIPTION': 'BGS residual of the momentum y-component.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[RhoV]', + 'TYPE': 'RESIDUAL'}, + 'BGS_NU_TILDE': {'DESCRIPTION': 'BGS residual of nu tilde (SA model).', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[nu]', + 'TYPE': 'RESIDUAL'}, + 'BGS_PRESSURE': {'DESCRIPTION': 'BGS residual of the pressure.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[P]', + 'TYPE': 'RESIDUAL'}, + 'BGS_TEMPERATURE': {'DESCRIPTION': 'Block-Gauss seidel residual of the ' + 'temperature', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[T]', + 'TYPE': 'RESIDUAL'}, + 'BGS_TKE': {'DESCRIPTION': 'BGS residual of kinetic energy (SST model).', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[k]', + 'TYPE': 'RESIDUAL'}, + 'BGS_VELOCITY-X': {'DESCRIPTION': 'BGS residual of the velocity x-component.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[U]', + 'TYPE': 'RESIDUAL'}, + 'BGS_VELOCITY-Y': {'DESCRIPTION': 'BGS residual of the velocity y-component.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[V]', + 'TYPE': 'RESIDUAL'}, + 'BGS_VELOCITY-Z': {'DESCRIPTION': 'BGS residual of the velocity z-component.', + 'GROUP': 'BGS_RES', + 'HEADER': 'bgs[W]', + 'TYPE': 'RESIDUAL'}, + 'CFL_NUMBER': {'DESCRIPTION': 'Current value of the CFL number', + 'GROUP': 'CFL_NUMBER', + 'HEADER': 'CFL number', + 'TYPE': 'DEFAULT'}, + 'CIRCUMFERENTIAL_DISTORTION': {'DESCRIPTION': 'Circumferential distortion', + 'GROUP': 'ENGINE_OUTPUT', + 'HEADER': 'Circumferential_Distortion', + 'TYPE': 'COEFFICIENT'}, + 'COMBO': {'DESCRIPTION': 'Combined obj. function value.', + 'GROUP': 'COMBO', + 'HEADER': 'ComboObj', + 'TYPE': 'COEFFICIENT'}, + 'CP_DIFF': {'DESCRIPTION': 'Cp difference for inverse design', + 'GROUP': 'CP_DIFF', + 'HEADER': 'Cp_Diff', + 'TYPE': 'DEFAULT'}, + 'CQ': {'DESCRIPTION': 'CQ', + 'GROUP': 'ROTATING_FRAME', + 'HEADER': 'CQ', + 'TYPE': 'COEFFICIENT'}, + 'CT': {'DESCRIPTION': 'CT', + 'GROUP': 'ROTATING_FRAME', + 'HEADER': 'CT', + 'TYPE': 'COEFFICIENT'}, + 'DEFORM_ITER': {'DESCRIPTION': 'Linear solver iterations for the mesh ' + 'deformation', + 'GROUP': 'DEFORM', + 'HEADER': 'DeformIter', + 'TYPE': 'DEFAULT'}, + 'DEFORM_MAX_VOLUME': {'DESCRIPTION': 'Maximum volume in the mesh', + 'GROUP': 'DEFORM', + 'HEADER': 'MaxVolume', + 'TYPE': 'DEFAULT'}, + 'DEFORM_MIN_VOLUME': {'DESCRIPTION': 'Minimum volume in the mesh', + 'GROUP': 'DEFORM', + 'HEADER': 'MinVolume', + 'TYPE': 'DEFAULT'}, + 'DEFORM_RESIDUAL': {'DESCRIPTION': 'Residual of the linear solver for the ' + 'mesh deformation', + 'GROUP': 'DEFORM', + 'HEADER': 'DeformRes', + 'TYPE': 'DEFAULT'}, + 'DRAG': {'DESCRIPTION': 'Total drag coefficient on all surfaces set with ' + 'MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CD', + 'TYPE': 'COEFFICIENT'}, + 'D_AEROCDRAG': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ENGINE_OUTPUT', + 'HEADER': 'd[AeroCDrag]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_DENSITY': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_Density]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_ENTHALPY': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_Enthalpy]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_MACH': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_Mach]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_MASSFLOW': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_Massflow]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_NORMALVEL': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_NormalVel]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_PRESS': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_Press]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_TEMP': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_Temp]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_TEMPERATURE': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_HEAT', + 'HEADER': 'd[AvgTemp]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_TOTALPRESS': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_TotalPress]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_AVG_TOTALTEMP': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Avg_TotalTemp]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_CIRCUMFERENTIAL_DISTORTION': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ENGINE_OUTPUT', + 'HEADER': 'd[Circumferential_Distortion]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_COMBO': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_COMBO', + 'HEADER': 'd[ComboObj]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_CQ': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ROTATING_FRAME', + 'HEADER': 'd[CQ]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_CT': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ROTATING_FRAME', + 'HEADER': 'd[CT]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_DRAG': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CD]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_EFFICIENCY': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CEff]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_EQUIV_AREA': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_EQUIVALENT_AREA', + 'HEADER': 'd[CEquiv_Area]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_FORCE_X': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CFx]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_FORCE_Y': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CFy]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_FORCE_Z': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CFz]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_HEATFLUX': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_HEAT', + 'HEADER': 'd[HF]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_HEATFLUX_MAX': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_HEAT', + 'HEADER': 'd[MaxHF]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_LIFT': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CL]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_MERIT': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ROTATING_FRAME', + 'HEADER': 'd[CMerit]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_MOMENTUM_DISTORTION': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Momentum_Distortion]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_MOMENT_X': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CMx]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_MOMENT_Y': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CMy]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_MOMENT_Z': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CMz]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_NEARFIELD_OF': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_EQUIVALENT_AREA', + 'HEADER': 'd[CNearFieldOF]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_PRESSURE_DROP': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Pressure_Drop]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_RADIAL_DISTORTION': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ENGINE_OUTPUT', + 'HEADER': 'd[Radial_Distortion]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SECONDARY_OVER_UNIFORMITY': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Secondary_Over_Uniformity]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SECONDARY_STRENGTH': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Secondary_Strength]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_AOA': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_AoA]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_GEO': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_Geo]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_MACH': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_Mach]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_PRESS': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_Press]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_PRESS_OUT': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_Pout]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_TEMP': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_Temp]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SENS_VEL_IN': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_SENSITIVITY', + 'HEADER': 'd[Sens_Vin]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SIDEFORCE': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_AERO_COEFF', + 'HEADER': 'd[CSF]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_SOLIDCDRAG': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_ENGINE_OUTPUT', + 'HEADER': 'd[SolidCDrag]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_TEMPERATURE': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_HEAT', + 'HEADER': 'd[Temp]', + 'TYPE': 'D_COEFFICIENT'}, + 'D_UNIFORMITY': {'DESCRIPTION': 'Derivative value', + 'GROUP': 'D_FLOW_COEFF', + 'HEADER': 'd[Uniformity]', + 'TYPE': 'D_COEFFICIENT'}, + 'EFFICIENCY': {'DESCRIPTION': 'Total lift-to-drag ratio on all surfaces set ' + 'with MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CEff', + 'TYPE': 'COEFFICIENT'}, + 'EQUIV_AREA': {'DESCRIPTION': 'Equivalent area', + 'GROUP': 'EQUIVALENT_AREA', + 'HEADER': 'CEquiv_Area', + 'TYPE': 'COEFFICIENT'}, + 'FORCE_X': {'DESCRIPTION': 'Total force x-component on all surfaces set with ' + 'MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CFx', + 'TYPE': 'COEFFICIENT'}, + 'FORCE_Y': {'DESCRIPTION': 'Total force y-component on all surfaces set with ' + 'MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CFy', + 'TYPE': 'COEFFICIENT'}, + 'FORCE_Z': {'DESCRIPTION': 'Total force z-component on all surfaces set with ' + 'MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CFz', + 'TYPE': 'COEFFICIENT'}, + 'HEATFLUX': {'DESCRIPTION': 'Total heatflux on all surfaces defined in ' + 'MARKER_MONITORING', + 'GROUP': 'HEAT', + 'HEADER': 'HF', + 'TYPE': 'COEFFICIENT'}, + 'HEATFLUX_MAX': {'DESCRIPTION': 'Total maximal heatflux on all surfaces ' + 'defined in MARKER_MONITORING', + 'GROUP': 'HEAT', + 'HEADER': 'MaxHF', + 'TYPE': 'COEFFICIENT'}, + 'LIFT': {'DESCRIPTION': 'Total lift coefficient on all surfaces set with ' + 'MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CL', + 'TYPE': 'COEFFICIENT'}, + 'LINSOL_ITER': {'DESCRIPTION': 'Number of iterations of the linear solver.', + 'GROUP': 'LINSOL', + 'HEADER': 'LinSolIter', + 'TYPE': 'DEFAULT'}, + 'LINSOL_RESIDUAL': {'DESCRIPTION': 'Residual of the linear solver.', + 'GROUP': 'LINSOL', + 'HEADER': 'LinSolRes', + 'TYPE': 'DEFAULT'}, + 'LOAD_INCREMENT': {'DESCRIPTION': 'LOAD_INCREMENT', + 'GROUP': '', + 'HEADER': 'Load_Increment', + 'TYPE': 'DEFAULT'}, + 'LOAD_RAMP': {'DESCRIPTION': 'LOAD_RAMP', + 'GROUP': '', + 'HEADER': 'Load_Ramp', + 'TYPE': 'DEFAULT'}, + 'MAX_ADJ_DENSITY': {'DESCRIPTION': 'Maximum residual of the adjoint density.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_Rho]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_DISSIPATION': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'dissipation.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_w]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_ENERGY': {'DESCRIPTION': 'Maximum residual of the adjoint energy.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_E]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_HEAT': {'DESCRIPTION': 'Maximum residual of the temperature.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_T]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_MOMENTUM-X': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'momentum x-component', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_RhoU]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_MOMENTUM-Y': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'momentum y-component', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_RhoV]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_MOMENTUM-Z': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'momentum z-component', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_RhoW]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_NU_TILDE': {'DESCRIPTION': 'Maximum residual of the adjoint nu ' + 'tilde.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_nu]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_PRESSURE': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'Pressure.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_Rho]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_TEMPERATURE': {'DESCRIPTION': 'BGS residual of the adjoint ' + 'temperature.', + 'GROUP': 'BGS_RES', + 'HEADER': 'max[A_T]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_TKE': {'DESCRIPTION': 'Maximum residual of the adjoint kinetic ' + 'energy.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_k]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_VELOCITY-X': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'Velocity x-component', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_RhoU]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_VELOCITY-Y': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'Velocity y-component', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_RhoV]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ADJ_VELOCITY-Z': {'DESCRIPTION': 'Maximum residual of the adjoint ' + 'Velocity z-component', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[A_RhoW]', + 'TYPE': 'RESIDUAL'}, + 'MAX_DENSITY': {'DESCRIPTION': 'Maximum square residual of the density.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[Rho]', + 'TYPE': 'RESIDUAL'}, + 'MAX_DISSIPATION': {'DESCRIPTION': 'Maximum residual of dissipation (SST ' + 'model).', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[w]', + 'TYPE': 'RESIDUAL'}, + 'MAX_ENERGY': {'DESCRIPTION': 'Maximum residual of the energy.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[RhoE]', + 'TYPE': 'RESIDUAL'}, + 'MAX_MOMENTUM-X': {'DESCRIPTION': 'Maximum square residual of the momentum ' + 'x-component.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[RhoU]', + 'TYPE': 'RESIDUAL'}, + 'MAX_MOMENTUM-Y': {'DESCRIPTION': 'Maximum square residual of the momentum ' + 'y-component.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[RhoV]', + 'TYPE': 'RESIDUAL'}, + 'MAX_NU_TILDE': {'DESCRIPTION': 'Maximum residual of nu tilde (SA model).', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[nu]', + 'TYPE': 'RESIDUAL'}, + 'MAX_PRESSURE': {'DESCRIPTION': 'Maximum residual of the pressure.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[P]', + 'TYPE': 'RESIDUAL'}, + 'MAX_TEMPERATURE': {'DESCRIPTION': 'Maximum residual of the temperature', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[T]', + 'TYPE': 'RESIDUAL'}, + 'MAX_TKE': {'DESCRIPTION': 'Maximum residual of kinetic energy (SST model).', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[k]', + 'TYPE': 'RESIDUAL'}, + 'MAX_VELOCITY-X': {'DESCRIPTION': 'Maximum residual of the velocity ' + 'x-component.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[U]', + 'TYPE': 'RESIDUAL'}, + 'MAX_VELOCITY-Y': {'DESCRIPTION': 'Maximum residual of the velocity ' + 'y-component.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[V]', + 'TYPE': 'RESIDUAL'}, + 'MAX_VELOCITY-Z': {'DESCRIPTION': 'Maximum residual of the velocity ' + 'z-component.', + 'GROUP': 'MAX_RES', + 'HEADER': 'max[W]', + 'TYPE': 'RESIDUAL'}, + 'MERIT': {'DESCRIPTION': 'Merit', + 'GROUP': 'ROTATING_FRAME', + 'HEADER': 'CMerit', + 'TYPE': 'COEFFICIENT'}, + 'MOMENTUM_DISTORTION': {'DESCRIPTION': 'Total momentum distortion on all ' + 'markers set in MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Momentum_Distortion', + 'TYPE': 'COEFFICIENT'}, + 'MOMENT_X': {'DESCRIPTION': 'Total momentum x-component on all surfaces set ' + 'with MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CMx', + 'TYPE': 'COEFFICIENT'}, + 'MOMENT_Y': {'DESCRIPTION': 'Total momentum y-component on all surfaces set ' + 'with MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CMy', + 'TYPE': 'COEFFICIENT'}, + 'MOMENT_Z': {'DESCRIPTION': 'Total momentum z-component on all surfaces set ' + 'with MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CMz', + 'TYPE': 'COEFFICIENT'}, + 'NEARFIELD_OF': {'DESCRIPTION': 'Nearfield obj. function', + 'GROUP': 'EQUIVALENT_AREA', + 'HEADER': 'CNearFieldOF', + 'TYPE': 'COEFFICIENT'}, + 'PRESSURE_DROP': {'DESCRIPTION': 'Total pressure drop on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Pressure_Drop', + 'TYPE': 'COEFFICIENT'}, + 'RADIAL_DISTORTION': {'DESCRIPTION': 'Radial distortion', + 'GROUP': 'ENGINE_OUTPUT', + 'HEADER': 'Radial_Distortion', + 'TYPE': 'COEFFICIENT'}, + 'RMS_ADJ_DENSITY': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' + 'density.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_Rho]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_DISSIPATION': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint dissipation.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_w]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_ENERGY': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' + 'energy.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_E]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_HEAT': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' + 'temperature.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_T]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_MOMENTUM-X': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint momentum x-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_RhoU]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_MOMENTUM-Y': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint momentum y-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_RhoV]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_MOMENTUM-Z': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint momentum z-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_RhoW]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_NU_TILDE': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' + 'nu tilde.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_nu]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_PRESSURE': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' + 'Pressure.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_P]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_TEMPERATURE': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint temperature.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_T]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_TKE': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' + 'kinetic energy.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_k]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_VELOCITY-X': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint Velocity x-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_U]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_VELOCITY-Y': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint Velocity y-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_V]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ADJ_VELOCITY-Z': {'DESCRIPTION': 'Root-mean square residual of the ' + 'adjoint Velocity z-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[A_W]', + 'TYPE': 'RESIDUAL'}, + 'RMS_DENSITY': {'DESCRIPTION': 'Root-mean square residual of the density.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[Rho]', + 'TYPE': 'RESIDUAL'}, + 'RMS_DISP_X': {'DESCRIPTION': '', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[DispX]', + 'TYPE': 'RESIDUAL'}, + 'RMS_DISP_Y': {'DESCRIPTION': '', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[DispY]', + 'TYPE': 'RESIDUAL'}, + 'RMS_DISP_Z': {'DESCRIPTION': '', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[DispZ]', + 'TYPE': 'RESIDUAL'}, + 'RMS_DISSIPATION': {'DESCRIPTION': 'Root-mean square residual of dissipation ' + '(SST model).', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[w]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ENERGY': {'DESCRIPTION': 'Root-mean square residual of the energy.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[RhoE]', + 'TYPE': 'RESIDUAL'}, + 'RMS_ETOL': {'DESCRIPTION': '', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[E]', + 'TYPE': 'RESIDUAL'}, + 'RMS_MOMENTUM-X': {'DESCRIPTION': 'Root-mean square residual of the momentum ' + 'x-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[RhoU]', + 'TYPE': 'RESIDUAL'}, + 'RMS_MOMENTUM-Y': {'DESCRIPTION': 'Root-mean square residual of the momentum ' + 'y-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[RhoV]', + 'TYPE': 'RESIDUAL'}, + 'RMS_NU_TILDE': {'DESCRIPTION': 'Root-mean square residual of nu tilde (SA ' + 'model).', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[nu]', + 'TYPE': 'RESIDUAL'}, + 'RMS_PRESSURE': {'DESCRIPTION': 'Root-mean square residual of the pressure.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[P]', + 'TYPE': 'RESIDUAL'}, + 'RMS_RTOL': {'DESCRIPTION': '', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[R]', + 'TYPE': 'RESIDUAL'}, + 'RMS_TEMPERATURE': {'DESCRIPTION': 'Root mean square residual of the ' + 'temperature', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[T]', + 'TYPE': 'RESIDUAL'}, + 'RMS_TKE': {'DESCRIPTION': 'Root-mean square residual of kinetic energy (SST ' + 'model).', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[k]', + 'TYPE': 'RESIDUAL'}, + 'RMS_UTOL': {'DESCRIPTION': '', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[U]', + 'TYPE': 'RESIDUAL'}, + 'RMS_VELOCITY-X': {'DESCRIPTION': 'Root-mean square residual of the velocity ' + 'x-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[U]', + 'TYPE': 'RESIDUAL'}, + 'RMS_VELOCITY-Y': {'DESCRIPTION': 'Root-mean square residual of the velocity ' + 'y-component.', + 'GROUP': 'RMS_RES', + 'HEADER': 'rms[V]', + 'TYPE': 'RESIDUAL'}, + 'SECONDARY_OVER_UNIFORMITY': {'DESCRIPTION': 'Total secondary over uniformity ' + 'on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Secondary_Over_Uniformity', + 'TYPE': 'COEFFICIENT'}, + 'SECONDARY_STRENGTH': {'DESCRIPTION': 'Total secondary strength on all ' + 'markers set in MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Secondary_Strength', + 'TYPE': 'COEFFICIENT'}, + 'SENS_AOA': {'DESCRIPTION': 'Sensitivity of the objective function with ' + 'respect to the angle of attack (only for ' + 'compressible solver).', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_AoA', + 'TYPE': 'COEFFICIENT'}, + 'SENS_E': {'DESCRIPTION': '', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens[E]', + 'TYPE': 'DEFAULT'}, + 'SENS_GEO': {'DESCRIPTION': 'Sum of the geometrical sensitivities on all ' + 'markers set in MARKER_MONITORING.', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_Geo', + 'TYPE': 'COEFFICIENT'}, + 'SENS_MACH': {'DESCRIPTION': 'Sensitivity of the objective function with ' + 'respect to the Mach number (only of ' + 'compressible solver).', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_Mach', + 'TYPE': 'COEFFICIENT'}, + 'SENS_NU': {'DESCRIPTION': '', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens[Nu]', + 'TYPE': 'DEFAULT'}, + 'SENS_PRESS': {'DESCRIPTION': 'Sensitivity of the objective function with ' + 'respect to the far-field pressure.', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_Press', + 'TYPE': 'COEFFICIENT'}, + 'SENS_PRESS_OUT': {'DESCRIPTION': 'Sensitivity of the objective function with ' + 'respect to the outlet pressure.', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_Pout', + 'TYPE': 'COEFFICIENT'}, + 'SENS_TEMP': {'DESCRIPTION': 'Sensitivity of the objective function with ' + 'respect to the far-field temperature.', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_Temp', + 'TYPE': 'COEFFICIENT'}, + 'SENS_VEL_IN': {'DESCRIPTION': 'Sensitivity of the objective function with ' + 'respect to the inlet velocity.', + 'GROUP': 'SENSITIVITY', + 'HEADER': 'Sens_Vin', + 'TYPE': 'COEFFICIENT'}, + 'SIDEFORCE': {'DESCRIPTION': 'Total sideforce coefficient on all surfaces set ' + 'with MARKER_MONITORING', + 'GROUP': 'AERO_COEFF', + 'HEADER': 'CSF', + 'TYPE': 'COEFFICIENT'}, + 'SOLIDCDRAG': {'DESCRIPTION': 'Solid CD drag', + 'GROUP': 'ENGINE_OUTPUT', + 'HEADER': 'SolidCDrag', + 'TYPE': 'COEFFICIENT'}, + 'TEMPERATURE': {'DESCRIPTION': 'Total avg. temperature on all surfaces set ' + 'with MARKER_MONITORING.', + 'GROUP': 'HEAT', + 'HEADER': 'Temp', + 'TYPE': 'COEFFICIENT'}, + 'UNIFORMITY': {'DESCRIPTION': 'Total flow uniformity on all markers set in ' + 'MARKER_ANALYZE', + 'GROUP': 'FLOW_COEFF', + 'HEADER': 'Uniformity', + 'TYPE': 'COEFFICIENT'}, + 'VMS': {'DESCRIPTION': 'VMS', + 'GROUP': '', + 'HEADER': 'VonMises', + 'TYPE': 'DEFAULT'}} diff --git a/SU2_PY/SU2/io/state.py b/SU2_PY/SU2/io/state.py index e6fdf4355232..837ad459b612 100644 --- a/SU2_PY/SU2/io/state.py +++ b/SU2_PY/SU2/io/state.py @@ -240,8 +240,21 @@ def find_files(self,config): files = self.FILES mesh_name = config.MESH_FILENAME - direct_name = config.SOLUTION_FLOW_FILENAME + if config.get('READ_BINARY_RESTART', 'YES') == 'NO': + if not 'RESTART_ASCII' in config.get('OUTPUT_FILES',['RESTART']): + print ('RESTART_ASCII must be in OUTPUT_FILES if READ_BINARY_RESTART is set to NO') + sys.exit() + + direct_name = config.SOLUTION_FILENAME adjoint_name = config.SOLUTION_ADJ_FILENAME + + if 'RESTART_ASCII' in config.get('OUTPUT_FILES', ['RESTART']): + direct_name = direct_name.split('.')[0] + '.csv' + adjoint_name = adjoint_name.split('.')[0] + '.csv' + else: + direct_name = direct_name.split('.')[0] + '.dat' + adjoint_name = adjoint_name.split('.')[0] + '.dat' + targetea_name = 'TargetEA.dat' targetcp_name = 'TargetCp.dat' targetheatflux_name = 'TargetHeatFlux.dat' @@ -343,6 +356,9 @@ def register_file(label,filename): if 'INV_DESIGN_HEATFLUX' in special_cases: register_file('TARGET_HEATFLUX',targetheatflux_name) + # flow meta data file + register_file('FLOW_META', 'flow.meta') + return def __setitem__(self,k,v): diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index 6710ed652082..264cc64f48ff 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -42,6 +42,7 @@ import os import shutil, glob from SU2.util import ordered_bunch +from .historyMap import history_header_map as historyOutFields # ------------------------------------------------------------------- # Read SU2_DOT Gradient Values @@ -91,11 +92,11 @@ def read_plot( filename ): title = line.split('=')[1] .strip() # not used right now line = plot_file.readline() - # process header - if '=' in line: - line = line.split("=")[1].strip() + if line.startswith('VARIABLES'): + line = plot_file.readline() + line = line.split(",") - Variables = [ x.strip('" ') for x in line ] + Variables = [ x.strip().strip('"') for x in line ] n_Vars = len(Variables) # initialize plot data dictionary @@ -158,16 +159,13 @@ def read_history( History_filename, nZones = 1): # initialize history data dictionary history_data = ordered_bunch() - - # header name to config file name map - map_dict = get_headerMap(nZones) - + # map header names for key in plot_data.keys(): - if key in map_dict: - var = map_dict[key] - else: - var = key + var = key + for field in historyOutFields: + if key == historyOutFields[field]['HEADER']: + var = field history_data[var] = plot_data[key] return history_data @@ -182,88 +180,11 @@ def read_history( History_filename, nZones = 1): def get_headerMap(nZones = 1): - """ returns a dictionary that maps history file header names - to optimization problem function names - """ - # header name to config file name map - history_header_map = { "Iteration" : "ITERATION" , - "CL" : "LIFT" , - "CD" : "DRAG" , - "CSF" : "SIDEFORCE" , - "Cp_Diff" : "INVERSE_DESIGN_PRESSURE" , - "HeatFlux_Diff" : "INVERSE_DESIGN_HEATFLUX" , - "HeatFlux_Total" : "TOTAL_HEATFLUX" , - "HeatFlux_Maximum": "MAXIMUM_HEATFLUX" , - "Temperature_Total": "TOTAL_TEMPERATURE" , - "CMx" : "MOMENT_X" , - "CMy" : "MOMENT_Y" , - "CMz" : "MOMENT_Z" , - "CFx" : "FORCE_X" , - "CFy" : "FORCE_Y" , - "CFz" : "FORCE_Z" , - "CL/CD" : "EFFICIENCY" , - "AoA" : "AOA" , - "Custom_ObjFunc" : "CUSTOM_OBJFUNC" , - "CMerit" : "FIGURE_OF_MERIT" , - "Buffet_Metric" : "BUFFET" , - "CQ" : "TORQUE" , - "CT" : "THRUST" , - "CEquivArea" : "EQUIVALENT_AREA" , - "CNearFieldOF" : "NEARFIELD_PRESSURE" , - "Avg_TotalPress" : "SURFACE_TOTAL_PRESSURE" , - "Avg_Press" : "SURFACE_STATIC_PRESSURE" , - "Avg_MassFlow" : "SURFACE_MASSFLOW" , - "Avg_Mach" : "SURFACE_MACH" , - "Uniformity" : "SURFACE_UNIFORMITY" , - "Secondary_Strength" : "SURFACE_SECONDARY" , - "Momentum_Distortion" : "SURFACE_MOM_DISTORTION" , - "Secondary_Over_Uniformity" : "SURFACE_SECOND_OVER_UNIFORM" , - "Pressure_Drop" : "SURFACE_PRESSURE_DROP" , - "ComboObj" : "COMBO" , - "Time(min)" : "TIME" , - 'Time(min)"\n' : "TIME" , # TDE hack for paraview - "D(CL)" : "D_LIFT" , - "D(CD)" : "D_DRAG" , - "D(CSF)" : "D_SIDEFORCE" , - "D(CMx)" : "D_MOMENT_X" , - "D(CMy)" : "D_MOMENT_Y" , - "D(CMz)" : "D_MOMENT_Z" , - "D(CFx)" : "D_FORCE_X" , - "D(CFy)" : "D_FORCE_Y" , - "D(CFz)" : "D_FORCE_Z" , - "D(CL/CD)" : "D_EFFICIENCY" , - "D(Custom_ObjFunc)" : "D_CUSTOM_OBJFUNC" , - "D(HeatFlux_Total)" : "D_HEAT" , - "D(HeatFlux_Maximum)" : "D_HEAT_MAX" , - "TotalPressureLoss_1" : "TOTAL_PRESSURE_LOSS" , - "KineticEnergyLoss_1" : "KINETIC_ENERGY_LOSS" , - "EntropyGen_" + str(getTurboPerfIndex(nZones)) : "ENTROPY_GENERATION" , - "FlowAngleOut_1" : "FLOW_ANGLE_OUT" , - "FlowAngleIn_1" : "FLOW_ANGLE_IN" , - "MassFlowIn_1" : "MASS_FLOW_IN" , - "MassFlowOut_1" : "MASS_FLOW_OUT" , - "PressureRatio_1" : "PRESSURE_RATIO" , - "TotalEfficiency_" + str(getTurboPerfIndex(nZones)) : "TOTAL_EFFICIENCY" , - "TotalStaticEfficiency_3" : "TOTAL_STATIC_EFFICIENCY", - "D(TotalPressureLoss_0)" : "D_TOTAL_PRESSURE_LOSS" , - "D(TotalEfficiency_0)" : "D_TOTAL_EFFICIENCY" , - "D(TotalPressureLoss_0)" : "D_TOTAL_PRESSURE_LOSS" , - "D(KineticEnergyLoss_0)" : "D_KINETIC_ENERGY_LOSS" , - "D(TotalStaticEfficiency_0)" : "D_TOTAL_STATIC_EFFICIENCY", - "D(FlowAngleOut_0)" : "D_FLOW_ANGLE_OUT" , - "D(FlowAngleIn_0)" : "D_FLOW_ANGLE_IN" , - "D(MassFlowIn_0)" : "D_MASS_FLOW_IN" , - "D(MassFlowOut_0)" : "D_MASS_FLOW_OUT" , - "D(PressureRatio_0)" : "D_PRESSURE_RATIO" , - "D(EnthalpyOut_0)" : "D_ENTHALPY_OUT" , - "D(TotalEnthalpy_0)" : "D_TOTAL_ENTHALPY_OUT" , - "D(Uniformity)" : "D_SURFACE_UNIFORMITY" , - "D(Secondary_Strength)" : "D_SURFACE_SECONDARY" , - "D(Momentum_Distortion)" : "D_SURFACE_MOM_DISTORTION" , - "D(Secondary_Over_Uniformity)" : "D_SURFACE_SECOND_OVER_UNIFORM" , - "D(Pressure_Drop)" : "D_SURFACE_PRESSURE_DROP" } - - return history_header_map + headerMap = dict() + for outputField in historyOutFields: + headerMap[outputField] = historyOutFields[outputField]['HEADER'] + + return headerMap def getTurboPerfIndex(nZones = 1): @@ -281,54 +202,7 @@ def getTurboPerfIndex(nZones = 1): # Optimizer Function Names # ------------------------------------------------------------------- -# Aerodynamic Optimizer Function Names - -optnames_aero = [ "LIFT" , - "DRAG" , - "SIDEFORCE" , - "MOMENT_X" , - "MOMENT_Y" , - "MOMENT_Z" , - "FORCE_X" , - "FORCE_Y" , - "FORCE_Z" , - "EFFICIENCY" , - "FIGURE_OF_MERIT" , - "BUFFET" , - "TORQUE" , - "THRUST" , - "SURFACE_TOTAL_PRESSURE" , - "SURFACE_STATIC_PRESSURE" , - "SURFACE_MASSFLOW" , - "SURFACE_MACH" , - "SURFACE_UNIFORMITY" , - "SURFACE_SECONDARY" , - "SURFACE_MOM_DISTORTION" , - "SURFACE_SECOND_OVER_UNIFORM" , - "SURFACE_PRESSURE_DROP" , - "EQUIVALENT_AREA" , - "NEARFIELD_PRESSURE" , - "INVERSE_DESIGN_PRESSURE" , - "INVERSE_DESIGN_HEATFLUX" , - "TOTAL_HEATFLUX" , - "MAXIMUM_HEATFLUX" , - "CUSTOM_OBJFUNC" , - "COMBO"] - -# Turbo performance optimizer Function Names -optnames_turbo = ["TOTAL_PRESSURE_LOSS" , - "KINETIC_ENERGY_LOSS" , - "ENTROPY_GENERATION" , - "EULERIAN_WORK" , - "FLOW_ANGLE_IN" , - "FLOW_ANGLE_OUT" , - "MASS_FLOW_IN" , - "MASS_FLOW_OUT" , - "PRESSURE_RATIO" , - "TOTAL_EFFICIENCY" , - "TOTAL_STATIC_EFFICIENCY" , - ] -#: optnames_aero +#: optnames_stab optnames_stab = [ "D_LIFT_D_ALPHA" , "D_DRAG_D_ALPHA" , @@ -408,68 +282,6 @@ def getTurboPerfIndex(nZones = 1): #: optnames_geo -grad_names_directdiff = ["D_LIFT", - "D_DRAG", - "D_SIDEFORCE", - "D_MOMENT_X", - "D_MOMENT_Y", - "D_MOMENT_Z", - "D_FORCE_X", - "D_FORCE_Y", - "D_FORCE_Z", - "D_EFFICIENCY", - "D_CUSTOM_OBJFUNC", - "D_HEAT", - "D_MAX_HEAT", - "D_TOTAL_PRESSURE_LOSS", - "D_TOTAL_EFFICIENCY", - "D_TOTAL_PRESSURE_LOSS", - "D_KINETIC_ENERGY_LOSS", - "D_TOTAL_STATIC_EFFICIENCY", - "D_FLOW_ANGLE_OUT", - "D_FLOW_ANGLE_IN", - "D_MASS_FLOW_IN", - "D_MASS_FLOW_OUT", - "D_PRESSURE_RATIO", - "D_ENTHALPY_OUT", - "D_TOTAL_ENTHALPY_OUT", - "D_SURFACE_UNIFORMITY", - "D_SURFACE_SECONDARY", - "D_SURFACE_MOM_DISTORTION", - "D_SURFACE_SECOND_OVER_UNIFORM", - "D_SURFACE_PRESSURE_DROP"] - -grad_names_map = ordered_bunch() -grad_names_map.MASS_FLOW_IN = "D_MASS_FLOW_IN" -grad_names_map.MOMENT_Z = "D_MOMENT_Z" -grad_names_map.FLOW_ANGLE_OUT = "D_FLOW_ANGLE_OUT" -grad_names_map.MASS_FLOW_OUT = "D_MASS_FLOW_OUT" -grad_names_map.FLOW_ANGLE_IN = "D_FLOW_ANGLE_IN" -grad_names_map.FORCE_Z = "D_FORCE_Z" -grad_names_map.FORCE_Y = "D_FORCE_Y" -grad_names_map.FORCE_X = "D_FORCE_X" -grad_names_map.TOTAL_EFFICIENCY = "D_TOTAL_EFFICIENCY" -grad_names_map.TOTAL_STATIC_EFFICIENCY = "D_TOTAL_STATIC_EFFICIENCY" -grad_names_map.PRESSURE_RATIO = "D_PRESSURE_RATIO" -grad_names_map.EFFICIENCY = "D_EFFICIENCY" -grad_names_map.DRAG = "D_DRAG" -grad_names_map.LIFT = "D_LIFT" -grad_names_map.TOTAL_ENTHALPY_OUT = "D_TOTAL_ENTHALPY_OUT" -grad_names_map.TOTAL_PRESSURE_LOSS = "D_TOTAL_PRESSURE_LOSS" -grad_names_map.MOMENT_Y = "D_MOMENT_Y" -grad_names_map.MOMENT_X="D_MOMENT_X" -grad_names_map.SIDEFORCE = "D_SIDEFORCE" -grad_names_map.ENTHALPY_OUT = "D_ENTHALPY_OUT" -grad_names_map.KINETIC_ENERGY_LOSS = "D_KINETIC_ENERGY_LOSS" -grad_names_map.CUSTOM_OBJFUNC = "D_CUSTOM_OBJFUNC" -grad_names_map.HEAT = "D_HEAT" -grad_names_map.MAX_HEAT = "D_MAX_HEAT" -grad_names_map.SURFACE_UNIFORMITY = "D_SURFACE_UNIFORMITY" -grad_names_map.SURFACE_SECONDARY = "D_SURFACE_SECONDARY" -grad_names_map.SURFACE_MOM_DISTORTION = "D_SURFACE_MOM_DISTORTION" -grad_names_map.SURFACE_SECOND_OVER_UNIFORM = "D_SURFACE_SECOND_OVER_UNIFORM" -grad_names_map.SURFACE_PRESSURE_DROP = "D_SURFACE_PRESSURE_DROP" - # per-surface functions per_surface_map = {"LIFT" : "CL" , "DRAG" : "CD" , @@ -511,24 +323,22 @@ def read_aerodynamics( History_filename , nZones = 1, special_cases=[], final_av Outputs: dictionary with function keys and thier values - if special cases has 'UNSTEADY_SIMULATION', returns time averaged data + if special cases has 'TIME_MARCHING', returns time averaged data otherwise returns final value from history file """ # read the history data history_data = read_history(History_filename, nZones) - # list of functions to pull - func_names = optnames_aero + grad_names_directdiff + optnames_turbo - # pull only these functions Func_Values = ordered_bunch() - for this_objfun in func_names: + for this_objfun in historyOutFields: if this_objfun in history_data: - Func_Values[this_objfun] = history_data[this_objfun] + if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': + Func_Values[this_objfun] = history_data[this_objfun] # for unsteady cases, average time-accurate objective function values - if 'UNSTEADY_SIMULATION' in special_cases and not final_avg: + if 'TIME_MARCHING' in special_cases and not final_avg: for key,value in Func_Values.items(): Func_Values[key] = sum(value)/len(value) @@ -784,9 +594,9 @@ def get_gradFileFormat(grad_type,plot_format,kindID,special_cases=[]): write_format = [] # handle plot formating - if (plot_format == 'TECPLOT') or (plot_format == 'TECPLOT_BINARY'): + if (plot_format == 'TECPLOT'): header.append('VARIABLES=') - elif (plot_format == 'PARAVIEW') or (plot_format == 'PARAVIEW_BINARY'): + elif (plot_format == 'CSV'): pass else: raise Exception('output plot format not recognized') @@ -910,9 +720,9 @@ def get_optFileFormat(plot_format,special_cases=None, nZones = 1): write_format = [] # handle plot formating - if (plot_format == 'TECPLOT') or (plot_format == 'TECPLOT_BINARY'): + if (plot_format == 'TECPLOT'): header_format = header_format + 'VARIABLES=' - elif (plot_format == 'PARAVIEW') or (plot_format == 'PARAVIEW_BINARY'): + elif (plot_format == 'CSV'): pass else: raise Exception('output plot format not recognized') @@ -968,11 +778,11 @@ def get_extension(output_format): if (output_format == "PARAVIEW") : return ".csv" if (output_format == "PARAVIEW_BINARY") : return ".csv" if (output_format == "TECPLOT") : return ".dat" - if (output_format == "TECPLOT_BINARY") : return ".plt" + if (output_format == "TECPLOT_BINARY") : return ".szplt" if (output_format == "SOLUTION") : return ".dat" if (output_format == "RESTART") : return ".dat" if (output_format == "CONFIG") : return ".cfg" - + if (output_format == "CSV") : return ".csv" # otherwise raise Exception("Output Format Unknown") @@ -1001,19 +811,16 @@ def get_specialCases(config): if 'SOLVER' in config and config['SOLVER'] == key: special_cases.append(key) - if config.get('UNSTEADY_SIMULATION','NO') != 'NO': - special_cases.append('UNSTEADY_SIMULATION') + if config.get('TIME_MARCHING','NO') != 'NO': + special_cases.append('TIME_MARCHING') # no support for more than one special case if len(special_cases) > 1: error_str = 'Currently cannot support ' + ' and '.join(special_cases) + ' at once' raise Exception(error_str) - - if (config['WRT_SOL_FREQ'] != 1) and ('WRT_UNSTEADY' in special_cases): - raise Exception('Must set WRT_SOL_FREQ= 1 for WRT_UNSTEADY= YES') # Special case for harmonic balance - if 'UNSTEADY_SIMULATION' in config and config['UNSTEADY_SIMULATION'] == 'HARMONIC_BALANCE': + if 'TIME_MARCHING' in config and config['TIME_MARCHING'] == 'HARMONIC_BALANCE': special_cases.append('HARMONIC_BALANCE') # Special case for rotating frame @@ -1088,7 +895,7 @@ def expand_part(name,config): return names def expand_time(name,config): - if 'UNSTEADY_SIMULATION' in get_specialCases(config): + if 'TIME_MARCHING' in get_specialCases(config): n_time = config['UNST_ADJOINT_ITER'] if not isinstance(name, list): name_pat = add_suffix(name,'%05d') @@ -1207,9 +1014,18 @@ def restart2solution(config,state={}): # direct solution if config.MATH_PROBLEM == 'DIRECT': - restart = config.RESTART_FLOW_FILENAME - solution = config.SOLUTION_FLOW_FILENAME + restart = config.RESTART_FILENAME + solution = config.SOLUTION_FILENAME + restart = restart.split('.')[0] + solution = solution.split('.')[0] + if 'RESTART_ASCII' in config.get('OUTPUT_FILES', ['RESTART_BINARY']): + restart += '.csv' + solution += '.csv' + else: + restart += '.dat' + solution += '.dat' + # expand zones restarts = expand_zones(restart,config) solutions = expand_zones(solution,config) @@ -1226,6 +1042,15 @@ def restart2solution(config,state={}): elif any([config.MATH_PROBLEM == 'CONTINUOUS_ADJOINT', config.MATH_PROBLEM == 'DISCRETE_ADJOINT']): restart = config.RESTART_ADJ_FILENAME solution = config.SOLUTION_ADJ_FILENAME + restart = restart.split('.')[0] + solution = solution.split('.')[0] + + if 'RESTART_ASCII' in config.get('OUTPUT_FILES', ['RESTART_BINARY']): + restart += '.csv' + solution += '.csv' + else: + restart += '.dat' + solution += '.dat' # add suffix func_name = config.OBJECTIVE_FUNCTION suffix = get_adjointSuffix(func_name) diff --git a/SU2_PY/SU2/opt/project.py b/SU2_PY/SU2/opt/project.py index 7460103146fb..72ae05579c7a 100644 --- a/SU2_PY/SU2/opt/project.py +++ b/SU2_PY/SU2/opt/project.py @@ -48,7 +48,7 @@ from .. import eval as su2eval from .. import util as su2util from ..io import redirect_folder - +from ..io import historyOutFields from warnings import warn, simplefilter #simplefilter(Warning,'ignore') @@ -133,6 +133,11 @@ def __init__( self, config, state=None , config['OBJECTIVE_WEIGHT'] = ",".join(weights) config['OBJECTIVE_FUNCTION'] = ",".join(objectives) + for this_obj in def_objs: + group = historyOutFields[this_obj]['GROUP'] + if not group in config.HISTORY_OUTPUT: + config.HISTORY_OUTPUT.append(group) + # setup state if state is None: state = su2io.State() @@ -492,7 +497,7 @@ def deep_compile(self): def plot_results(self): """ writes a tecplot file for plotting design results """ - output_format = self.config.OUTPUT_FORMAT + output_format = self.config.TABULAR_FORMAT functions = self.results.FUNCTIONS history = self.results.HISTORY @@ -501,7 +506,7 @@ def plot_results(self): results_plot.update(functions) results_plot.update(history.get('DIRECT',{})) - if (output_format == 'PARAVIEW') or (output_format == 'PARAVIEW_BINARY'): + if (output_format == 'CSV'): su2util.write_plot('history_project.csv',output_format,results_plot) else: su2util.write_plot('history_project.dat',output_format,results_plot) diff --git a/SU2_PY/SU2/run/adjoint.py b/SU2_PY/SU2/run/adjoint.py index 0a1631284100..606094cda949 100644 --- a/SU2_PY/SU2/run/adjoint.py +++ b/SU2_PY/SU2/run/adjoint.py @@ -93,7 +93,7 @@ def adjoint( config ): su2merge(konfig) # filenames - plot_format = konfig['OUTPUT_FORMAT'] + plot_format = konfig.get('TABULAR_FORMAT', 'CSV') plot_extension = su2io.get_extension(plot_format) history_filename = konfig['CONV_FILENAME'] + plot_extension special_cases = su2io.get_specialCases(konfig) @@ -111,7 +111,7 @@ def adjoint( config ): objective="COMBO" adj_title = 'ADJOINT_' + objective suffix = su2io.get_adjointSuffix(objective) - restart_name = konfig['RESTART_FLOW_FILENAME'] + restart_name = konfig['RESTART_FILENAME'] restart_name = su2io.add_suffix(restart_name,suffix) # info out diff --git a/SU2_PY/SU2/run/direct.py b/SU2_PY/SU2/run/direct.py index ea89ee04f7ab..fa54184dbb85 100644 --- a/SU2_PY/SU2/run/direct.py +++ b/SU2_PY/SU2/run/direct.py @@ -90,13 +90,13 @@ def direct ( config ): multizone_cases = su2io.get_multizone(konfig) # merge - konfig['SOLUTION_FLOW_FILENAME'] = konfig['RESTART_FLOW_FILENAME'] + konfig['SOLUTION_FILENAME'] = konfig['RESTART_FILENAME'] if 'FLUID_STRUCTURE_INTERACTION' in multizone_cases: - konfig['SOLUTION_STRUCTURE_FILENAME'] = konfig['RESTART_STRUCTURE_FILENAME'] + konfig['SOLUTION_FILENAME'] = konfig['RESTART_FILENAME'] su2merge(konfig) # filenames - plot_format = konfig['OUTPUT_FORMAT'] + plot_format = konfig.get('TABULAR_FORMAT', 'CSV') plot_extension = su2io.get_extension(plot_format) history_filename = konfig['CONV_FILENAME'] + plot_extension special_cases = su2io.get_specialCases(konfig) @@ -114,7 +114,7 @@ def direct ( config ): # info out info = su2io.State() info.FUNCTIONS.update( aerodynamics ) - info.FILES.DIRECT = konfig['RESTART_FLOW_FILENAME'] + info.FILES.DIRECT = konfig['RESTART_FILENAME'] if 'EQUIV_AREA' in special_cases: info.FILES.WEIGHT_NF = 'WeightNF.dat' if 'INV_DESIGN_CP' in special_cases: diff --git a/SU2_PY/SU2/run/geometry.py b/SU2_PY/SU2/run/geometry.py index cb00f40f1653..550d6963f51a 100644 --- a/SU2_PY/SU2/run/geometry.py +++ b/SU2_PY/SU2/run/geometry.py @@ -79,11 +79,18 @@ def geometry ( config , step = 1e-3 ): # unpack function_name = konfig['GEO_PARAM'] - + tabular_format = konfig.get('TABULAR_FORMAT', 'CSV') func_filename = konfig['VALUE_OBJFUNC_FILENAME'] - grad_filename = konfig['GRAD_OBJFUNC_FILENAME'] + if tabular_format == 'CSV': + func_filename = func_filename.split('.')[0] + '.csv' + grad_filename = grad_filename.split('.')[0] + '.csv' + else: + func_filename = func_filename.split('.')[0] + '.dat' + grad_filename = grad_filename.split('.')[0] + '.dat' + + # choose dv values Definition_DV = konfig['DEFINITION_DV'] n_DV = len(Definition_DV['KIND']) diff --git a/SU2_PY/SU2/run/merge.py b/SU2_PY/SU2/run/merge.py index 5e5c7bd7b0ea..980785ad8bc1 100644 --- a/SU2_PY/SU2/run/merge.py +++ b/SU2_PY/SU2/run/merge.py @@ -84,8 +84,6 @@ def merge( config ): # # MERGING # # if 'FLUID_STRUCTURE_INTERACTION' in multizone_cases: merge_multizone(konfig) - elif konfig['OUTPUT_FORMAT'] == 'PARAVIEW_BINARY': - pass else: if 'WRT_UNSTEADY' in special_cases: merge_unsteady(konfig) diff --git a/SU2_PY/SU2/run/projection.py b/SU2_PY/SU2/run/projection.py index 54b027ffaefc..5474caee13b1 100644 --- a/SU2_PY/SU2/run/projection.py +++ b/SU2_PY/SU2/run/projection.py @@ -94,7 +94,7 @@ def projection( config, state={}, step = 1e-3 ): # filenames objective = konfig['OBJECTIVE_FUNCTION'] grad_filename = konfig['GRAD_OBJFUNC_FILENAME'] - output_format = konfig['OUTPUT_FORMAT'] + output_format = konfig.get('TABULAR_FORMAT', 'CSV') plot_extension = su2io.get_extension(output_format) adj_suffix = su2io.get_adjointSuffix(objective) grad_plotname = os.path.splitext(grad_filename)[0] + '_' + adj_suffix + plot_extension diff --git a/SU2_PY/SU2/util/plot.py b/SU2_PY/SU2/util/plot.py index b194e0fbc134..a97d8061962d 100644 --- a/SU2_PY/SU2/util/plot.py +++ b/SU2_PY/SU2/util/plot.py @@ -56,7 +56,7 @@ def write_plot(filename,plot_format,data_plot,keys_plot=None): keys_space = [default_spacing] * len(keys_plot) header = '' - if (plot_format == 'TECPLOT') or (plot_format == 'TECPLOT_BINARY'): + if (plot_format == 'TECPLOT'): header = 'VARIABLES=' indent_spacing += 10 indent_spacing = ' '*indent_spacing @@ -98,5 +98,5 @@ def tecplot(filename,data_plot,keys_plot=[]): write_plot(filename,'TECPLOT',data_plot,keys_plot) def paraview(filename,data_plot,keys_plot=[]): - write_plot(filename,'PARAVIEW',data_plot,keys_plot) + write_plot(filename,'CSV',data_plot,keys_plot) diff --git a/SU2_PY/SU2_CFD.py b/SU2_PY/SU2_CFD.py index 8590a9f83cbd..b67b8d568532 100755 --- a/SU2_PY/SU2_CFD.py +++ b/SU2_PY/SU2_CFD.py @@ -94,10 +94,10 @@ def main(): SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); elif options.harmonic_balance: SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm); - elif (options.nZone == 2) and (options.fsi): + elif (options.nZone >= 2): SU2Driver = pysu2.CMultizoneDriver(options.filename, options.nZone, comm); else: - SU2Driver = pysu2.CFluidDriver(options.filename, options.nZone, comm); + SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) if options.with_MPI == True: diff --git a/SU2_PY/compute_polar.py b/SU2_PY/compute_polar.py index 0f751804f357..994967b6896b 100755 --- a/SU2_PY/compute_polar.py +++ b/SU2_PY/compute_polar.py @@ -164,7 +164,7 @@ def main(): # prepare config config.NUMBER_PART = options.partitions if options.iterations > 0: - config.EXT_ITER = options.iterations + config.ITER = options.iterations config.NZONES = 1 # find solution files if they exist @@ -396,10 +396,10 @@ def main(): # if caseName exists copy the restart file from it for run continuation # Continue from previous sweep point if this is not he first if os.path.isdir(caseName): - command = 'cp '+caseName+'/'+config.SOLUTION_FLOW_FILENAME+' .' + command = 'cp '+caseName+'/'+config.SOLUTION_FILENAME+' .' if options.verbose: print(command) - shutil.copy2(caseName+'/'+config.SOLUTION_FLOW_FILENAME, os.getcwd()) + shutil.copy2(caseName+'/'+config.SOLUTION_FILENAME, os.getcwd()) konfig.RESTART_SOL = 'YES' else: konfig.RESTART_SOL = 'NO' @@ -407,7 +407,7 @@ def main(): else: konfig.RESTART_SOL = 'YES' if konfig.RESTART_SOL == 'YES': - ztate.FILES.DIRECT = config.SOLUTION_FLOW_FILENAME + ztate.FILES.DIRECT = config.SOLUTION_FILENAME # run su2 if options.Wind: drag = SU2.eval.func('DRAG', konfig, ztate) @@ -464,7 +464,7 @@ def main(): # save data SU2.io.save_data('results.pkl', results) shutil.copy2('results.pkl', 'DIRECT') - shutil.copy2(config.SOLUTION_FLOW_FILENAME, 'DIRECT') + shutil.copy2(config.SOLUTION_FILENAME, 'DIRECT') if os.path.isdir(caseName): command = 'cat '+caseName+\ @@ -484,8 +484,8 @@ def main(): f.close() if os.path.isdir('DIRECT'): shutil.rmtree('DIRECT') - if os.path.isfile(config.SOLUTION_FLOW_FILENAME): - os.remove(config.SOLUTION_FLOW_FILENAME) + if os.path.isfile(config.SOLUTION_FILENAME): + os.remove(config.SOLUTION_FILENAME) if os.path.isfile('results.pkl'): os.remove('results.pkl') print('Post sweep cleanup completed') diff --git a/SU2_PY/compute_uncertainty.py b/SU2_PY/compute_uncertainty.py index 1ba4f2162a0f..1323c02232ac 100755 --- a/SU2_PY/compute_uncertainty.py +++ b/SU2_PY/compute_uncertainty.py @@ -98,7 +98,7 @@ def main(): ztate.update(info) # Solution merging - konfig.SOLUTION_FLOW_FILENAME = konfig.RESTART_FLOW_FILENAME + konfig.SOLUTION_FILENAME = konfig.RESTART_FILENAME info = SU2.run.merge(konfig) ztate.update(info) @@ -125,7 +125,7 @@ def main(): ztate.update(info) # Solution merging - konfig.SOLUTION_FLOW_FILENAME = konfig.RESTART_FLOW_FILENAME + konfig.SOLUTION_FILENAME = konfig.RESTART_FILENAME info = SU2.run.merge(konfig) state.update(info) @@ -151,16 +151,16 @@ def main(): ztate.update(info) # Solution merging - konfig.SOLUTION_FLOW_FILENAME = konfig.RESTART_FLOW_FILENAME + konfig.SOLUTION_FILENAME = konfig.RESTART_FILENAME info = SU2.run.merge(konfig) ztate.update(info) def sendOutputFiles( config, folderName = ''): config.CONV_FILENAME = folderName + config.CONV_FILENAME #config.BREAKDOWN_FILENAME = folderName + config.BREAKDOWN_FILENAME - config.RESTART_FLOW_FILENAME = folderName + config.RESTART_FLOW_FILENAME - config.VOLUME_FLOW_FILENAME = folderName + config.VOLUME_FLOW_FILENAME - config.SURFACE_FLOW_FILENAME = folderName + config.SURFACE_FLOW_FILENAME + config.RESTART_FILENAME = folderName + config.RESTART_FILENAME + config.VOLUME_FILENAME = folderName + config.VOLUME_FILENAME + config.SURFACE_FILENAME = folderName + config.SURFACE_FILENAME if __name__ == "__main__": diff --git a/SU2_PY/continuous_adjoint.py b/SU2_PY/continuous_adjoint.py index ef0a0af1b0eb..898d90a76a77 100755 --- a/SU2_PY/continuous_adjoint.py +++ b/SU2_PY/continuous_adjoint.py @@ -95,6 +95,12 @@ def continuous_adjoint( filename , # Force CSV output in order to compute gradients config.WRT_CSV_SOL = 'YES' + if not 'OUTPUT_FILES' in config: + config['OUTPUT_FILES'] = ['RESTART'] + + if not 'SURFACE_CSV' in config['OUTPUT_FILES']: + config['OUTPUT_FILES'].append('SURFACE_CSV') + # check for existing files if not compute: config.RESTART_SOL = 'YES' diff --git a/SU2_PY/convert_to_csv.py b/SU2_PY/convert_to_csv.py new file mode 100755 index 000000000000..5783528aa591 --- /dev/null +++ b/SU2_PY/convert_to_csv.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +## \file convert_to_csv.py +# \brief This script converts SU2 ASCII restart files generated with a version prior v7 to the CSV format +# \author T. Albring +# \version 6.2.0 "Falcon" +# +# SU2 Lead Developers: Dr. Francisco Palacios (Francisco.D.Palacios@boeing.com). +# Dr. Thomas D. Economon (economon@stanford.edu). +# +# SU2 Developers: Prof. Juan J. Alonso's group at Stanford University. +# Prof. Piero Colonna's group at Delft University of Technology. +# Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. +# Prof. Alberto Guardone's group at Polytechnic University of Milan. +# Prof. Rafael Palacios' group at Imperial College London. +# Prof. Edwin van der Weide's group at the University of Twente. +# Prof. Vincent Terrapon's group at the University of Liege. +# +# Copyright (C) 2012-2016 SU2, the open-source CFD code. +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +from optparse import OptionParser +import os + +parser = OptionParser(usage = "%prog -i INPUT_FILE", + description = 'This script converts SU2 ASCII restart files generated with a version prior v7 to the CSV format') +parser.add_option("-i", "--inputfile", dest="infile", + help="ASCII restart file (*.dat)", metavar="INPUT_FILE") +(options, args)=parser.parse_args() + + +infile = open(options.infile, "r") +out_name = options.infile.split('.')[0] + ".csv" +if (os.path.isfile(out_name)): + print('File ' + out_name + ' already exists.') + exit(1) +outfile = open(out_name, "w") + +while 1: + line = infile.readline() + if not line: + break + + line = line.split() + for i, val in enumerate(line): + outfile.write(val.strip()) + if i != len(line)-1: + outfile.write(', ') + outfile.write('\n') + +print('Converted ' + options.infile + ' to ' + out_name) diff --git a/SU2_PY/direct_differentiation.py b/SU2_PY/direct_differentiation.py index e80f30bcc650..c51e30fc9daa 100755 --- a/SU2_PY/direct_differentiation.py +++ b/SU2_PY/direct_differentiation.py @@ -89,7 +89,17 @@ def direct_differentiation( filename , # State state = SU2.io.State() state.find_files(config) + + foundDerivativeField = False + for fields in SU2.io.historyOutFields: + group = SU2.io.historyOutFields[fields]['GROUP'] + if group in config.HISTORY_OUTPUT: + if SU2.io.historyOutFields[fields]['TYPE'] == 'D_COEFFICIENT': + foundDerivativeField = True + if not foundDerivativeField: + sys.exit('No derivative field found in HISTORY_OUTPUT') + # Direct Differentiation Gradients SU2.eval.gradients.directdiff(config,state) diff --git a/SU2_PY/fsi_computation.py b/SU2_PY/fsi_computation.py index a4badccf3a22..f81c2e04d74b 100755 --- a/SU2_PY/fsi_computation.py +++ b/SU2_PY/fsi_computation.py @@ -161,7 +161,7 @@ def main(): comm.barrier() # --- Launch a steady or unsteady FSI computation --- # - if FSI_config['UNSTEADY_SIMULATION'] == "YES": + if FSI_config['TIME_MARCHING'] == "YES": try: FSIInterface.UnsteadyFSI(FSI_config, FluidSolver, SolidSolver) except NameError as exception: diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index fc5d7a5213ea..319fad083049 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -31,6 +31,7 @@ install_data(['SU2/io/config.py', 'SU2/io/redirect.py', 'SU2/io/state.py', 'SU2/io/tools.py', + 'SU2/io/historyMap.py', 'SU2/io/__init__.py'], install_dir: join_paths(get_option('bindir'), 'SU2/io')) diff --git a/SU2_PY/parallel_computation.py b/SU2_PY/parallel_computation.py index a538298b0574..79678aa00ba9 100755 --- a/SU2_PY/parallel_computation.py +++ b/SU2_PY/parallel_computation.py @@ -96,7 +96,7 @@ def parallel_computation( filename , # Solution merging if config.MATH_PROBLEM == 'DIRECT': - config.SOLUTION_FLOW_FILENAME = config.RESTART_FLOW_FILENAME + config.SOLUTION_FILENAME = config.RESTART_FILENAME elif config.MATH_PROBLEM in ['CONTINUOUS_ADJOINT', 'DISCRETE_ADJOINT']: config.SOLUTION_ADJ_FILENAME = config.RESTART_ADJ_FILENAME info = SU2.run.merge(config) diff --git a/SU2_PY/parallel_computation_fsi.py b/SU2_PY/parallel_computation_fsi.py index 4f837691ef5e..f733917c8620 100755 --- a/SU2_PY/parallel_computation_fsi.py +++ b/SU2_PY/parallel_computation_fsi.py @@ -96,10 +96,10 @@ def parallel_computation( filename , # Solution merging if config.SOLVER == 'FEM_ELASTICITY': - config.SOLUTION_STRUCTURE_FILENAME = config.RESTART_STRUCTURE_FILENAME + config.SOLUTION_FILENAME = config.RESTART_FILENAME elif config.SOLVER == 'FLUID_STRUCTURE_INTERACTION': - config.SOLUTION_FLOW_FILENAME = config.RESTART_FLOW_FILENAME - config.SOLUTION_STRUCTURE_FILENAME = config.RESTART_STRUCTURE_FILENAME + config.SOLUTION_FILENAME = config.RESTART_FILENAME + config.SOLUTION_FILENAME = config.RESTART_FILENAME info = SU2.run.merge(config) state.update(info) diff --git a/SU2_PY/updateHistoryMap.py b/SU2_PY/updateHistoryMap.py new file mode 100644 index 000000000000..78c1c4369f99 --- /dev/null +++ b/SU2_PY/updateHistoryMap.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python + +## \file updateHistoryMap.py +# \brief Python script for updating the historyMap.py file. +# \author T. Albring +# \version 6.2.0 "Falcon" +# +# The current SU2 release has been coordinated by the +# SU2 International Developers Society +# with selected contributions from the open-source community. +# +# The main research teams contributing to the current release are: +# - Prof. Juan J. Alonso's group at Stanford University. +# - Prof. Piero Colonna's group at Delft University of Technology. +# - Prof. Nicolas R. Gauger's group at Kaiserslautern University of Technology. +# - Prof. Alberto Guardone's group at Polytechnic University of Milan. +# - Prof. Rafael Palacios' group at Imperial College London. +# - Prof. Vincent Terrapon's group at the University of Liege. +# - Prof. Edwin van der Weide's group at the University of Twente. +# - Lab. of New Concepts in Aeronautics at Tech. Institute of Aeronautics. +# +# Copyright 2012-2019, Francisco D. Palacios, Thomas D. Economon, +# Tim Albring, and the SU2 contributors. +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . +import os, pprint + +su2_home = os.environ['SU2_HOME'] + +fileList = ['CFlowOutput.cpp', +'CFlowIncOutput.cpp', +'CFlowCompOutput.cpp', +'CHeatOutput.cpp', +'CFlowCompFEMOutput.cpp', +'CElasticityOutput.cpp', +'CAdjHeatOutput.cpp', +'CAdjFlowIncOutput.cpp', +'CAdjFlowCompOutput.cpp', +'CAdjElasticityOutput.cpp'] + +fileList = [os.path.join(su2_home, 'SU2_CFD/src/output/' + i) for i in fileList] + +def parse_output(files): + outputFields = dict() + + for file in files: + print('Parsing ' + file) + f = open(file,'r') + while(1): + s = f.readline().strip(' ') + if not s: + break + if s.startswith('AddHistoryOutput('): + s = s.replace('AddHistoryOutput', '').strip('()').split(',') + curOutputField = dict() + name = s[0].strip(' ()"\n;') + curOutputField['HEADER'] = s[1].strip(' ()"\n;') + curOutputField['GROUP'] = s[3].strip(' ()"\n;') + curOutputField['DESCRIPTION'] = s[4].strip(' ()"\n;') + if len(s) == 6: + curOutputField['TYPE'] = s[5].strip(' ()"\n;').split('::')[1] + else: + curOutputField['TYPE'] = 'DEFAULT' + outputFields[name] = curOutputField + f.close() + + addedOutputFields = dict() + + for field in outputFields: + if outputFields[field]['TYPE'] == 'COEFFICIENT': + curOutputField = dict() + name = 'D_' + field + curOutputField['HEADER'] = 'd[' + outputFields[field]['HEADER'] + ']' + curOutputField['GROUP'] = 'D_' + outputFields[field]['GROUP'] + curOutputField['TYPE'] = 'D_COEFFICIENT' + curOutputField['DESCRIPTION'] = 'Derivative value' + addedOutputFields[name] = curOutputField + + outputFields.update(addedOutputFields) + f = open(os.path.join(su2_home) + 'SU2_PY/SU2/io/historyMap.py', 'w') + f.write('history_header_map = ') + pprint.pprint(outputFields, f) + f.close() + +parse_output(fileList) diff --git a/SU2_SOL/include/SU2_SOL.hpp b/SU2_SOL/include/SU2_SOL.hpp index 7e81bc94c997..4905c3aa65a3 100644 --- a/SU2_SOL/include/SU2_SOL.hpp +++ b/SU2_SOL/include/SU2_SOL.hpp @@ -43,8 +43,11 @@ #include #include "../../SU2_CFD/include/solver_structure.hpp" -#include "../../SU2_CFD/include/output_structure.hpp" +#include "../../SU2_CFD/include/output/CBaselineOutput.hpp" #include "../../Common/include/geometry_structure.hpp" #include "../../Common/include/config_structure.hpp" + +void WriteFiles(CConfig *config, CGeometry* geometry, CSolver** solver_container, COutput* output, unsigned long TimeIter); + using namespace std; diff --git a/SU2_SOL/src/SU2_SOL.cpp b/SU2_SOL/src/SU2_SOL.cpp index 78280dc6a2ca..5ceeb85940cf 100644 --- a/SU2_SOL/src/SU2_SOL.cpp +++ b/SU2_SOL/src/SU2_SOL.cpp @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) { unsigned short iZone, nZone = SINGLE_ZONE, iInst; su2double StartTime = 0.0, StopTime = 0.0, UsedTime = 0.0; - ofstream ConvHist_file; + char config_file_name[MAX_STRING_SIZE]; int rank = MASTER_NODE; int size = SINGLE_NODE; @@ -64,7 +64,7 @@ int main(int argc, char *argv[]) { /*--- Pointer to different structures that will be used throughout the entire code ---*/ - COutput *output = NULL; + COutput **output = NULL; CGeometry ***geometry_container = NULL; CSolver ***solver_container = NULL; CConfig **config_container = NULL; @@ -89,12 +89,14 @@ int main(int argc, char *argv[]) { geometry_container = new CGeometry**[nZone]; nInst = new unsigned short[nZone]; driver_config = NULL; - + output = new COutput*[nZone]; + for (iZone = 0; iZone < nZone; iZone++) { solver_container[iZone] = NULL; config_container[iZone] = NULL; geometry_container[iZone] = NULL; nInst[iZone] = 1; + output[iZone] = NULL; } /*--- Initialize the configuration of the driver ---*/ @@ -257,13 +259,12 @@ int main(int argc, char *argv[]) { if (rank == MASTER_NODE) cout << endl <<"------------------------- Solution Postprocessing -----------------------" << endl; - /*--- Definition of the output class (one for all the zones) ---*/ - output = new COutput(config_container[ZONE_0]); - /*--- Check whether this is an FSI, fluid unsteady, harmonic balance or structural dynamic simulation and call the solution merging routines accordingly.---*/ if (multizone){ + + bool TimeDomain = driver_config->GetTime_Domain(); @@ -284,8 +285,13 @@ int main(int argc, char *argv[]) { /*--- Instantiate the solvers for each zone. ---*/ for (iZone = 0; iZone < nZone; iZone++){ config_container[iZone]->SetiInst(INST_0); - config_container[iZone]->SetExtIter(TimeIter); + config_container[iZone]->SetTimeIter(TimeIter); solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + } /*--- Loop over the whole time domain ---*/ @@ -300,19 +306,24 @@ int main(int argc, char *argv[]) { (StopCalc) || // We have surpassed the requested time ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)) // The iteration has been requested ){ + if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << ", t = " << Physical_t << " s ." << endl; /*--- Load the restart for all the zones. ---*/ for (iZone = 0; iZone < nZone; iZone++){ /*--- Set the current iteration number in the config class. ---*/ - config_container[iZone]->SetExtIter(TimeIter); + config_container[iZone]->SetTimeIter(TimeIter); /*--- So far, only enabled for single-instance problems ---*/ config_container[iZone]->SetiInst(INST_0); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], TimeIter, true); } - if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << ", t = " << Physical_t << " s ." << endl; - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, TimeIter, nZone); + + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); + + } } TimeIter++; @@ -326,9 +337,17 @@ int main(int argc, char *argv[]) { config_container[iZone]->SetiInst(INST_0); /*--- Definition of the solution class ---*/ solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], 0, true); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + + } + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], 0); + } - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, 0, nZone); } } @@ -339,98 +358,108 @@ int main(int argc, char *argv[]) { } su2double Physical_dt, Physical_t; - unsigned long iExtIter = 0, iExtIterFlow = 0, iExtIterFEM = 0; + unsigned long TimeIter = 0, TimeIterFlow = 0, TimeIterFEM = 0; bool StopCalc = false; bool SolutionInstantiatedFlow = false, SolutionInstantiatedFEM = false; /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ if (config_container[ZONE_0]->GetRestart()){ - iExtIterFlow = config_container[ZONE_0]->GetUnst_RestartIter(); - iExtIterFEM = config_container[ZONE_1]->GetDyn_RestartIter(); - if (iExtIterFlow != iExtIterFEM) { + TimeIterFlow = config_container[ZONE_0]->GetRestart_Iter(); + TimeIterFEM = config_container[ZONE_1]->GetRestart_Iter(); + if (TimeIterFlow != TimeIterFEM) { SU2_MPI::Error("For multizone computations, please add the number of zones as a second argument for SU2_SOL.", CURRENT_FUNCTION); } else { - iExtIter = iExtIterFlow; + TimeIter = TimeIterFlow; } } - while (iExtIter < config_container[ZONE_0]->GetnExtIter()) { + while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { /*--- Check several conditions in order to merge the correct time step files. ---*/ Physical_dt = config_container[ZONE_0]->GetDelta_UnstTime(); - Physical_t = (iExtIter+1)*Physical_dt; + Physical_t = (TimeIter+1)*Physical_dt; if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) StopCalc = true; if ( - ((iExtIter+1 == config_container[ZONE_0]->GetnExtIter()) || - ((iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (iExtIter != 0) && - !((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND))) || + ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || + ((TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (TimeIter != 0) && + !((config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND))) || (StopCalc) || - (((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) && - ((iExtIter == 0) || (iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) + (((config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND)) && + ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) && - ((iExtIter+1 == config_container[ZONE_1]->GetnExtIter()) || + ((TimeIter+1 == config_container[ZONE_1]->GetnTime_Iter()) || (StopCalc) || - ((config_container[ZONE_1]->GetDynamic_Analysis() == DYNAMIC) && - ((iExtIter == 0) || (iExtIter % config_container[ZONE_1]->GetWrt_Sol_Freq_DualTime() == 0)))) + ((config_container[ZONE_1]->GetTime_Domain()) && + ((TimeIter == 0) || (TimeIter % config_container[ZONE_1]->GetWrt_Sol_Freq_DualTime() == 0)))) ){ /*--- Set the current iteration number in the config class. ---*/ - config_container[ZONE_0]->SetExtIter(iExtIter); - config_container[ZONE_1]->SetExtIter(iExtIter); + config_container[ZONE_0]->SetTimeIter(TimeIter); + config_container[ZONE_1]->SetTimeIter(TimeIter); /*--- Read in the restart file for this time step ---*/ /*--- For the fluid zone (ZONE_0) ---*/ /*--- Either instantiate the solution class or load a restart file. ---*/ if (SolutionInstantiatedFlow == false && - (iExtIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(iExtIter) == config_container[ZONE_0]->GetUnst_RestartIter())) || - iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 || - iExtIter+1 == config_container[ZONE_0]->GetnExtIter()))) { + (TimeIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()))) || + TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 || + TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()))) { solver_container[ZONE_0][INST_0] = new CBaselineSolver(geometry_container[ZONE_0][INST_0], config_container[ZONE_0]); + output[ZONE_0] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), solver_container[ZONE_0][INST_0]); + output[ZONE_0]->PreprocessVolumeOutput(config_container[ZONE_0]); + output[ZONE_0]->PreprocessHistoryOutput(config_container[ZONE_0], false); + SolutionInstantiatedFlow = true; } - solver_container[ZONE_0][INST_0]->LoadRestart_FSI(geometry_container[ZONE_0][INST_0], config_container[ZONE_0], SU2_TYPE::Int(MESH_0)); + solver_container[ZONE_0][INST_0]->LoadRestart_FSI(geometry_container[ZONE_0][INST_0], config_container[ZONE_0], TimeIter); /*--- For the structural zone (ZONE_1) ---*/ /*--- Either instantiate the solution class or load a restart file. ---*/ /*--- Either instantiate the solution class or load a restart file. ---*/ if (SolutionInstantiatedFEM == false && - (iExtIter == 0 || ((config_container[ZONE_1]->GetRestart() && (SU2_TYPE::Int(iExtIter) == config_container[ZONE_1]->GetDyn_RestartIter())) || - iExtIter % config_container[ZONE_1]->GetWrt_Sol_Freq_DualTime() == 0 || - iExtIter+1 == config_container[ZONE_1]->GetnExtIter()))) { + (TimeIter == 0 || ((config_container[ZONE_1]->GetRestart() && (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_1]->GetRestart_Iter()))) || + TimeIter % config_container[ZONE_1]->GetWrt_Sol_Freq_DualTime() == 0 || + TimeIter+1 == config_container[ZONE_1]->GetnTime_Iter()))) { solver_container[ZONE_1][INST_0] = new CBaselineSolver(geometry_container[ZONE_1][INST_0], config_container[ZONE_1]); + output[ZONE_1] = new CBaselineOutput(config_container[ZONE_1], geometry_container[ZONE_1][INST_0]->GetnDim(), solver_container[ZONE_1][INST_0]); + output[ZONE_1]->PreprocessVolumeOutput(config_container[ZONE_1]); SolutionInstantiatedFEM = true; } - solver_container[ZONE_1][INST_0]->LoadRestart_FSI(geometry_container[ZONE_1][INST_0], config_container[ZONE_1], SU2_TYPE::Int(MESH_0)); + solver_container[ZONE_1][INST_0]->LoadRestart_FSI(geometry_container[ZONE_1][INST_0], config_container[ZONE_1], TimeIter); - if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << iExtIter << "." << endl; - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, iExtIter, nZone); + if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << "." << endl; + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); + + } } - iExtIter++; + TimeIter++; if (StopCalc) break; } } else if (fem_solver) { - if (config_container[ZONE_0]->GetWrt_Unsteady()) { + if (config->GetTime_Domain()) { /*--- Unsteady DG simulation: merge all unsteady time steps. First, find the frequency and total number of files to write. ---*/ su2double Physical_dt, Physical_t; - unsigned long iExtIter = 0; + unsigned long TimeIter = 0; bool StopCalc = false; bool *SolutionInstantiated = new bool[nZone]; @@ -438,50 +467,58 @@ int main(int argc, char *argv[]) { SolutionInstantiated[iZone] = false; /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ - if (config_container[ZONE_0]->GetWrt_Unsteady() && config_container[ZONE_0]->GetRestart()) - iExtIter = config_container[ZONE_0]->GetUnst_RestartIter(); + if (config_container[ZONE_0]->GetTime_Domain() && config_container[ZONE_0]->GetRestart()) + TimeIter = config_container[ZONE_0]->GetRestart_Iter(); - while (iExtIter < config_container[ZONE_0]->GetnExtIter()) { + while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { /*--- Check several conditions in order to merge the correct time step files. ---*/ Physical_dt = config_container[ZONE_0]->GetDelta_UnstTime(); - Physical_t = (iExtIter+1)*Physical_dt; + Physical_t = (TimeIter+1)*Physical_dt; if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) StopCalc = true; - if ((iExtIter+1 == config_container[ZONE_0]->GetnExtIter()) || - ((iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (iExtIter != 0) && - !(config_container[ZONE_0]->GetUnsteady_Simulation() == TIME_STEPPING)) || + if ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || + ((TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (TimeIter != 0) && + !(config_container[ZONE_0]->GetTime_Marching() == TIME_STEPPING)) || (StopCalc) || - ((config_container[ZONE_0]->GetUnsteady_Simulation() == TIME_STEPPING) && - ((iExtIter == 0) || (iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) { + ((config_container[ZONE_0]->GetTime_Marching() == TIME_STEPPING) && + ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) { /*--- Read in the restart file for this time step ---*/ for (iZone = 0; iZone < nZone; iZone++) { /*--- Set the current iteration number in the config class. ---*/ - config_container[iZone]->SetExtIter(iExtIter); + config_container[iZone]->SetTimeIter(TimeIter); /*--- Either instantiate the solution class or load a restart file. ---*/ if (SolutionInstantiated[iZone] == false && - (iExtIter == 0 || - (config_container[ZONE_0]->GetRestart() && ((long)iExtIter == config_container[ZONE_0]->GetUnst_RestartIter() || - iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 || - iExtIter+1 == config_container[ZONE_0]->GetnExtIter())))) { + (TimeIter == 0 || + (config_container[ZONE_0]->GetRestart() && ((long)TimeIter == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()) || + TimeIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 || + TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter())))) { solver_container[iZone][INST_0] = new CBaselineSolver_FEM(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), solver_container[ZONE_0][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[ZONE_0]); + output[iZone]->PreprocessHistoryOutput(config_container[ZONE_0], false); SolutionInstantiated[iZone] = true; } solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], - config_container[iZone], (int)iExtIter, true); + config_container[iZone], (int)TimeIter, true); } if (rank == MASTER_NODE) - cout << "Writing the volume solution for time step " << iExtIter << "." << endl; - output->SetBaselineResult_Files_FEM(solver_container, geometry_container, config_container, iExtIter, nZone); - } + cout << "Writing the volume solution for time step " << TimeIter << "." << endl; + + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); + + } + } - iExtIter++; + TimeIter++; if (StopCalc) break; } @@ -493,22 +530,29 @@ int main(int argc, char *argv[]) { /*--- Definition of the solution class ---*/ solver_container[iZone][INST_0] = new CBaselineSolver_FEM(geometry_container[iZone][INST_0], config_container[iZone]); - solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + output[iZone] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), solver_container[ZONE_0][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[ZONE_0]); + output[iZone]->PreprocessHistoryOutput(config_container[ZONE_0], false); + solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], config_container[iZone], 0, true); } - - output->SetBaselineResult_Files_FEM(solver_container, geometry_container, config_container, 0, nZone); + + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], 0); + + } } - + } else { - if (config_container[ZONE_0]->GetWrt_Unsteady()) { + if (config_container[ZONE_0]->GetTime_Domain()) { /*--- Unsteady simulation: merge all unsteady time steps. First, find the frequency and total number of files to write. ---*/ su2double Physical_dt, Physical_t; - unsigned long iExtIter = 0; + unsigned long TimeIter = 0; bool StopCalc = false; bool *SolutionInstantiated = new bool[nZone]; @@ -516,25 +560,25 @@ int main(int argc, char *argv[]) { SolutionInstantiated[iZone] = false; /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ - if (config_container[ZONE_0]->GetWrt_Unsteady() && config_container[ZONE_0]->GetRestart()) - iExtIter = config_container[ZONE_0]->GetUnst_RestartIter(); + if (config_container[ZONE_0]->GetTime_Domain() && config_container[ZONE_0]->GetRestart()) + TimeIter = config_container[ZONE_0]->GetRestart_Iter(); - while (iExtIter < config_container[ZONE_0]->GetnExtIter()) { + while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { /*--- Check several conditions in order to merge the correct time step files. ---*/ - Physical_dt = config_container[ZONE_0]->GetDelta_UnstTime(); - Physical_t = (iExtIter+1)*Physical_dt; - if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) + Physical_dt = config_container[ZONE_0]->GetTime_Step(); + Physical_t = (TimeIter+1)*Physical_dt; + if (Physical_t >= config_container[ZONE_0]->GetMax_Time()) StopCalc = true; - if ((iExtIter+1 == config_container[ZONE_0]->GetnExtIter()) || - ((iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq() == 0) && (iExtIter != 0) && - !((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND))) || + if ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || + ((TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0) && (TimeIter != 0) && + !((config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND))) || (StopCalc) || - (((config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetUnsteady_Simulation() == DT_STEPPING_2ND)) && - ((iExtIter == 0) || (iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) { + (((config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND)) && + ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0)))) { @@ -542,32 +586,43 @@ int main(int argc, char *argv[]) { for (iZone = 0; iZone < nZone; iZone++) { /*--- Set the current iteration number in the config class. ---*/ - config_container[iZone]->SetExtIter(iExtIter); + config_container[iZone]->SetTimeIter(TimeIter); /*--- Either instantiate the solution class or load a restart file. ---*/ if (SolutionInstantiated[iZone] == false && - (iExtIter == 0 || (config_container[ZONE_0]->GetRestart() && ((long)iExtIter == config_container[ZONE_0]->GetUnst_RestartIter() || - iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 || - iExtIter+1 == config_container[ZONE_0]->GetnExtIter())))) { + (TimeIter == 0 || (config_container[ZONE_0]->GetRestart() && ((long)TimeIter == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()) || + TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0 || + TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter())))) { solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + SolutionInstantiated[iZone] = true; } config_container[iZone]->SetiInst(INST_0); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], TimeIter, true); } - + if (rank == MASTER_NODE) - cout << "Writing the volume solution for time step " << iExtIter << "." << endl; - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, iExtIter, nZone); - } + cout << "Writing the volume solution for time step " << TimeIter << "." << endl; + + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); + + } + + + } - iExtIter++; + TimeIter++; if (StopCalc) break; } } - else if (config_container[ZONE_0]->GetUnsteady_Simulation() == HARMONIC_BALANCE) { + else if (config_container[ZONE_0]->GetTime_Marching() == HARMONIC_BALANCE) { /*--- Read in the restart file for this time step ---*/ for (iZone = 0; iZone < nZone; iZone++) { @@ -575,30 +630,41 @@ int main(int argc, char *argv[]) { for (iInst = 0; iInst < nInst[iZone]; iInst++){ config_container[iZone]->SetiInst(iInst); + config_container[iZone]->SetTimeIter(iInst); /*--- Either instantiate the solution class or load a restart file. ---*/ solver_container[iZone][iInst] = new CBaselineSolver(geometry_container[iZone][iInst], config_container[iZone]); - solver_container[iZone][iInst]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + solver_container[iZone][iInst]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], iInst, true); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][iInst]->GetnDim(), solver_container[iZone][iInst]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); /*--- Print progress in solution writing to the screen. ---*/ if (rank == MASTER_NODE) { cout << "Storing the volume solution for time instance " << iInst << "." << endl; } + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][iInst], &solver_container[iZone][iInst], output[iZone], iInst); + + } + + } } - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, iZone, nZone); + } - else if (config_container[ZONE_0]->GetWrt_Dynamic()){ + else if (config_container[ZONE_0]->GetTime_Domain()){ /*--- Dynamic simulation: merge all unsteady time steps. First, find the frequency and total number of files to write. ---*/ su2double Physical_dt, Physical_t; - unsigned long iExtIter = 0; + unsigned long TimeIter = 0; bool StopCalc = false; bool SolutionInstantiated = false; @@ -607,47 +673,55 @@ int main(int argc, char *argv[]) { /*--- Check for an dynamic restart (structural analysis). Update ExtIter if necessary. ---*/ if (config_container[ZONE_0]->GetKind_Solver() == FEM_ELASTICITY && config_container[ZONE_0]->GetWrt_Dynamic() && config_container[ZONE_0]->GetRestart()) - iExtIter = config_container[ZONE_0]->GetDyn_RestartIter(); + TimeIter = config_container[ZONE_0]->GetRestart_Iter(); - while (iExtIter < config_container[ZONE_0]->GetnExtIter()) { + while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { /*--- Check several conditions in order to merge the correct time step files. ---*/ /*--- If the solver is structural, the total and delta_t are obtained from different functions. ---*/ - Physical_dt = config_container[ZONE_0]->GetDelta_DynTime(); - Physical_t = (iExtIter+1)*Physical_dt; - if (Physical_t >= config_container[ZONE_0]->GetTotal_DynTime()) + Physical_dt = config_container[ZONE_0]->GetTime_Step(); + Physical_t = (TimeIter+1)*Physical_dt; + if (Physical_t >= config_container[ZONE_0]->GetMax_Time()) StopCalc = true; - if ((iExtIter+1 == config_container[ZONE_0]->GetnExtIter()) || + if ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || (StopCalc) || - ((config_container[ZONE_0]->GetDynamic_Analysis() == DYNAMIC) && - ((iExtIter == 0) || (iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0)))) { + ((config_container[ZONE_0]->GetTime_Domain()) && + ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0)))) { /*--- Set the current iteration number in the config class. ---*/ - config_container[ZONE_0]->SetExtIter(iExtIter); + config_container[ZONE_0]->SetTimeIter(TimeIter); /*--- Read in the restart file for this time step ---*/ for (iZone = 0; iZone < nZone; iZone++) { /*--- Either instantiate the solution class or load a restart file. ---*/ if (SolutionInstantiated == false && - (iExtIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(iExtIter) == config_container[ZONE_0]->GetDyn_RestartIter())) || - iExtIter % config_container[ZONE_0]->GetWrt_Sol_Freq_DualTime() == 0 || - iExtIter+1 == config_container[ZONE_0]->GetnExtIter()))) { + (TimeIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()))) || + TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0 || + TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()))) { solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + SolutionInstantiated = true; } config_container[iZone]->SetiInst(INST_0); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], TimeIter, true); } if (rank == MASTER_NODE) - cout << "Writing the volume solution for time step " << iExtIter << "." << endl; - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, iExtIter, nZone); - } + cout << "Writing the volume solution for time step " << TimeIter << "." << endl; + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); + + } + } - iExtIter++; + TimeIter++; if (StopCalc) break; } @@ -656,17 +730,23 @@ int main(int argc, char *argv[]) { else { /*--- Steady simulation: merge the single solution file. ---*/ - + for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetiInst(INST_0); /*--- Definition of the solution class ---*/ solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], SU2_TYPE::Int(MESH_0), true); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], 0, true); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + } - - output->SetBaselineResult_Files(solver_container, geometry_container, config_container, 0, nZone); - - } + for (iZone = 0; iZone < nZone; iZone++){ + + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], 0); + + } + } } @@ -684,7 +764,7 @@ int main(int argc, char *argv[]) { } } if (geometry_container[iZone] != NULL) - delete geometry_container[iZone]; + delete [] geometry_container[iZone]; } delete [] geometry_container; } @@ -698,7 +778,7 @@ int main(int argc, char *argv[]) { } } if (solver_container[iZone] != NULL) - delete solver_container[iZone]; + delete [] solver_container[iZone]; } delete [] solver_container; } @@ -714,7 +794,14 @@ int main(int argc, char *argv[]) { } if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; - if (output != NULL) delete output; + if (output != NULL) { + for (iZone = 0; iZone < nZone; iZone++) { + if (output[iZone] != NULL) { + delete output[iZone]; + } + } + delete [] output; + } if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; /*--- Synchronization point after a single solver iteration. Compute the @@ -747,3 +834,29 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; } + +void WriteFiles(CConfig *config, CGeometry* geometry, CSolver** solver_container, COutput *output, unsigned long TimeIter){ + + /*--- Load history data (volume output might require some values) --- */ + + output->SetHistory_Output(geometry, solver_container, config, TimeIter, 0, 0); + + /*--- Load the data --- */ + + output->Load_Data(geometry, config, solver_container); + + /*--- Set the filenames ---*/ + + output->SetVolume_Filename(config->GetVolume_FileName()); + + output->SetSurface_Filename(config->GetSurfCoeff_FileName()); + + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + unsigned short* FileFormat = config->GetVolumeOutputFiles(); + if (FileFormat[iFile] != RESTART_ASCII && + FileFormat[iFile] != RESTART_BINARY && + FileFormat[iFile] != CSV) + output->WriteToFile(config, geometry, FileFormat[iFile]); + } + +} diff --git a/SU2_SOL/src/meson.build b/SU2_SOL/src/meson.build index 226bd5172132..4549eac3e034 100644 --- a/SU2_SOL/src/meson.build +++ b/SU2_SOL/src/meson.build @@ -1,20 +1,33 @@ su2_sol_src = ['SU2_SOL.cpp'] if get_option('enable-normal') su2_cfd_obj = su2_cfd.extract_objects(['solver_structure.cpp', - 'output_structure.cpp', - 'output_cgns.cpp', - 'output_fieldview.cpp', - 'output_paraview.cpp', - 'output_physics.cpp', - 'output_su2.cpp', - 'output_tecplot.cpp', - 'variables/CBaselineVariable.cpp', - 'variables/CVariable.cpp']) + 'output/COutput.cpp', + 'output/output_structure_legacy.cpp', + 'output/CBaselineOutput.cpp', + 'output/filewriter/CParallelDataSorter.cpp', + 'output/filewriter/CParallelFileWriter.cpp', + 'output/filewriter/CFEMDataSorter.cpp', + 'output/filewriter/CSurfaceFEMDataSorter.cpp', + 'output/filewriter/CFVMDataSorter.cpp', + 'output/filewriter/CSurfaceFVMDataSorter.cpp', + 'output/filewriter/CCSVFileWriter.cpp', + 'output/filewriter/CTecplotFileWriter.cpp', + 'output/filewriter/CTecplotBinaryFileWriter.cpp', + 'output/filewriter/CParaviewFileWriter.cpp', + 'output/filewriter/CParaviewBinaryFileWriter.cpp', + 'output/filewriter/CSU2FileWriter.cpp', + 'output/filewriter/CSU2BinaryFileWriter.cpp', + 'output/filewriter/CSU2MeshFileWriter.cpp', + 'variables/CBaselineVariable.cpp', + 'variables/CVariable.cpp']) + su2_sol = executable('SU2_SOL', - su2_sol_src, - install: true, - dependencies: [su2_deps, common_dep], - objects : su2_cfd_obj, - cpp_args :[default_warning_flags, su2_cpp_args]) + su2_sol_src, + install: true, + dependencies: [su2_deps, common_dep], + objects : su2_cfd_obj, + cpp_args :[default_warning_flags, su2_cpp_args]) + + endif diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index d4d3178bbbeb..36293383743b 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -64,6 +64,12 @@ def __init__(self,tag_in): # Indicate whether to disable restart self.no_restart = False + # Indicate whether the new output is used + self.new_output = True + + # multizone problem + self.multizone = False + # The test condition. These must be set after initialization self.test_iter = 1 self.ntest_vals = 4 @@ -138,10 +144,14 @@ def run_test(self): if line.find('Begin Solver') > -1: start_solver=True else: # Found the --Begin solver --- line; parse the input - raw_data = line.split() + if self.new_output or self.multizone: + raw_data = line.strip() # Strip removes whitespaces head-tail + raw_data = raw_data[1:-1].split('|') # Remove heat-tail bars before splitting + else: + raw_data = line.split() try: iter_number = int(raw_data[0]) - if self.unsteady: + if self.unsteady and not self.multizone and not self.new_output: iter_number = int(raw_data[1]) data = raw_data[len(raw_data) - len(self.test_vals):] except ValueError: @@ -669,11 +679,17 @@ def adjust_iter(self): file_out = open(self.cfg_file,'w') file_out.write('%% This file automatically generated by the regression script\n') file_out.write('%% Number of iterations changed to %d\n'%(self.test_iter+1)) + if (self.multizone or self.new_output) and self.unsteady: + adjust_string = "TIME_ITER" + elif self.multizone: + adjust_string = "OUTER_ITER" + else: + adjust_string = "ITER" for line in lines: - if not line.startswith("EXT_ITER"): + if not line.strip().split("=")[0].strip() == adjust_string: file_out.write(line) else: - file_out.write("EXT_ITER=%d\n"%(self.test_iter+1)) + file_out.write(adjust_string+"=%d\n"%(self.test_iter+1)) file_out.close() os.chdir(workdir) diff --git a/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg b/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg index 680b840a6544..e9f712e48f4c 100644 --- a/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg +++ b/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg @@ -24,7 +24,10 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER= YES +% % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -60,19 +63,22 @@ REF_DIMENSIONALIZATION= DIMENSIONAL % ------------------------- UNSTEADY SIMULATION -------------------------------% % +% Time domain +TIME_DOMAIN=YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, SPECTRAL_METHOD) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.00174532925199 +TIME_STEP= 0.00174532925199 % 36 steps per period, based on the pitch natural frequency % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 100 +INNER_ITER= 100 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% SURFACE_MOVEMENT= AEROELASTIC @@ -254,29 +260,25 @@ VISUALIZE_VOLUME_DEF= NO % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 360 +TIME_ITER= 360 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 4 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 0 +CONV_STARTITER= 0 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -287,23 +289,23 @@ MESH_FILENAME= mesh_NACA64A010_hybrid_inv.su2 MESH_FORMAT= SU2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 1000 @@ -316,4 +318,6 @@ WRT_CON_FREQ= 1 % % Writing convergence history frequency (dual time, only written to screen) WRT_CON_FREQ_DUALTIME= 1 - +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG_ON_SURFACE, PLUNGE, PITCH) diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg index 1ad97af4a3d2..44966bfc57b2 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg @@ -30,8 +30,9 @@ READ_BINARY_RESTART= NO % % Number of zones NZONES= 1 - -ITER = 11 +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -102,7 +103,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 150 +ITER= 150 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -251,24 +252,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -282,25 +278,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -309,7 +305,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -319,7 +315,12 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) +HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, SENSITIVITY) +VOLUME_OUTPUT= (COORDINATES, SOLUTION, PRESSURE, TEMPERATURE, SENSITIVITY) +OUTPUT_FILES=(RESTART_ASCII, PARAVIEW, SURFACE_CSV) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg index 1ce86fa98c09..991ffada8965 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg @@ -103,7 +103,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 10 +ITER= 10 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -246,24 +246,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -277,25 +272,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -304,7 +299,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -314,7 +309,10 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% History output +HISTORY_OUTPUT=(ITER, RMS_RES, AERO_COEFF, D_AERO_COEFF) +OUTPUT_FILES=(RESTART_ASCII, PARAVIEW) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg index 14cc9ed5aeca..f2b5de57303d 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg @@ -28,9 +28,6 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO - -ITER = 101 - % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -100,7 +97,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 150 +ITER= 150 % -------------------------- MULTIGRID PARAMETERS -----------------------------% % @@ -205,24 +202,19 @@ DEFORM_STIFFNESS_TYPE= WALL_DISTANCE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -236,25 +228,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -263,7 +255,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -273,7 +265,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_PRESS, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref b/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref index cc4b240882c1..ae821034f0f1 100644 --- a/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref +++ b/TestCases/cont_adj_euler/naca0012/of_grad_directdiff.dat.ref @@ -1,4 +1,4 @@ -VARIABLES="VARIABLE" , "MASS_FLOW_IN" , "MOMENT_Z" , "FLOW_ANGLE_OUT", "MASS_FLOW_OUT" , "FLOW_ANGLE_IN" , "FORCE_Z" , "FORCE_Y" , "FORCE_X" , "TOTAL_EFFICIENCY", "TOTAL_STATIC_EFFICIENCY", "PRESSURE_RATIO", "EFFICIENCY" , "DRAG" , "LIFT" , "TOTAL_ENTHALPY_OUT", "TOTAL_PRESSURE_LOSS", "MOMENT_Y" , "MOMENT_X" , "SIDEFORCE" , "ENTHALPY_OUT" , "KINETIC_ENERGY_LOSS", "CUSTOM_OBJFUNC", "HEAT" , "MAX_HEAT" , "SURFACE_UNIFORMITY", "SURFACE_SECONDARY", "SURFACE_MOM_DISTORTION", "SURFACE_SECOND_OVER_UNIFORM", "SURFACE_PRESSURE_DROP" - 0 , 0.0 , 1.21384701 , 0.0 , 0.0 , 0.0 , 0.0 , -1.54043628 , 0.27091816 , 0.0 , 0.0 , 0.0 , -114.312563 , 0.237249248 , -1.54597975 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 - 1 , 0.0 , 1.04907745 , 0.0 , 0.0 , 0.0 , 0.0 , -2.37702643 , 0.45451385 , 0.0 , 0.0 , 0.0 , -185.827593 , 0.40255113 , -2.38637593 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 - 2 , 0.0 , 0.629966754 , 0.0 , 0.0 , 0.0 , 0.0 , -3.0896926 , 0.607117928 , 0.0 , 0.0 , 0.0 , -245.76716 , 0.539572161 , -3.10220155 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 +VARIABLES="VARIABLE" , "DRAG" , "EFFICIENCY" , "FORCE_X" , "FORCE_Y" , "FORCE_Z" , "LIFT" , "MOMENT_X" , "MOMENT_Y" , "MOMENT_Z" , "SIDEFORCE" + 0 , 0.2372492479 , -114.3125628 , 0.2709181595 , -1.540436284 , 0.0 , -1.54597975 , 0.0 , 0.0 , 1.213847013 , 0.0 + 1 , 0.4025511296 , -185.8275927 , 0.45451385 , -2.377026434 , 0.0 , -2.386375933 , 0.0 , 0.0 , 1.049077447 , 0.0 + 2 , 0.5395721612 , -245.7671599 , 0.6071179277 , -3.089692602 , 0.0 , -3.102201546 , 0.0 , 0.0 , 0.6299667538 , 0.0 diff --git a/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg b/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg index d22a629271c9..14201277d6f6 100644 --- a/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg @@ -25,7 +25,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -110,7 +112,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -207,24 +209,19 @@ TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 25 +CONV_STARTITER= 25 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -235,7 +232,7 @@ MESH_FILENAME= mesh_ONERAM6_inv_ffd.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -243,20 +240,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -265,7 +262,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -275,7 +272,8 @@ WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % % Kind of deformation (TRANSLATION, ROTATION, SCALE, diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg index 250e771e2c68..d7bd032720ee 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg @@ -28,9 +28,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO - -ITER = 11 - +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -101,7 +101,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER=100 +ITER=100 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -208,14 +208,12 @@ MARKER_ANALYZE = (outlet) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -11 +CONV_RESIDUAL_MINVAL= -11 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -229,25 +227,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -256,7 +254,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -266,6 +264,8 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg index 4bbbf2022085..f03b97607dc6 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg @@ -26,6 +26,11 @@ RESTART_SOL= YES % % Number of Zones NZONES= 1 +% +% New single zone driver +SINGLEZONE_DRIVER= YES +% +OUTPUT_FILES=(RESTART_ASCII) % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -96,7 +101,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER=1000 +ITER=1000 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -217,14 +222,12 @@ MARKER_ANALYZE_AVERAGE = AREA % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -11 +CONV_RESIDUAL_MINVAL= -11 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -238,25 +241,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -265,7 +268,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -345,6 +348,9 @@ VISUALIZE_SURFACE_DEF= YES % % Visualize the volume deformation (NO, YES) VISUALIZE_VOLUME_DEF= YES +% +% History output +HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg b/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg index ea5519d3dd55..870aa1229830 100644 --- a/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg +++ b/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg @@ -30,6 +30,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -103,7 +106,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 150 +ITER= 150 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -216,24 +219,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -247,25 +245,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -274,7 +272,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -284,6 +282,9 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg b/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg index acb3b31262fe..7bec8d962316 100644 --- a/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg +++ b/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg @@ -29,6 +29,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -102,7 +105,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 150 +ITER= 150 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -201,24 +204,19 @@ DV_VALUE= 0.01 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 9 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -232,25 +230,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -259,7 +257,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -269,6 +267,8 @@ WRT_SOL_FREQ= 5000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg b/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg index efc04030a199..fe1c94bcd089 100644 --- a/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg +++ b/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg @@ -29,6 +29,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -102,7 +105,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 150 +ITER= 150 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -212,24 +215,19 @@ DV_VALUE= 0.01 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 13 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -243,25 +241,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -270,7 +268,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -280,6 +278,8 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 5 +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg index e40258a61787..a1af10cda139 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg @@ -15,7 +15,7 @@ % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) % -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -31,6 +31,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -95,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 100 +ITER= 100 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -255,24 +258,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- GRID ADAPTATION STRATEGY --------------------------% % @@ -304,25 +302,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -331,7 +329,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -341,4 +339,8 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) + diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg index 68fd27ab4106..48f5ff5736fd 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg @@ -15,7 +15,7 @@ % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) % -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -31,6 +31,9 @@ WRT_BINARY_RESTART= YES % % Read binary restart files (YES, NO) READ_BINARY_RESTART= YES +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -95,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 100 +ITER= 22 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -255,24 +258,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- GRID ADAPTATION STRATEGY --------------------------% % @@ -304,25 +302,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= bin_solution_flow.dat +SOLUTION_FILENAME= bin_solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= bin_solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -331,7 +329,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -341,4 +339,7 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) diff --git a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg index 33911fdd650e..84a0ee1047bf 100644 --- a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg @@ -272,25 +272,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 1 +CONV_STARTITER= 1 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -304,25 +298,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -331,7 +325,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg b/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg index 412df64f4acd..52c68999aff7 100644 --- a/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg @@ -13,7 +13,7 @@ % % Physical governing equations (EULER, NAVIER_STOKES, NS_PLASMA) % -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -29,6 +29,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -90,7 +93,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 150 +ITER= 150 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -187,24 +190,19 @@ FROZEN_VISC_CONT= YES % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -218,25 +216,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -245,7 +243,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -255,6 +253,9 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % diff --git a/TestCases/control_surface/inv_ONERAM6_moving.cfg b/TestCases/control_surface/inv_ONERAM6_moving.cfg index 37c42414877e..77d88ffa9f5f 100644 --- a/TestCases/control_surface/inv_ONERAM6_moving.cfg +++ b/TestCases/control_surface/inv_ONERAM6_moving.cfg @@ -192,24 +192,19 @@ TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -6 +CONV_RESIDUAL_MINVAL= -6 % % Start convergence criteria at iteration number -STARTCONV_ITER= 100 +CONV_STARTITER= 100 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -220,7 +215,7 @@ MESH_FILENAME= mesh_ONERAM6_inv_FFD.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -228,20 +223,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -250,7 +245,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/control_surface/inv_ONERAM6_setting.cfg b/TestCases/control_surface/inv_ONERAM6_setting.cfg index fe9f675f8f7f..fbfc8d23b466 100644 --- a/TestCases/control_surface/inv_ONERAM6_setting.cfg +++ b/TestCases/control_surface/inv_ONERAM6_setting.cfg @@ -192,24 +192,19 @@ TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -6 +CONV_RESIDUAL_MINVAL= -6 % % Start convergence criteria at iteration number -STARTCONV_ITER= 100 +CONV_STARTITER= 100 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -220,7 +215,7 @@ MESH_FILENAME= mesh_ONERAM6_inv.su2 MESH_OUT_FILENAME= mesh_ONERAM6_inv_FFD.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -228,20 +223,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -250,7 +245,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/coupled_cht/incompressible/configFlow.cfg b/TestCases/coupled_cht/incompressible/configFlow.cfg index c796b1e51e32..220c3e4fca19 100644 --- a/TestCases/coupled_cht/incompressible/configFlow.cfg +++ b/TestCases/coupled_cht/incompressible/configFlow.cfg @@ -106,32 +106,23 @@ RELAXATION_FACTOR_TURB= 1.0 % --------------------------- CONVERGENCE PARAMETERS --------------------------% -EXT_ITER= 1 CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 16 -RESIDUAL_MINVAL= -32 -STARTCONV_ITER= 200 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-10 -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY +CONV_RESIDUAL_MINVAL= -32 +CONV_STARTITER= 200 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% MESH_FILENAME= coupled_cht_cylinder2d.su2 MESH_FORMAT= SU2 -SOLUTION_FLOW_FILENAME= solution_flow.dat -OUTPUT_FORMAT= TECPLOT +SOLUTION_FILENAME= solution_flow.dat +TABULAR_FORMAT= CSV CONV_FILENAME= history BREAKDOWN_FILENAME= 6rows_forces_breakdown.dat -RESTART_FLOW_FILENAME= solution_flow.dat -VOLUME_FLOW_FILENAME= flow -SURFACE_FLOW_FILENAME= surface_flow -WRT_SOL_FREQ= 1 -WRT_SOL_FREQ_DUALTIME= 1 -WRT_CON_FREQ= 1 -WRT_CON_FREQ_DUALTIME= 1 -WRT_RESIDUALS= YES +RESTART_FILENAME= solution_flow.dat +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow WRT_LIMITERS= NO WRT_SHARPEDGES= NO -LOW_MEMORY_OUTPUT= NO READ_BINARY_RESTART= YES diff --git a/TestCases/coupled_cht/incompressible/configSolid.cfg b/TestCases/coupled_cht/incompressible/configSolid.cfg index d55975d24fd8..0b016cb65e34 100644 --- a/TestCases/coupled_cht/incompressible/configSolid.cfg +++ b/TestCases/coupled_cht/incompressible/configSolid.cfg @@ -78,12 +78,12 @@ TIME_DISCRE_HEAT= EULER_IMPLICIT MESH_FILENAME= coupled_cht_cylinder2d.su2 MESH_FORMAT= SU2 -SOLUTION_FLOW_FILENAME= solution_flow.dat -OUTPUT_FORMAT= TECPLOT +SOLUTION_FILENAME= solution_flow.dat +TABULAR_FORMAT= CSV CONV_FILENAME= history BREAKDOWN_FILENAME= 6rows_forces_breakdown.dat -RESTART_FLOW_FILENAME= solution_flow.dat -VOLUME_FLOW_FILENAME= flow +RESTART_FILENAME= solution_flow.dat +VOLUME_FILENAME= flow WRT_SOL_FREQ= 100 WRT_SOL_FREQ_DUALTIME= 1 WRT_CON_FREQ= 100 @@ -91,5 +91,4 @@ WRT_CON_FREQ_DUALTIME= 100 WRT_RESIDUALS= YES WRT_LIMITERS= NO WRT_SHARPEDGES= NO -LOW_MEMORY_OUTPUT= NO READ_BINARY_RESTART= YES diff --git a/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg b/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg index 71614ded7d8e..e525f42d3e60 100644 --- a/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg +++ b/TestCases/coupled_cht/incompressible/coupled_cht_incompressible.cfg @@ -154,17 +154,15 @@ EXT_ITER= 11 CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 16 -RESIDUAL_MINVAL= -32 +CONV_RESIDUAL_MINVAL= -32 -STARTCONV_ITER= 200 +CONV_STARTITER= 200 -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -174,21 +172,21 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= Mesh_Out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV CONV_FILENAME= history BREAKDOWN_FILENAME= 6rows_forces_breakdown.dat -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_ADJ_FILENAME= restart_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint @@ -196,7 +194,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint @@ -214,6 +212,5 @@ WRT_LIMITERS= NO WRT_SHARPEDGES= NO -LOW_MEMORY_OUTPUT= NO READ_BINARY_RESTART= YES diff --git a/TestCases/ddes/flatplate/ddes_flatplate.cfg b/TestCases/ddes/flatplate/ddes_flatplate.cfg index cb2e05386d56..71e5b10aecdb 100644 --- a/TestCases/ddes/flatplate/ddes_flatplate.cfg +++ b/TestCases/ddes/flatplate/ddes_flatplate.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= SA @@ -26,6 +26,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -61,27 +64,27 @@ REF_LENGTH= 1.0 REF_AREA= 2.0 % ------------------------- UNSTEADY SIMULATION -------------------------------% + +% Enable time domain +TIME_DOMAIN= YES % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -%UNSTEADY_SIMULATION= NO -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) % U_inf = 69.4448 - dt*=0.02 - dt=0.000288 -UNST_TIMESTEP= 0.000288 +TIME_STEP= 0.000288 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 20.0 +MAX_TIME= 20.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 20 +INNER_ITER= 20 % -% Iteration number to begin unsteady restarts -UNST_RESTART_ITER= 0 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% @@ -127,7 +130,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 10 +TIME_ITER= 10 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -170,24 +173,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 0 +CONV_STARTITER= 0 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -201,25 +199,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, SLT) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -228,7 +226,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -247,3 +245,6 @@ WRT_SURF_FREQ_DUALTIME= 50000 WRT_CON_FREQ_DUALTIME= 1 WRT_LIMITERS= NO WRT_RESIDUALS= NO +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/deformation/brick_hex/def_brick_hex.cfg b/TestCases/deformation/brick_hex/def_brick_hex.cfg index f5d19fe398dd..1cd16c709eac 100755 --- a/TestCases/deformation/brick_hex/def_brick_hex.cfg +++ b/TestCases/deformation/brick_hex/def_brick_hex.cfg @@ -83,7 +83,7 @@ CFL_NUMBER= 4.0 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Linear solver for the implicit formulation (LU_SGS, SYM_GAUSS_SEIDEL, BCGSTAB) LINEAR_SOLVER= FGMRES @@ -201,24 +201,19 @@ FFD_CONTINUITY= 1ST_DERIVATIVE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg b/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg index f1356218f9b8..0cc30e68c799 100755 --- a/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg +++ b/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg @@ -83,7 +83,7 @@ CFL_NUMBER= 4.0 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Linear solver for the implicit formulation (LU_SGS, SYM_GAUSS_SEIDEL, BCGSTAB) LINEAR_SOLVER= FGMRES @@ -201,24 +201,19 @@ FFD_CONTINUITY= 1ST_DERIVATIVE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/brick_prism/def_brick_prism.cfg b/TestCases/deformation/brick_prism/def_brick_prism.cfg index d8cafa8ccd95..c04f192a7003 100755 --- a/TestCases/deformation/brick_prism/def_brick_prism.cfg +++ b/TestCases/deformation/brick_prism/def_brick_prism.cfg @@ -83,7 +83,7 @@ CFL_NUMBER= 4.0 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Linear solver for the implicit formulation (LU_SGS, SYM_GAUSS_SEIDEL, BCGSTAB) LINEAR_SOLVER= FGMRES @@ -201,24 +201,19 @@ FFD_CONTINUITY= 1ST_DERIVATIVE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg b/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg index 15cdecdec4a6..44297c537826 100755 --- a/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg +++ b/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg @@ -83,7 +83,7 @@ CFL_NUMBER= 4.0 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Linear solver for the implicit formulation (LU_SGS, SYM_GAUSS_SEIDEL, BCGSTAB) LINEAR_SOLVER= FGMRES @@ -201,24 +201,19 @@ FFD_CONTINUITY= 1ST_DERIVATIVE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/brick_pyra/def_brick_pyra.cfg b/TestCases/deformation/brick_pyra/def_brick_pyra.cfg index 6f6944ac6158..0af1d0345704 100755 --- a/TestCases/deformation/brick_pyra/def_brick_pyra.cfg +++ b/TestCases/deformation/brick_pyra/def_brick_pyra.cfg @@ -83,7 +83,7 @@ CFL_NUMBER= 4.0 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Linear solver for the implicit formulation (LU_SGS, SYM_GAUSS_SEIDEL, BCGSTAB) LINEAR_SOLVER= FGMRES @@ -201,24 +201,19 @@ FFD_CONTINUITY= 1ST_DERIVATIVE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/brick_tets/def_brick_tets.cfg b/TestCases/deformation/brick_tets/def_brick_tets.cfg index c4b0d49652f6..cefb3cce3b76 100755 --- a/TestCases/deformation/brick_tets/def_brick_tets.cfg +++ b/TestCases/deformation/brick_tets/def_brick_tets.cfg @@ -83,7 +83,7 @@ CFL_NUMBER= 4.0 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Linear solver for the implicit formulation (LU_SGS, SYM_GAUSS_SEIDEL, BCGSTAB) LINEAR_SOLVER= FGMRES @@ -201,24 +201,19 @@ FFD_CONTINUITY= 1ST_DERIVATIVE % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg b/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg index e8fd8b8753d4..73fbdbef8e07 100644 --- a/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg +++ b/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg @@ -242,20 +242,18 @@ FFD_AXIS= (0.0, 0.0, 0.0) % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -269,14 +267,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -285,13 +283,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -303,7 +301,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -329,5 +327,3 @@ WRT_LIMITERS= NO % Output the sharp edges detector WRT_SHARPEDGES= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO diff --git a/TestCases/deformation/naca0012/def_NACA0012.cfg b/TestCases/deformation/naca0012/def_NACA0012.cfg index bece3c18f427..3e10f59c3950 100644 --- a/TestCases/deformation/naca0012/def_NACA0012.cfg +++ b/TestCases/deformation/naca0012/def_NACA0012.cfg @@ -98,7 +98,7 @@ OBJECTIVE_FUNCTION= DRAG CFL_NUMBER= 4.0 % % Number of total iterations -EXT_ITER= 250 +ITER= 250 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -245,24 +245,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -275,25 +270,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -302,7 +297,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/naca0012/surface_file_NACA0012.cfg b/TestCases/deformation/naca0012/surface_file_NACA0012.cfg index 2cd67758a41b..d261d1738fcb 100644 --- a/TestCases/deformation/naca0012/surface_file_NACA0012.cfg +++ b/TestCases/deformation/naca0012/surface_file_NACA0012.cfg @@ -98,7 +98,7 @@ OBJECTIVE_FUNCTION= DRAG CFL_NUMBER= 4.0 % % Number of total iterations -EXT_ITER= 250 +ITER= 250 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -255,24 +255,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -286,25 +281,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -313,7 +308,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/naca4412/def_NACA4412.cfg b/TestCases/deformation/naca4412/def_NACA4412.cfg index fc810cd6d2fa..8ed5cad953cd 100644 --- a/TestCases/deformation/naca4412/def_NACA4412.cfg +++ b/TestCases/deformation/naca4412/def_NACA4412.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, LINEAR_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -93,7 +93,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 1000.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, % MOMENT_Y, MOMENT_Z, EFFICIENCY, @@ -222,24 +222,19 @@ LIMIT_ADJFLOW= 1E6 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E0 +CONV_CAUCHY_EPS= 1E0 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -253,25 +248,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -280,7 +275,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/deformation/rae2822/def_RAE2822.cfg b/TestCases/deformation/rae2822/def_RAE2822.cfg index a147a29f5294..839a3891e9ae 100644 --- a/TestCases/deformation/rae2822/def_RAE2822.cfg +++ b/TestCases/deformation/rae2822/def_RAE2822.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -89,7 +89,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -197,24 +197,19 @@ FROZEN_VISC_CONT= YES % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -228,25 +223,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -255,7 +250,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -265,7 +260,7 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +OUTPUT_FILES=(PARAVIEW_ASCII) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % % Kind of deformation (TRANSLATION, ROTATION, SCALE, diff --git a/TestCases/deformation/spherical_ffd/def_spherical.cfg b/TestCases/deformation/spherical_ffd/def_spherical.cfg index 90f1be7e43dd..77486a539af0 100644 --- a/TestCases/deformation/spherical_ffd/def_spherical.cfg +++ b/TestCases/deformation/spherical_ffd/def_spherical.cfg @@ -245,20 +245,18 @@ FFD_AXIS= (0.0, 0.0, 0.0) % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -272,14 +270,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -288,13 +286,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -306,7 +304,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -332,5 +330,3 @@ WRT_LIMITERS= NO % Output the sharp edges detector WRT_SHARPEDGES= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO diff --git a/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg b/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg index c7f70ff0b0cb..b0e187fd2f4e 100644 --- a/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg +++ b/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg @@ -252,20 +252,18 @@ FFD_AXIS= (0.0, 0.0, 0.0) % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 5 +ITER= 5 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -279,14 +277,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -295,13 +293,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -313,7 +311,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -339,5 +337,3 @@ WRT_LIMITERS= NO % Output the sharp edges detector WRT_SHARPEDGES= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO diff --git a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg index 916e872fa253..a3fda84557ca 100644 --- a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg +++ b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg @@ -46,9 +46,6 @@ DISCARD_INFILES= NO % Speed = ft/s, Equiv. Area = ft^2 ) SYSTEM_MEASUREMENTS= SI -SINGLEZONE_DRIVER = YES -ITER = 21 - % -------------------- COMPRESSIBLE FREE-STREAM % % Mach number (non-dimensional, based on the free-stream values) @@ -115,7 +112,6 @@ CRITICAL_PRESSURE= 4599200.0 % Acentric factor (0.035 (air)) ACENTRIC_FACTOR= 0.01142 % - % ------------------------ SUPERSONIC SIMULATION ------------------------------% % Evaluate equivalent area on the Near-Field (NO, YES) EQUIV_AREA= NO @@ -472,32 +468,26 @@ DEFORM_LIMIT = 0.3 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 12000 +ITER= 12000 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9.00 +CONV_RESIDUAL_MINVAL= -9.00 % % Start convergence criteria at iteration number -STARTCONV_ITER= 5 +CONV_STARTITER= 20 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -511,14 +501,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= MESHOUT_Arina2Kmesh.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -527,13 +517,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -545,7 +535,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -574,8 +564,6 @@ WRT_SHARPEDGES= NO % Output the solution at each surface in the history file WRT_SURFACE= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO % % Write binary restart files (YES, NO) WRT_BINARY_RESTART= YES @@ -585,6 +573,9 @@ READ_BINARY_RESTART= YES % % Reorient elements based on potential negative volumes (YES/NO) REORIENT_ELEMENTS= YES +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_PRESS, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg index 682bba63fb6a..05a1a67ecb19 100644 --- a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg +++ b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg @@ -41,10 +41,7 @@ SYSTEM_MEASUREMENTS= SI % % Reorient elements based on potential negative volumes (YES/NO) REORIENT_ELEMENTS= NO - -SINGLEZONE_DRIVER = YES -ITER = 6 - +HISTORY_OUTPUT= (ITER, RMS_RES, SENSITIVITY) % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -252,32 +249,26 @@ CFL_REDUCTION_ADJFLOW= 0.8 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 100 +ITER= 100 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -291,14 +282,14 @@ MESH_FORMAT= CGNS MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -307,13 +298,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -325,7 +316,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -354,11 +345,12 @@ WRT_SHARPEDGES= NO % Output the solution at each surface in the history file WRT_SURFACE= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO % % Write binary restart files (YES, NO) WRT_BINARY_RESTART= YES % % Read binary restart files (YES, NO) READ_BINARY_RESTART= YES +% +%Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_PRESS, SENS_AOA) diff --git a/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg b/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg index fd053af31a3e..871cca2b876b 100644 --- a/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg +++ b/TestCases/disc_adj_euler/naca0012_pitching/inv_NACA0012_pitching.cfg @@ -11,29 +11,30 @@ MATH_PROBLEM= DISCRETE_ADJOINT % Restart solution (NO, YES) RESTART_SOL= NO SINGLEZONE_DRIVER= YES -TIME_ITER= 151 -ITER= 350 +TIME_ITER= 5 +INNER_ITER= 50 %EXT_ITER= 151 %UNST_INT_ITER= 110 +SCREEN_OUTPUT=(TIME_ITER, INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_PRESS, SENS_AOA) % ------------------------- UNSTEADY SIMULATION -------------------------------% % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) TIME_DOMAIN= YES -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0023555025613149587 +TIME_STEP= 0.0023555025613149587 % 24 steps per period: 0.0024536485013697488 % 25 steps per period: 0.0023555025613149587 % % Total Physical Time for dual time stepping simulations (s) % 150 steps -UNST_TIME= 0.354 +MAX_TIME= 0.354 % % Iteration number to begin unsteady restarts -UNST_RESTART_ITER= 151 +RESTART_ITER= 10 % % Starting direct iteration for unsteady adjoint UNST_ADJOINT_ITER= 151 @@ -270,30 +271,18 @@ DEFORM_LINEAR_SOLVER_ERROR = 0.000000001 DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% Convergence criteria (CAUCHY, RESIDUAL) -% -CONV_CRITERIA= RESIDUAL -% -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 16 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -20 +CONV_RESIDUAL_MINVAL= -20 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 -% -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG -% -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY +CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -307,25 +296,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -334,7 +323,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg b/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg index b22135986c41..ceb4ecb2e057 100644 --- a/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg @@ -113,8 +113,6 @@ OBJECTIVE_FUNCTION= DRAG % Courant-Friedrichs-Lewy condition of the finest grid CFL_NUMBER= 7.5 % -% Number of total iterations -EXT_ITER= 5 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -185,26 +183,20 @@ GEO_MODE= FUNCTION % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 25 +CONV_STARTITER= 25 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -215,7 +207,7 @@ MESH_FILENAME= mesh_ONERAM6_inv.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -223,20 +215,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -245,7 +237,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/disc_adj_fea/configAD_fem.cfg b/TestCases/disc_adj_fea/configAD_fem.cfg index baa51291e75f..d634a24859f2 100644 --- a/TestCases/disc_adj_fea/configAD_fem.cfg +++ b/TestCases/disc_adj_fea/configAD_fem.cfg @@ -44,19 +44,13 @@ FORMULATION_ELASTICITY_2D = PLANE_STRAIN NONLINEAR_FEM_SOLUTION_METHOD = NEWTON_RAPHSON NONLINEAR_FEM_INT_ITER = 10 -RESIDUAL_FEM_UTOL = -9.0 -RESIDUAL_FEM_RTOL = -9.0 -RESIDUAL_FEM_ETOL = -9.0 - -RESIDUAL_CRITERIA_FEM = ABSOLUTE CONV_FILENAME= history -VOLUME_STRUCTURE_FILENAME= beam -WRITE_CONV_FILENAME_FSI = NO +VOLUME_FILENAME= beam BREAKDOWN_FILENAME= forces_breakdown.dat -SOLUTION_STRUCTURE_FILENAME= solution_beam.dat -RESTART_STRUCTURE_FILENAME= restart_beam.dat +SOLUTION_FILENAME= solution_beam.dat +RESTART_FILENAME= restart_beam.dat SOLUTION_ADJ_FILENAME= solution_adj.dat RESTART_ADJ_FILENAME= restart_adj.dat @@ -65,7 +59,7 @@ WRT_SRF_SOL = NO WRT_CSV_SOL = NO MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_CON_FREQ= 1 WRT_CON_FREQ_DUALTIME= 1 diff --git a/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg b/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg index 731f6fc9d9fa..110917c6ae2b 100755 --- a/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg +++ b/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg @@ -112,19 +112,14 @@ TIME_ITER= 1 FSI_ITER= 9 BGS_RELAXATION= FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.7 -RESIDUAL_REDUCTION_FSI= 4 -RESIDUAL_MINVAL_FSI= -4 +CONV_RESIDUAL_MINVAL_FSI= -4 % fluid UNST_INT_ITER= 51 CONV_CRITERIA= RESIDUAL -STARTCONV_ITER= 0 -RESIDUAL_REDUCTION= 9 -RESIDUAL_MINVAL= -9 +CONV_STARTITER= 0 +CONV_RESIDUAL_MINVAL= -9 % solid NONLINEAR_FEM_INT_ITER= 11 -RESIDUAL_FEM_UTOL= -9.0 -RESIDUAL_FEM_RTOL= -9.0 -RESIDUAL_FEM_ETOL= -9.0 % grid deformation DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % @@ -133,20 +128,20 @@ MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 % RESTART_SOL= NO -SOLUTION_FLOW_FILENAME= solution_fluid.dat +SOLUTION_FILENAME= solution_fluid.dat SOLUTION_STRUCTURE_FILENAME= solution_solid.dat SOLUTION_ADJ_FILENAME= adjoint_fluid.dat SOLUTION_ADJ_STRUCTURE_FILENAME= adjoint_solid.dat WRT_SOL_FREQ= 999999 -RESTART_FLOW_FILENAME= solution_fluid.dat +RESTART_FILENAME= solution_fluid.dat RESTART_STRUCTURE_FILENAME= solution_solid.dat RESTART_ADJ_FILENAME= adjoint_fluid.dat RESTART_ADJ_STRUCTURE_FILENAME= adjoint_solid.dat % -OUTPUT_FORMAT= PARAVIEW -VOLUME_FLOW_FILENAME= fluid +TABULAR_FORMAT= CSV +VOLUME_FILENAME= fluid VOLUME_ADJ_FILENAME= adjoint_fluid -SURFACE_FLOW_FILENAME= surface_fluid +SURFACE_FILENAME= surface_fluid SURFACE_ADJ_FILENAME= adjoint_surface_fluid % VOLUME_STRUCTURE_FILENAME= solid diff --git a/TestCases/disc_adj_fsi/configAD_fsi.cfg b/TestCases/disc_adj_fsi/configAD_fsi.cfg index 9c89c683c6cd..331d66c83ce7 100644 --- a/TestCases/disc_adj_fsi/configAD_fsi.cfg +++ b/TestCases/disc_adj_fsi/configAD_fsi.cfg @@ -62,9 +62,6 @@ FORMULATION_ELASTICITY_2D = PLANE_STRESS NONLINEAR_FEM_SOLUTION_METHOD = NEWTON_RAPHSON NONLINEAR_FEM_INT_ITER = 5 -RESIDUAL_FEM_UTOL = -9.0 -RESIDUAL_FEM_RTOL = -9.0 -RESIDUAL_FEM_ETOL = -9.0 MARKER_CLAMPED = ( Clamped_Right, Clamped_Left ) MARKER_PRESSURE= ( LowerWallS, 0, UpperWallS, 0) @@ -97,17 +94,17 @@ MARKER_FAR = ( Farfield ) MARKER_PLOTTING= ( UpperWall, LowerWall, Wall) MARKER_MONITORING= ( UpperWall, LowerWall, Wall) -VOLUME_FLOW_FILENAME= results_flow +VOLUME_FILENAME= results_flow VOLUME_STRUCTURE_FILENAME= results_beam CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_STRUCTURE_FILENAME= solution_beam.dat -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_STRUCTURE_FILENAME= restart_beam.dat SOLUTION_ADJ_FILENAME= solution_flow_adj.dat @@ -119,7 +116,7 @@ RESTART_ADJ_STRUCTURE_FILENAME= restart_flow_adj.dat WRT_SRF_SOL = NO MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_CON_FREQ= 1 WRT_CON_FREQ_DUALTIME= 1 @@ -155,9 +152,8 @@ JST_SENSOR_COEFF=( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 5 -RESIDUAL_MINVAL= -10 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-5 +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-5 diff --git a/TestCases/disc_adj_heat/disc_adj_heat.cfg b/TestCases/disc_adj_heat/disc_adj_heat.cfg index 031c249f6dff..cd7b0275ef93 100644 --- a/TestCases/disc_adj_heat/disc_adj_heat.cfg +++ b/TestCases/disc_adj_heat/disc_adj_heat.cfg @@ -142,21 +142,18 @@ TIME_DISCRE_HEAT= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% -EXT_ITER= 11 CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 16 -RESIDUAL_MINVAL= -32 +CONV_RESIDUAL_MINVAL= -32 -STARTCONV_ITER= 200 +CONV_STARTITER= 200 -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% @@ -202,21 +199,21 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV CONV_FILENAME= history BREAKDOWN_FILENAME= 6rows_forces_breakdown.dat -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_ADJ_FILENAME= restart_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint @@ -224,7 +221,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint @@ -242,8 +239,10 @@ WRT_LIMITERS= NO WRT_SHARPEDGES= NO -LOW_MEMORY_OUTPUT= NO %WRT_BINARY_RESTART= NO %READ_BINARY_RESTART= NO + +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_NU_TILDE, RMS_ADJ_HEAT, SENS_VEL_IN, SENS_PRESS_OUT) diff --git a/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg b/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg index 657bae578b4f..8d92d54f76d2 100644 --- a/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg +++ b/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg @@ -27,9 +27,6 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO -SINGLEZONE_DRIVER = YES -ITER = 21 - % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % % Initial density for incompressible flows @@ -85,7 +82,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 501 +ITER= 501 % % Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, % MOMENT_Y, MOMENT_Z, EFFICIENCY, @@ -172,24 +169,19 @@ DV_VALUE= 0.01 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -203,25 +195,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= PARAVIEW_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -230,7 +222,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -240,7 +232,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_VELOCITY-X, SENS_PRESS, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % List of design variables (Design variables are separated by semicolons) diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index 45e1a520a980..2a3746d8f612 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -24,9 +24,6 @@ MATH_PROBLEM= DISCRETE_ADJOINT % Restart solution (NO, YES) RESTART_SOL= NO -SINGLEZONE_DRIVER = YES -ITER = 21 - % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % % Density model within the incompressible flow solver. @@ -139,7 +136,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 10000.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 1000 +ITER= 1000 % % Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, % MOMENT_Y, MOMENT_Z, EFFICIENCY, @@ -246,24 +243,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -274,14 +266,14 @@ MESH_FILENAME= mesh_cylinder_lam_ffd.su2 MESH_FORMAT= SU2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -290,13 +282,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -308,7 +300,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -318,7 +310,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_HEAT, SENS_PRESS, SENS_AOA) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % % Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg index 966acb5ef505..a19c72f0176c 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -25,10 +25,6 @@ MATH_PROBLEM= DISCRETE_ADJOINT % % Restart solution (NO, YES) RESTART_SOL= NO - -SINGLEZONE_DRIVER = YES -ITER = 11 - % -------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION ------------------% % % Free-stream density (1.2886 Kg/m^3 (air), 998.2 Kg/m^3 (water)) @@ -97,7 +93,7 @@ MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, % MOMENT_Y, MOMENT_Z, EFFICIENCY, @@ -228,24 +224,19 @@ DV_VALUE= 0.01 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -259,25 +250,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sa.dat +SOLUTION_FILENAME= solution_flow_sa.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -286,7 +277,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -296,6 +287,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_NU_TILDE, SENS_PRESS, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg index 7efc27464d92..544c6bfab281 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -25,9 +25,6 @@ MATH_PROBLEM= DISCRETE_ADJOINT % Restart solution (NO, YES) RESTART_SOL= NO -SINGLEZONE_DRIVER = YES -ITER = 11 - % -------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION ------------------% % % Free-stream density (1.2886 Kg/m^3 (air), 998.2 Kg/m^3 (water)) @@ -96,7 +93,7 @@ MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Objective function in gradient evaluation (DRAG, LIFT, SIDEFORCE, MOMENT_X, % MOMENT_Y, MOMENT_Z, EFFICIENCY, @@ -227,24 +224,19 @@ DV_VALUE= 0.01 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -258,25 +250,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst.dat +SOLUTION_FILENAME= solution_flow_sst.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -285,7 +277,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -295,7 +287,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_TKE, RMS_ADJ_DISSIPATION, SENS_PRESS, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/disc_adj_rans/cylinder/cylinder.cfg b/TestCases/disc_adj_rans/cylinder/cylinder.cfg index b198095c386f..cbee6ad74b58 100644 --- a/TestCases/disc_adj_rans/cylinder/cylinder.cfg +++ b/TestCases/disc_adj_rans/cylinder/cylinder.cfg @@ -31,28 +31,26 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO -SINGLEZONE_DRIVER = YES TIME_DOMAIN = YES TIME_ITER = 10 -ITER = 30 % % ------------------------- UNSTEADY SIMULATION -------------------------------% % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0015 +TIME_STEP= 0.0015 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 3.75 +MAX_TIME= 3.75 % 2500 iterations - 3.75 % 3500 iterations - 5.25 % 5000 iterations - 7.50 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 30 +INNER_ITER= 30 % % Direct iteration to start the adjoint solver UNST_ADJOINT_ITER= 10 @@ -126,9 +124,6 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % -% Number of total iterations -EXT_ITER= 10 -% % Objective function OBJECTIVE_FUNCTION=DRAG % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% @@ -207,24 +202,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -238,25 +228,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -265,7 +255,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -281,6 +271,9 @@ WRT_CON_FREQ= 1 % % Writing convergence history frequency (dual time, only written to screen) WRT_CON_FREQ_DUALTIME= 1 +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_PRESS, SENS_AOA) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % diff --git a/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg b/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg index a193f6323ee5..8678569c38bb 100644 --- a/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg +++ b/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg @@ -40,25 +40,24 @@ WRT_SRF_SOL= NO SINGLEZONE_DRIVER = YES TIME_DOMAIN = YES TIME_ITER = 10 -ITER = 30 % % ------------------------- UNSTEADY SIMULATION -------------------------------% % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-1ST_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-1ST_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0015 +TIME_STEP= 0.0015 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 3.75 +MAX_TIME= 3.75 % 2500 iterations - 3.75 % 3500 iterations - 5.25 % 5000 iterations - 7.50 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 30 +INNER_ITER= 30 % % Direct iteration to start the adjoint solver UNST_ADJOINT_ITER= 10 @@ -132,8 +131,6 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % -% Number of total iterations -EXT_ITER= 10 % % Objective function OBJECTIVE_FUNCTION=DRAG @@ -213,24 +210,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -244,25 +236,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= solution_flow.dat +RESTART_FILENAME= solution_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= solution_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -271,7 +263,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -287,7 +279,9 @@ WRT_CON_FREQ= 1 % % Writing convergence history frequency (dual time, only written to screen) WRT_CON_FREQ_DUALTIME= 1 - +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_PRESS, SENS_AOA) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % % Kind of deformation (TRANSLATION, ROTATION, SCALE, diff --git a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg index 754697cbcbc7..d05aeb17308c 100644 --- a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg +++ b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg @@ -16,7 +16,7 @@ % TNE2_EULER, TNE2_NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -33,11 +33,6 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO - -SINGLEZONE_DRIVER = YES -ITER = 11 % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -106,7 +101,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -193,24 +188,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -224,25 +214,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sa.dat +SOLUTION_FILENAME= solution_flow_sa.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -251,7 +241,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -261,3 +251,7 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_NU_TILDE, SENS_PRESS, SENS_AOA) + diff --git a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg index 57af5a7ba258..0ec948c08c28 100644 --- a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg +++ b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg @@ -16,7 +16,7 @@ % TNE2_EULER, TNE2_NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -33,11 +33,6 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO - -SINGLEZONE_DRIVER = YES -ITER = 11 % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -106,7 +101,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 10000 +ITER= 10000 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -192,24 +187,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -223,25 +213,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst.dat +SOLUTION_FILENAME= solution_flow_sst.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -250,7 +240,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -260,3 +250,7 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_TKE, SENS_PRESS, SENS_AOA) + diff --git a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg index a4ce4b8ecfcf..13abd08a28d7 100644 --- a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg +++ b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg @@ -28,10 +28,8 @@ RESTART_SOL= NO % % number of zones (needed for python scripts) NZONES= 1 - -SINGLEZONE_DRIVER = YES -ITER = 2001 % +SINGLEZONE_DRIVER=NO % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -362,31 +360,25 @@ OBJECTIVE_FUNCTION= ENTROPY_GENERATION % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 2001 +ITER= 2001 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -401,25 +393,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per_optimal.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -428,7 +420,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -438,3 +430,5 @@ WRT_SOL_FREQ= 500 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +SCREEN_OUTPUT=(INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_TKE) diff --git a/TestCases/euler/CRM/inv_CRM_JST.cfg b/TestCases/euler/CRM/inv_CRM_JST.cfg index 2a343892a1dc..e27291abf5d6 100644 --- a/TestCases/euler/CRM/inv_CRM_JST.cfg +++ b/TestCases/euler/CRM/inv_CRM_JST.cfg @@ -184,24 +184,19 @@ TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -6 +CONV_RESIDUAL_MINVAL= -6 % % Start convergence criteria at iteration number -STARTCONV_ITER= 100 +CONV_STARTITER= 100 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -212,7 +207,7 @@ MESH_FILENAME= grid_crm_dpw4_MB-structured.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -220,20 +215,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -242,7 +237,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/euler/biparabolic/BIPARABOLIC.cfg b/TestCases/euler/biparabolic/BIPARABOLIC.cfg index 2101a3f230af..355eb1dba364 100644 --- a/TestCases/euler/biparabolic/BIPARABOLIC.cfg +++ b/TestCases/euler/biparabolic/BIPARABOLIC.cfg @@ -219,24 +219,19 @@ HOLD_GRID_FIXED_COORD= ( -0.2, -0.4, 0.0, 2.2, 0.4, 0.0 ) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -6 +CONV_RESIDUAL_MINVAL= -6 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -250,25 +245,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= volume_flow +VOLUME_FILENAME= volume_flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= volume_adjoint @@ -277,7 +272,7 @@ VOLUME_ADJ_FILENAME= volume_adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/euler/bluntbody/blunt.cfg b/TestCases/euler/bluntbody/blunt.cfg index 9779aedee965..96fc417eb15a 100644 --- a/TestCases/euler/bluntbody/blunt.cfg +++ b/TestCases/euler/bluntbody/blunt.cfg @@ -21,6 +21,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -81,7 +84,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.1, 0.9, 5.0, 50.0 ) % % Number of total iterations -EXT_ITER= 2500 +ITER= 2500 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -141,24 +144,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -171,25 +169,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -198,7 +196,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -208,3 +206,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/euler/channel/inv_channel.cfg b/TestCases/euler/channel/inv_channel.cfg index fe2819dcbb89..53b98793ab57 100644 --- a/TestCases/euler/channel/inv_channel.cfg +++ b/TestCases/euler/channel/inv_channel.cfg @@ -163,24 +163,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -194,25 +189,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -221,7 +216,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/euler/channel/inv_channel_RK.cfg b/TestCases/euler/channel/inv_channel_RK.cfg index e7c215a9aee2..7f3b45c0243e 100644 --- a/TestCases/euler/channel/inv_channel_RK.cfg +++ b/TestCases/euler/channel/inv_channel_RK.cfg @@ -21,7 +21,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -95,7 +97,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 110 +ITER= 110 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -157,24 +159,19 @@ TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -188,25 +185,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -215,7 +212,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -225,3 +222,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/euler/naca0012/inv_NACA0012.cfg b/TestCases/euler/naca0012/inv_NACA0012.cfg index 1e905e38d73a..7a8a744e5830 100644 --- a/TestCases/euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/euler/naca0012/inv_NACA0012.cfg @@ -21,7 +21,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -97,7 +99,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 250 +ITER= 250 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -235,24 +237,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -265,25 +262,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -292,7 +289,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -302,7 +299,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg b/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg index 785f4c0127fd..3b7998244199 100644 --- a/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg +++ b/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg @@ -21,6 +21,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone output +SINGLEZONE_DRIVER = YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -85,7 +88,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 110 +ITER= 110 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -146,25 +149,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -178,25 +175,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -205,7 +202,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -215,4 +212,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/euler/oneram6/inv_ONERAM6.cfg b/TestCases/euler/oneram6/inv_ONERAM6.cfg index 3c69369259db..32bc233fe75a 100644 --- a/TestCases/euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/euler/oneram6/inv_ONERAM6.cfg @@ -25,6 +25,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -110,7 +113,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -208,24 +211,19 @@ TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 25 +CONV_STARTITER= 25 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -236,7 +234,7 @@ MESH_FILENAME= mesh_ONERAM6_inv_ffd.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -244,20 +242,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -266,7 +264,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -276,6 +274,9 @@ WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % diff --git a/TestCases/euler/wedge/inv_wedge_HLLC.cfg b/TestCases/euler/wedge/inv_wedge_HLLC.cfg index 357eb990d249..b22062fd6583 100644 --- a/TestCases/euler/wedge/inv_wedge_HLLC.cfg +++ b/TestCases/euler/wedge/inv_wedge_HLLC.cfg @@ -21,6 +21,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -92,7 +95,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 11000 +ITER= 11000 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -155,24 +158,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -186,25 +184,25 @@ MESH_FORMAT= CGNS MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -213,7 +211,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -223,6 +221,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg index 2159cfeda965..44ea9d2eaac6 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg @@ -13,7 +13,7 @@ KIND_RADIAL_BASIS_FUNCTION = WENDLAND_C2 RADIAL_BASIS_FUNCTION_PARAMETER = 0.015 RADIAL_BASIS_FUNCTION_POLYNOMIAL_TERM = YES -INNER_ITER = 1 +INNER_ITER = 30 WRT_BINARY_RESTART=NO READ_BINARY_RESTART=NO % @@ -54,7 +54,7 @@ LINEAR_SOLVER_ITER= 1000 LINEAR_SOLVER_RESTART_FREQUENCY= 100 % % Convergence criteria ------------------------------------------------- % -EXT_ITER= 1 +OUTER_ITER= 1 % interaction FSI_ITER= 1 % if running from scratch this helps a bunch @@ -62,13 +62,8 @@ FSI_ITER= 1 %RAMP_FSI_ITER= 5 BGS_RELAXATION= FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.7 -RESIDUAL_REDUCTION_FSI= 8 -RESIDUAL_MINVAL_FSI= -8 % solid NONLINEAR_FEM_INT_ITER= 30 -RESIDUAL_FEM_UTOL= -6.0 -RESIDUAL_FEM_RTOL= -6.0 -RESIDUAL_FEM_ETOL= -6.0 % % In\Out --------------------------------------------------------------- % MESH_FILENAME= meshFEA.su2 @@ -76,16 +71,12 @@ MESH_FORMAT= SU2 MULTIZONE_MESH = NO % RESTART_SOL= YES -SOLUTION_FLOW_FILENAME= solution_fluid.dat -SOLUTION_STRUCTURE_FILENAME= solution_solid.dat +SOLUTION_FILENAME= solution_solid.dat WRT_SOL_FREQ= 999999 -RESTART_FLOW_FILENAME= restart_fluid.dat -RESTART_STRUCTURE_FILENAME= restart_solid.dat +RESTART_FILENAME= restart_solid.dat % -OUTPUT_FORMAT= PARAVIEW -VOLUME_FLOW_FILENAME= fluid -SURFACE_FLOW_FILENAME= surface_fluid -VOLUME_STRUCTURE_FILENAME= solid +TABULAR_FORMAT= CSV +VOLUME_FILENAME= solid % WRT_CON_FREQ= 10 CONV_FILENAME= history diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg index bbcb70028c07..e255e2118c55 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg @@ -88,7 +88,7 @@ DEFORM_LINEAR_SOLVER_ERROR= 1e-6 DEFORM_LINEAR_SOLVER_ITER= 1000 % % Convergence criteria ------------------------------------------------- % -EXT_ITER= 1 +OUTER_ITER= 1 % interaction FSI_ITER= 1 % if running from scratch this helps a bunch @@ -96,14 +96,10 @@ FSI_ITER= 1 %RAMP_FSI_ITER= 5 BGS_RELAXATION= FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.7 -RESIDUAL_REDUCTION_FSI= 8 -RESIDUAL_MINVAL_FSI= -8 % fluid -UNST_INT_ITER= 60 CONV_CRITERIA= RESIDUAL -STARTCONV_ITER= 0 -RESIDUAL_REDUCTION= 9 -RESIDUAL_MINVAL= -9 +CONV_STARTITER= 0 +CONV_RESIDUAL_MINVAL= -9 % grid deformation DEFORM_NONLINEAR_ITER= 1 DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME @@ -113,16 +109,13 @@ MESH_FILENAME= meshFlow.su2 MESH_FORMAT= SU2 % RESTART_SOL= YES -SOLUTION_FLOW_FILENAME= solution_fluid.dat -SOLUTION_STRUCTURE_FILENAME= solution_solid.dat +SOLUTION_FILENAME= solution_fluid.dat WRT_SOL_FREQ= 999999 -RESTART_FLOW_FILENAME= restart_fluid.dat -RESTART_STRUCTURE_FILENAME= restart_solid.dat +RESTART_FILENAME= restart_fluid.dat % -OUTPUT_FORMAT= PARAVIEW -VOLUME_FLOW_FILENAME= fluid -SURFACE_FLOW_FILENAME= surface_fluid -VOLUME_STRUCTURE_FILENAME= solid +TABULAR_FORMAT= CSV +VOLUME_FILENAME= fluid +SURFACE_FILENAME= surface_fluid % WRT_CON_FREQ= 10 CONV_FILENAME= history diff --git a/TestCases/fea_fsi/Airfoil_RBF/settings.cfg b/TestCases/fea_fsi/Airfoil_RBF/settings.cfg index e3f70c72f313..6a8b9e76ec6b 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/settings.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/settings.cfg @@ -138,19 +138,14 @@ FSI_ITER= 1 %RAMP_FSI_ITER= 5 BGS_RELAXATION= FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.7 -RESIDUAL_REDUCTION_FSI= 8 -RESIDUAL_MINVAL_FSI= -8 +CONV_RESIDUAL_MINVAL_FSI= -8 % fluid UNST_INT_ITER= 60 CONV_CRITERIA= RESIDUAL -STARTCONV_ITER= 0 -RESIDUAL_REDUCTION= 9 -RESIDUAL_MINVAL= -9 +CONV_STARTITER= 0 +CONV_RESIDUAL_MINVAL= -9 % solid NONLINEAR_FEM_INT_ITER= 30 -RESIDUAL_FEM_UTOL= -6.0 -RESIDUAL_FEM_RTOL= -6.0 -RESIDUAL_FEM_ETOL= -6.0 % grid deformation DEFORM_NONLINEAR_ITER= 1 DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME @@ -160,15 +155,15 @@ MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 % RESTART_SOL= YES -SOLUTION_FLOW_FILENAME= solution_fluid.dat +SOLUTION_FILENAME= solution_fluid.dat SOLUTION_STRUCTURE_FILENAME= solution_solid.dat WRT_SOL_FREQ= 999999 -RESTART_FLOW_FILENAME= restart_fluid.dat +RESTART_FILENAME= restart_fluid.dat RESTART_STRUCTURE_FILENAME= restart_solid.dat % -OUTPUT_FORMAT= PARAVIEW -VOLUME_FLOW_FILENAME= fluid -SURFACE_FLOW_FILENAME= surface_fluid +TABULAR_FORMAT= CSV +VOLUME_FILENAME= fluid +SURFACE_FILENAME= surface_fluid VOLUME_STRUCTURE_FILENAME= solid % WRT_CON_FREQ= 10 diff --git a/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg b/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg index 3c961a193db0..3363bc37d7cf 100644 --- a/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg +++ b/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg @@ -12,22 +12,20 @@ MATH_PROBLEM= DIRECT GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS MATERIAL_MODEL= NEO_HOOKEAN MESH_FILENAME= meshBeam_2d.su2 +SINGLEZONE_DRIVER=YES RESTART_SOL= YES WRT_BINARY_RESTART= NO READ_BINARY_RESTART= NO -DYN_RESTART_ITER= 1 -NONLINEAR_FEM_INT_ITER = 10 -RESIDUAL_FEM_UTOL = -5.0 -RESIDUAL_FEM_RTOL = -5.0 -RESIDUAL_FEM_ETOL = -5.0 +RESTART_ITER= 1 ELASTICITY_MODULUS=3E7 POISSON_RATIO=0.3 MATERIAL_DENSITY=7854 FORMULATION_ELASTICITY_2D = PLANE_STRESS -DYNAMIC_ANALYSIS= YES -DYN_TIMESTEP= 0.01 -DYN_TIME= 0.1 -EXT_ITER=2 +TIME_DOMAIN=YES +TIME_STEP=0.01 +MAX_TIME= 0.1 +INNER_ITER=10 +TIME_ITER=7 TIME_DISCRE_FEA= NEWMARK_IMPLICIT NEWMARK_BETA=0.2601 NEWMARK_GAMMA=0.52 @@ -39,11 +37,11 @@ LINEAR_SOLVER_PREC= LU_SGS LINEAR_SOLVER_ERROR= 1E-8 LINEAR_SOLVER_ITER= 1000 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_SRF_SOL = NO -VOLUME_STRUCTURE_FILENAME= beam -RESTART_STRUCTURE_FILENAME= restart_beam.dat -SOLUTION_STRUCTURE_FILENAME= solution_beam.dat +VOLUME_FILENAME= beam +RESTART_FILENAME= restart_beam.dat +SOLUTION_FILENAME= solution_beam.dat WRT_SOL_FREQ= 1 WRT_SOL_FREQ_DUALTIME= 1 WRT_CON_FREQ= 1 diff --git a/TestCases/fea_fsi/MixElemsKnowles/config.cfg b/TestCases/fea_fsi/MixElemsKnowles/config.cfg index 10e7e2fa200b..a239c9d29f1b 100644 --- a/TestCases/fea_fsi/MixElemsKnowles/config.cfg +++ b/TestCases/fea_fsi/MixElemsKnowles/config.cfg @@ -42,15 +42,13 @@ LINEAR_SOLVER_ITER= 1 LINEAR_SOLVER_ERROR= 1e-10 % % Convergence criteria -NONLINEAR_FEM_INT_ITER= 1 -RESIDUAL_CRITERIA_FEM= ABSOLUTE -RESIDUAL_FEM_UTOL= -6 -RESIDUAL_FEM_RTOL= -6 -RESIDUAL_FEM_ETOL= -6 +INNER_ITER= 1 % % In/Out MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV RESTART_SOL= YES +SOLUTION_FILENAME= solution_structure.dat +SCREEN_OUTPUT=(INNER_ITER, RMS_UTOL, RMS_RTOL, RMS_ETOL, VMS) diff --git a/TestCases/fea_fsi/SquareCyl_Beam/config.cfg b/TestCases/fea_fsi/SquareCyl_Beam/config.cfg index 092c6c1695bb..32437c0286d9 100644 --- a/TestCases/fea_fsi/SquareCyl_Beam/config.cfg +++ b/TestCases/fea_fsi/SquareCyl_Beam/config.cfg @@ -31,10 +31,7 @@ MATH_PROBLEM= DIRECT RESTART_SOL= YES % % Unsteady restart iteration (need previous restart files) -UNST_RESTART_ITER= 2 -% -% Unsteady restart iteration (need previous restart files) -DYN_RESTART_ITER= 2 +RESTART_ITER= 2 % % Restart the solution from a steady state solution (sets Grid Vel to 0) RESTART_STEADY_STATE = NO @@ -54,13 +51,10 @@ MESH_FILENAME= mesh.su2 % ------------------------------- TIME STEP -----------------------------------% % % Time Step for dual time stepping fluid simulations (s) -UNST_TIMESTEP= 0.01 -% -% Structural time step (s) -DYN_TIMESTEP= 0.01 +TIME_STEP= 0.01 % % Number of total iterations -EXT_ITER= 35 +TIME_ITER= 35 % --------------------------- FSI CONVERGENCE ---------------------------------% % @@ -73,11 +67,9 @@ BGS_RELAXATION = FIXED_PARAMETER % Relaxation parameter STAT_RELAX_PARAMETER= 0.7 % -% Residual reduction in the boundary displacements (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION_FSI= 5 % % Min value of the residual in the boundary displacement (log10 of the residual) -RESIDUAL_MINVAL_FSI= -5.92 +CONV_RESIDUAL_MINVAL_FSI= -5.92 % -------------------------- BOUNDARY CONDITIONS ------------------------------% % @@ -116,9 +108,6 @@ FORMULATION_ELASTICITY_2D = PLANE_STRESS NONLINEAR_FEM_INT_ITER = 20 % % Convergence tolerances -RESIDUAL_FEM_UTOL = -7.0 -RESIDUAL_FEM_RTOL = -5.0 -RESIDUAL_FEM_ETOL = -7.0 % -------------------------- DYNAMIC SIMULATION -------------------------------% % @@ -148,7 +137,7 @@ MARKER_PRESSURE= ( RightBeamS , 0, LowerBeamS, 0, UpperBeamS, 0) % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Total Physical Time for dual time stepping simulations (s) UNST_TIME= 1.0 @@ -233,11 +222,11 @@ MARKER_MONITORING= ( UpperBeam, RightBeam, LowerBeam) % --------------------------- INPUT / OUTPUT ----------------------------------% % -----------------------------------------------------------------------------% % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= results_flow +VOLUME_FILENAME= results_flow % % Output file name (PARAVIEW, TECPLOT) VOLUME_STRUCTURE_FILENAME= results_beam @@ -249,13 +238,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Output file name (PARAVIEW, TECPLOT) SOLUTION_STRUCTURE_FILENAME= solution_beam.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart flow RESTART_STRUCTURE_FILENAME= restart_beam.dat @@ -354,22 +343,17 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 4 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG diff --git a/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg b/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg index a70b12798317..f023727db05f 100644 --- a/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg +++ b/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg @@ -10,6 +10,7 @@ SOLVER= ELASTICITY MATH_PROBLEM= DIRECT GEOMETRIC_CONDITIONS= SMALL_DEFORMATIONS +SINGLEZONE_DRIVER=YES MATERIAL_MODEL= LINEAR_ELASTIC MESH_FILENAME= meshBeam_3d.su2 ELASTICITY_MODULUS=3E7 @@ -24,11 +25,12 @@ LINEAR_SOLVER_PREC= LU_SGS LINEAR_SOLVER_ERROR= 1E-8 LINEAR_SOLVER_ITER= 500 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_SRF_SOL = NO CONV_FILENAME= history_beam -VOLUME_STRUCTURE_FILENAME= beam -RESTART_STRUCTURE_FILENAME= restart_beam.dat +VOLUME_FILENAME= beam +RESTART_FILENAME= restart_beam.dat +SOLUTION_FILENAME= restart_beam.dat WRT_SOL_FREQ= 1 WRT_SOL_FREQ_DUALTIME= 1 WRT_CON_FREQ= 1 diff --git a/TestCases/fea_fsi/WallChannel_2d/configFEA.cfg b/TestCases/fea_fsi/WallChannel_2d/configFEA.cfg index fb29089decb0..2cb45725394d 100644 --- a/TestCases/fea_fsi/WallChannel_2d/configFEA.cfg +++ b/TestCases/fea_fsi/WallChannel_2d/configFEA.cfg @@ -15,9 +15,9 @@ READ_BINARY_RESTART= NO BGS_RELAXATION = FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.5 -RESIDUAL_REDUCTION_FSI= 5 -RESIDUAL_MINVAL_FSI= -8 +%SCREEN_OUTPUT=(TIME_ITER, OUTER_ITER, INNER_ITER, BGS_DISP_X, BGS_DISP_Y) +INNER_ITER=10 LINEAR_SOLVER= FGMRES LINEAR_SOLVER_PREC= LU_SGS LINEAR_SOLVER_ERROR= 1E-6 @@ -27,8 +27,6 @@ ELASTICITY_MODULUS=5E4 MATERIAL_DENSITY=50 FORMULATION_ELASTICITY_2D = PLANE_STRESS POISSON_RATIO=0.3 -DYNAMIC_ANALYSIS= YES -DYN_TIME= 4.01 TIME_DISCRE_FEA= NEWMARK_IMPLICIT NEWMARK_BETA=0.36 NEWMARK_GAMMA=0.7 @@ -38,10 +36,6 @@ RELAXATION = YES GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS MATERIAL_MODEL= NEO_HOOKEAN -NONLINEAR_FEM_INT_ITER = 10 -RESIDUAL_FEM_UTOL = -7.0 -RESIDUAL_FEM_RTOL = -7.0 -RESIDUAL_FEM_ETOL = -7.0 MARKER_CLAMPED = ( clamped ) MARKER_PRESSURE= ( wallDownS, 0.0, wallUpperS, 0.0, wallUpwS, 0.0) @@ -51,16 +45,15 @@ MULTIZONE_MESH= NO MESH_FILENAME= meshFEA.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW -WRT_CON_FREQ= 100 -WRT_CON_FREQ_DUALTIME= 100 -WRT_SOL_FREQ= 100 -WRT_SOL_FREQ_DUALTIME= 100 +WRT_CON_FREQ= 1 +WRT_CON_FREQ_DUALTIME= 1 +WRT_SOL_FREQ= 1 +WRT_SOL_FREQ_DUALTIME= 1 -VOLUME_STRUCTURE_FILENAME= results_wall -RESTART_STRUCTURE_FILENAME= solution_wall.dat -SOLUTION_STRUCTURE_FILENAME= solution_wall.dat +VOLUME_FILENAME= results_wall +RESTART_FILENAME= solution_wall.dat +SOLUTION_FILENAME= solution_wall.dat WRT_SRF_SOL = NO WRT_CSV_SOL = NO diff --git a/TestCases/fea_fsi/WallChannel_2d/configFSI.cfg b/TestCases/fea_fsi/WallChannel_2d/configFSI.cfg index 87c887f51aa6..1063a65d96db 100644 --- a/TestCases/fea_fsi/WallChannel_2d/configFSI.cfg +++ b/TestCases/fea_fsi/WallChannel_2d/configFSI.cfg @@ -12,16 +12,14 @@ CONFIG_LIST = (configFlow.cfg, configFEA.cfg) MARKER_ZONE_INTERFACE = (wallUpwF, wallUpwS, wallUpperF, wallUpperS, wallDownF, wallDownS) MESH_FILENAME= meshFSI_2D.su2 - TIME_DOMAIN = YES -TIME_ITER = 3 +TIME_ITER = 5 TIME_STEP = 0.005 RESTART_SOL= YES RESTART_ITER = 2 - +OUTPUT_FILES=(RESTART_ASCII, PARAVIEW) OUTER_ITER = 5 - % Only required by the python scripts MATH_PROBLEM = DIRECT -WRT_SOL_FREQ = 100 + diff --git a/TestCases/fea_fsi/WallChannel_2d/configFSI_2D.cfg b/TestCases/fea_fsi/WallChannel_2d/configFSI_2D.cfg index ae442436fb1b..5376d9ccc17b 100644 --- a/TestCases/fea_fsi/WallChannel_2d/configFSI_2D.cfg +++ b/TestCases/fea_fsi/WallChannel_2d/configFSI_2D.cfg @@ -6,6 +6,11 @@ % Date: 2016.02.01 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MULTIZONE=YES +TIME_ITER=3 +TIME_STEP= 0.005 +RESTART_ITER=2 + + SURFACE_MOVEMENT=FLUID_STRUCTURE SOLVER= FLUID_STRUCTURE_INTERACTION FSI_FLUID_PROBLEM = NAVIER_STOKES @@ -14,21 +19,16 @@ MATH_PROBLEM= DIRECT RESTART_SOL= YES WRT_BINARY_RESTART= NO READ_BINARY_RESTART= NO -UNST_RESTART_ITER= 2 -DYN_RESTART_ITER= 2 -EXT_ITER= 3 -UNST_TIMESTEP= 0.005 -DYN_TIMESTEP= 0.005 +RESTART_ITER= 2 FSI_ITER= 5 MARKER_ZONE_INTERFACE = (wallUpwF, wallUpwS, wallUpperF, wallUpperS, wallDownF, wallDownS) CONSERVATIVE_INTERPOLATION = YES BGS_RELAXATION = FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.5 -RESIDUAL_REDUCTION_FSI= 5 -RESIDUAL_MINVAL_FSI= -8 -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -UNST_TIME= 4.01 -UNST_INT_ITER= 50 +CONV_RESIDUAL_MINVAL_FSI= -8 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +MAX_TIME= 4.01 +INNER_ITER= 50 KIND_TURB_MODEL= NONE AOA= 0.0 SIDESLIP_ANGLE= 0.0 @@ -66,12 +66,10 @@ VENKAT_LIMITER_COEFF= 1.0 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 3 -RESIDUAL_MINVAL= -10 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-5 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-5 ELASTICITY_MODULUS=5E4 MATERIAL_DENSITY=50 FORMULATION_ELASTICITY_2D = PLANE_STRESS @@ -84,9 +82,6 @@ NEWMARK_GAMMA=0.7 GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS MATERIAL_MODEL= NEO_HOOKEAN NONLINEAR_FEM_INT_ITER = 10 -RESIDUAL_FEM_UTOL = -7.0 -RESIDUAL_FEM_RTOL = -7.0 -RESIDUAL_FEM_ETOL = -7.0 FSI_LINEAR_SOLVER_PREC_STRUC= LU_SGS FSI_LINEAR_SOLVER_ITER_STRUC = 1000 MARKER_CLAMPED = ( clamped ) @@ -96,16 +91,16 @@ DEFORM_NONLINEAR_ITER= 1 DEFORM_LINEAR_SOLVER= FGMRES DEFORM_LINEAR_SOLVER_PREC= LU_SGS DEFORM_LINEAR_ITER= 500 -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_CON_FREQ= 100 WRT_CON_FREQ_DUALTIME= 100 WRT_SOL_FREQ= 100 WRT_SOL_FREQ_DUALTIME= 100 -VOLUME_FLOW_FILENAME= results_flow -RESTART_FLOW_FILENAME= restart_flow.dat -SOLUTION_FLOW_FILENAME= solution_flow.dat +VOLUME_FILENAME= results_flow +RESTART_FILENAME= restart_flow.dat +SOLUTION_FILENAME= solution_flow.dat VOLUME_STRUCTURE_FILENAME= results_wall RESTART_STRUCTURE_FILENAME= restart_wall.dat SOLUTION_STRUCTURE_FILENAME= solution_wall.dat diff --git a/TestCases/fea_fsi/WallChannel_2d/configFlow.cfg b/TestCases/fea_fsi/WallChannel_2d/configFlow.cfg index 6df22cff695e..c6411fefe49a 100644 --- a/TestCases/fea_fsi/WallChannel_2d/configFlow.cfg +++ b/TestCases/fea_fsi/WallChannel_2d/configFlow.cfg @@ -9,17 +9,17 @@ SOLVER= NAVIER_STOKES SURFACE_MOVEMENT = FLUID_STRUCTURE MARKER_MOVING=(wallUpwF, wallDownF, wallUpperF) -UNST_INT_ITER= 50 INNER_ITER=50 +%SCREEN_OUTPUT=(TIME_ITER, OUTER_ITER, INNER_ITER, BGS_DENSITY, BGS_ENERGY) + MATH_PROBLEM= DIRECT RESTART_SOL= YES WRT_BINARY_RESTART= NO READ_BINARY_RESTART= NO -RESIDUAL_MINVAL_FSI= -8 -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -UNST_TIME= 4.01 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +MAX_TIME= 4.01 KIND_TURB_MODEL= NONE AOA= 0.0 @@ -58,12 +58,10 @@ VENKAT_LIMITER_COEFF= 1.0 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 3 -RESIDUAL_MINVAL= -10 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-5 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-5 MULTIZONE_MESH= NO MESH_FILENAME= meshFlow.su2 @@ -74,15 +72,15 @@ DEFORM_LINEAR_ITER= 500 DEFORM_STIFFNESS_TYPE= WALL_DISTANCE MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW -WRT_CON_FREQ= 100 -WRT_CON_FREQ_DUALTIME= 100 -WRT_SOL_FREQ= 100 -WRT_SOL_FREQ_DUALTIME= 100 +TABULAR_FORMAT= CSV +WRT_CON_FREQ= 1 +WRT_CON_FREQ_DUALTIME= 1 +WRT_SOL_FREQ= 1 +WRT_SOL_FREQ_DUALTIME= 1 -VOLUME_FLOW_FILENAME= results_flow -RESTART_FLOW_FILENAME= solution_flow.dat -SOLUTION_FLOW_FILENAME= solution_flow.dat +VOLUME_FILENAME= results_flow +RESTART_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat WRT_SRF_SOL = NO WRT_CSV_SOL = NO diff --git a/TestCases/fea_fsi/dyn_fsi/config.cfg b/TestCases/fea_fsi/dyn_fsi/config.cfg index 95110904cf88..00f2925f0157 100644 --- a/TestCases/fea_fsi/dyn_fsi/config.cfg +++ b/TestCases/fea_fsi/dyn_fsi/config.cfg @@ -15,9 +15,9 @@ MARKER_ZONE_INTERFACE = (wallUpperF, wallUpperS, wallUpwF, wallUpwS, wallDownF, MULTIZONE_MESH = NO TIME_DOMAIN = YES -TIME_ITER = 3 +TIME_ITER = 5 TIME_STEP = 0.005 - +SCREEN_OUTPUT= (TIME_ITER, OUTER_ITER, BGS_DENSITY[0], AVG_BGS_RES[1], DEFORM_MIN_VOLUME[0], DEFORM_ITER[0]) RESTART_SOL= YES RESTART_ITER = 2 diff --git a/TestCases/fea_fsi/dyn_fsi/configFEA.cfg b/TestCases/fea_fsi/dyn_fsi/configFEA.cfg index b9c5bc7c3ecf..07bcd69468ea 100644 --- a/TestCases/fea_fsi/dyn_fsi/configFEA.cfg +++ b/TestCases/fea_fsi/dyn_fsi/configFEA.cfg @@ -16,8 +16,6 @@ MARKER_ZONE_INTERFACE = (wallUpperF, wallUpperS, wallUpwF, wallUpwS, wallDownF, BGS_RELAXATION = FIXED_PARAMETER STAT_RELAX_PARAMETER= 0.5 -RESIDUAL_REDUCTION_FSI= 5 -RESIDUAL_MINVAL_FSI= -8 LINEAR_SOLVER= CONJUGATE_GRADIENT LINEAR_SOLVER_PREC= ILU @@ -28,8 +26,6 @@ ELASTICITY_MODULUS=5E4 MATERIAL_DENSITY=50 FORMULATION_ELASTICITY_2D = PLANE_STRESS POISSON_RATIO=0.3 -DYNAMIC_ANALYSIS= YES -DYN_TIME= 4.01 TIME_DISCRE_FEA= NEWMARK_IMPLICIT NEWMARK_BETA=0.36 NEWMARK_GAMMA=0.7 @@ -39,10 +35,7 @@ RELAXATION = YES GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS MATERIAL_MODEL= NEO_HOOKEAN -NONLINEAR_FEM_INT_ITER = 10 -RESIDUAL_FEM_UTOL = -7.0 -RESIDUAL_FEM_RTOL = -7.0 -RESIDUAL_FEM_ETOL = -7.0 +INNER_ITER = 10 MARKER_CLAMPED = ( clamped ) MARKER_PRESSURE= ( wallDownS, 0.0, wallUpperS, 0.0, wallUpwS, 0.0) @@ -52,16 +45,16 @@ MARKER_FLUID_LOAD= ( wallDownS, wallUpperS, 0.0, wallUpwS, 0.0) MESH_FILENAME= meshFEA.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_CON_FREQ= 100 WRT_CON_FREQ_DUALTIME= 100 WRT_SOL_FREQ= 100 WRT_SOL_FREQ_DUALTIME= 100 -VOLUME_STRUCTURE_FILENAME= results_wall -RESTART_STRUCTURE_FILENAME= restart_wall.dat -SOLUTION_STRUCTURE_FILENAME= solution_wall.dat +VOLUME_FILENAME= results_wall +RESTART_FILENAME= restart_wall.dat +SOLUTION_FILENAME= solution_wall.dat WRT_SRF_SOL = NO WRT_CSV_SOL = NO diff --git a/TestCases/fea_fsi/dyn_fsi/configFlow.cfg b/TestCases/fea_fsi/dyn_fsi/configFlow.cfg index e7adc43f6c8f..5043085f3380 100644 --- a/TestCases/fea_fsi/dyn_fsi/configFlow.cfg +++ b/TestCases/fea_fsi/dyn_fsi/configFlow.cfg @@ -10,18 +10,14 @@ SOLVER= NAVIER_STOKES DEFORM_MESH = YES MARKER_DEFORM_MESH= ( wallUpwF, wallDownF, wallUpperF ) -UNST_INT_ITER= 50 INNER_ITER=50 -TIME_DOMAIN = YES MATH_PROBLEM= DIRECT WRT_BINARY_RESTART= NO READ_BINARY_RESTART= NO -RESIDUAL_MINVAL_FSI= -8 -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -UNST_TIME= 4.01 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER KIND_TURB_MODEL= NONE AOA= 0.0 @@ -51,7 +47,7 @@ MARKER_MONITORING= ( wallUpwF, wallDownF, wallUpperF ) NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= LU_SGS +LINEAR_SOLVER_PREC= ILU LINEAR_SOLVER_ERROR= 1E-6 LINEAR_SOLVER_ITER= 2 CONV_NUM_METHOD_FLOW= ROE @@ -60,12 +56,10 @@ VENKAT_LIMITER_COEFF= 1.0 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 3 -RESIDUAL_MINVAL= -10 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-5 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-5 MESH_FILENAME= meshFlow.su2 DEFORM_NONLINEAR_ITER= 1 @@ -76,15 +70,15 @@ DEFORM_LINEAR_SOLVER_ITER = 5000 DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_CON_FREQ= 100 WRT_CON_FREQ_DUALTIME= 100 WRT_SOL_FREQ= 100 WRT_SOL_FREQ_DUALTIME= 100 -VOLUME_FLOW_FILENAME= results_flow -RESTART_FLOW_FILENAME= restart_flow.dat -SOLUTION_FLOW_FILENAME= solution_flow.dat +VOLUME_FILENAME= results_flow +RESTART_FILENAME= restart_flow.dat +SOLUTION_FILENAME= solution_flow.dat WRT_SRF_SOL = NO WRT_CSV_SOL = NO diff --git a/TestCases/fea_fsi/stat_fsi/config.cfg b/TestCases/fea_fsi/stat_fsi/config.cfg index 670b3aa94aa4..8e74726c7a91 100755 --- a/TestCases/fea_fsi/stat_fsi/config.cfg +++ b/TestCases/fea_fsi/stat_fsi/config.cfg @@ -16,9 +16,10 @@ MULTIZONE_SOLVER = BLOCK_GAUSS_SEIDEL MARKER_ZONE_INTERFACE = (wallF, wallS) MULTIZONE_MESH = NO - +SCREEN_OUTPUT=(OUTER_ITER, BGS_DENSITY[0], AVG_BGS_RES[1], DEFORM_MIN_VOLUME[0], DEFORM_ITER[0]) RESTART_SOL= NO RESTART_ITER = 0 TIME_DOMAIN = NO -OUTER_ITER = 10 +OUTER_ITER = 8 + diff --git a/TestCases/fea_fsi/stat_fsi/configFEA.cfg b/TestCases/fea_fsi/stat_fsi/configFEA.cfg index f46e0aa11992..fee60e5af14d 100755 --- a/TestCases/fea_fsi/stat_fsi/configFEA.cfg +++ b/TestCases/fea_fsi/stat_fsi/configFEA.cfg @@ -22,17 +22,14 @@ GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS MATERIAL_MODEL= NEO_HOOKEAN MATERIAL_COMPRESSIBILITY= COMPRESSIBLE NONLINEAR_FEM_SOLUTION_METHOD = NEWTON_RAPHSON -NONLINEAR_FEM_INT_ITER = 10 +INNER_ITER = 10 -RESIDUAL_FEM_UTOL = -8.0 -RESIDUAL_FEM_RTOL = -8.0 -RESIDUAL_FEM_ETOL = -8.0 INCREMENTAL_LOAD = NO % --------------------------- TIME STEP ISSUES --------------------------------% -EXT_ITER= 1 +TIME_ITER= 1 WRT_SOL_FREQ= 1 WRT_SOL_FREQ_DUALTIME= 1 @@ -48,22 +45,17 @@ STAT_RELAX_PARAMETER= 1.0 BGS_RELAXATION = FIXED_PARAMETER PREDICTOR_ORDER = 0 -RESIDUAL_REDUCTION_FSI= 5 -RESIDUAL_MINVAL_FSI= -10.0 +CONV_FIELD=RMS_UTOL +CONV_RESIDUAL_MINVAL=-10 % ----------------------------- INPUT/OUTPUT ----------------------------------% -VOLUME_STRUCTURE_FILENAME= result_beam - -CONV_FILENAME= history - -WRITE_CONV_FILENAME_FSI = YES -CONV_FILENAME_FSI= historyFSI.csv +VOLUME_FILENAME= result_beam BREAKDOWN_FILENAME= forces_breakdown.dat -SOLUTION_STRUCTURE_FILENAME= solution_beam.dat -RESTART_STRUCTURE_FILENAME= restart_beam.dat +SOLUTION_FILENAME= solution_beam.dat +RESTART_FILENAME= restart_beam.dat WRT_SRF_SOL = NO WRT_CSV_SOL = NO @@ -83,7 +75,7 @@ TIME_DISCRE_FEA= NEWMARK_IMPLICIT LINEAR_SOLVER = CONJUGATE_GRADIENT LINEAR_SOLVER_PREC = JACOBI -LINEAR_SOLVER_ERROR = 1E-8 +LINEAR_SOLVER_ERROR = 1E-3 LINEAR_SOLVER_ITER = 2000 % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% @@ -96,6 +88,6 @@ MARKER_FLUID_LOAD = (wallS) % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV WRT_CON_FREQ= 1 WRT_CON_FREQ_DUALTIME= 1 diff --git a/TestCases/fea_fsi/stat_fsi/configFlow.cfg b/TestCases/fea_fsi/stat_fsi/configFlow.cfg index a7d0db4be37e..48e87e03f5c5 100755 --- a/TestCases/fea_fsi/stat_fsi/configFlow.cfg +++ b/TestCases/fea_fsi/stat_fsi/configFlow.cfg @@ -35,24 +35,20 @@ DEFORM_CONSOLE_OUTPUT = NO % -----------------------------------------------------------------------------% -EXT_ITER= 1 -WRT_SOL_FREQ= 1 -WRT_SOL_FREQ_DUALTIME= 1 +WRT_SOL_FREQ= 10 +WRT_SOL_FREQ_DUALTIME= 10 INNER_ITER= 200 % ----------------------------- INPUT/OUTPUT ----------------------------------% -VOLUME_FLOW_FILENAME= result_flow +VOLUME_FILENAME= result_flow CONV_FILENAME= history -WRITE_CONV_FILENAME_FSI = YES - -CONV_FILENAME_FSI= historyFSI.csv BREAKDOWN_FILENAME= forces_breakdown.dat -SOLUTION_FLOW_FILENAME= solution_flow.dat -RESTART_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= solution_flow.dat +RESTART_FILENAME= restart_flow.dat WRT_SRF_SOL = NO WRT_CSV_SOL = NO @@ -69,13 +65,9 @@ MARKER_MONITORING= ( wallF ) % -------------------------- FLUID SIMULATION ---------------------------------% -UNSTEADY_SIMULATION= NO -% +TIME_DOMAIN=NO % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 4.01 -% -% Dynamic analysis total time -DYN_TIME= 4.01 +MAX_TIME= 4.01 % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% @@ -116,7 +108,7 @@ RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= LU_SGS +LINEAR_SOLVER_PREC= ILU LINEAR_SOLVER_ERROR= 1E-6 LINEAR_SOLVER_ITER= 2 @@ -136,16 +128,14 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 4 -RESIDUAL_MINVAL= -10 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-5 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-5 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV WRT_CON_FREQ= 1 WRT_CON_FREQ_DUALTIME= 1 diff --git a/TestCases/fea_fsi/stat_fsi/config_restart.cfg b/TestCases/fea_fsi/stat_fsi/config_restart.cfg index a8a84f997ce6..fa395744db71 100755 --- a/TestCases/fea_fsi/stat_fsi/config_restart.cfg +++ b/TestCases/fea_fsi/stat_fsi/config_restart.cfg @@ -16,9 +16,8 @@ MULTIZONE_SOLVER = BLOCK_GAUSS_SEIDEL MARKER_ZONE_INTERFACE = (wallF, wallS) MULTIZONE_MESH = NO - +SCREEN_OUTPUT=(OUTER_ITER, BGS_DENSITY[0], AVG_BGS_RES[1], DEFORM_MIN_VOLUME[0], DEFORM_ITER[0]) RESTART_SOL= YES RESTART_ITER = 0 - TIME_DOMAIN = NO -OUTER_ITER = 10 +OUTER_ITER = 2 diff --git a/TestCases/fea_topology/config.cfg b/TestCases/fea_topology/config.cfg index ffda52c6c058..7b7f410d056d 100644 --- a/TestCases/fea_topology/config.cfg +++ b/TestCases/fea_topology/config.cfg @@ -66,6 +66,7 @@ MATH_PROBLEM= DISCRETE_ADJOINT DYNAMIC_ANALYSIS= NO RESTART_SOL= NO % +SOLUTION_FILENAME=solution_structure.dat % Numerics GEOMETRIC_CONDITIONS= SMALL_DEFORMATIONS FORMULATION_ELASTICITY_2D= PLANE_STRESS @@ -92,7 +93,7 @@ DISCADJ_LIN_PREC= ILU % In/Out MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_SOL_FREQ= 9999 WRT_CON_FREQ= 1 SOLUTION_ADJ_FILENAME= solution_adj.dat diff --git a/TestCases/fea_topology/quick_start/settings.cfg b/TestCases/fea_topology/quick_start/settings.cfg index 1d3bb8e8e499..b50e9def37a9 100644 --- a/TestCases/fea_topology/quick_start/settings.cfg +++ b/TestCases/fea_topology/quick_start/settings.cfg @@ -47,7 +47,7 @@ LINEAR_SOLVER_ITER= 1000 % In/Out MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history VOLUME_STRUCTURE_FILENAME= direct VOLUME_ADJ_STRUCTURE_FILENAME= adjoint diff --git a/TestCases/fea_topology/quick_start/settings_refnode.cfg b/TestCases/fea_topology/quick_start/settings_refnode.cfg index 5e7643add94f..bad3c9751396 100644 --- a/TestCases/fea_topology/quick_start/settings_refnode.cfg +++ b/TestCases/fea_topology/quick_start/settings_refnode.cfg @@ -49,7 +49,7 @@ DISCADJ_LIN_PREC= ILU % In/Out MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history VOLUME_STRUCTURE_FILENAME= direct VOLUME_ADJ_STRUCTURE_FILENAME= adjoint diff --git a/TestCases/fea_topology/quick_start/settings_volfrac.cfg b/TestCases/fea_topology/quick_start/settings_volfrac.cfg index a36ebeb2f6fe..b6177a662b50 100644 --- a/TestCases/fea_topology/quick_start/settings_volfrac.cfg +++ b/TestCases/fea_topology/quick_start/settings_volfrac.cfg @@ -46,7 +46,7 @@ DISCADJ_LIN_PREC= ILU % In/Out MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history VOLUME_STRUCTURE_FILENAME= direct VOLUME_ADJ_STRUCTURE_FILENAME= adjoint diff --git a/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg b/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg index 3385c7dca514..dfb0dcc5032b 100644 --- a/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg +++ b/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg @@ -20,7 +20,12 @@ SOLVER= EULER MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) -RESTART_SOL= NO +RESTART_SOL= YES +% +% New singlezone driver +SINGLEZONE_DRIVER= YES +% +READ_BINARY_RESTART=NO % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -109,7 +114,7 @@ OBJECTIVE_FUNCTION= DRAG CFL_NUMBER= 4.0 % % Number of total iterations -EXT_ITER= 500 +ITER=101 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -247,24 +252,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -277,25 +277,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -304,7 +304,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -314,7 +314,11 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 - +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) +% +OUTPUT_FILES= (RESTART_ASCII) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg b/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg index ac766dcba9d4..54615e658a60 100644 --- a/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg +++ b/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg @@ -23,11 +23,15 @@ MATH_PROBLEM= CONTINUOUS_ADJOINT RESTART_SOL= NO % % Write binary restart files (YES, NO) -WRT_BINARY_RESTART= NO +WRT_BINARY_RESTART= YES % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER=YES +% +OUTPUT_FILES= (RESTART_ASCII) % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -115,7 +119,7 @@ OBJECTIVE_FUNCTION= DRAG CFL_NUMBER= 5.0 % % Number of total iterations -EXT_ITER= 500 +ITER= 500 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -253,24 +257,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 14 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -283,25 +282,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -310,7 +309,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -320,6 +319,8 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/gust/inv_gust_NACA0012.cfg b/TestCases/gust/inv_gust_NACA0012.cfg index 9a9163176efa..50a6a1f34933 100644 --- a/TestCases/gust/inv_gust_NACA0012.cfg +++ b/TestCases/gust/inv_gust_NACA0012.cfg @@ -19,6 +19,8 @@ SOLVER= EULER % Mathematical problem (DIRECT, CONTINUOUS_ADJOINT) MATH_PROBLEM= DIRECT % +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -55,19 +57,21 @@ REF_DIMENSIONALIZATION= DIMENSIONAL % ------------------------- UNSTEADY SIMULATION -------------------------------% % +% Enable time domain +TIME_DOMAIN=YES % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, SPECTRAL_METHOD) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.001469304 +TIME_STEP= 0.001469304 % Corresponds to a ds of 0.2 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 100 +INNER_ITER= 100 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % @@ -212,29 +216,25 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 401 +TIME_ITER= 401 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 0 +CONV_STARTITER= 0 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -245,11 +245,11 @@ MESH_FILENAME= mesh_NACA0012_inv.su2 MESH_FORMAT= SU2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -258,13 +258,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 1000 @@ -277,4 +277,6 @@ WRT_CON_FREQ= 1 % % Writing convergence history frequency (dual time, only written to screen) WRT_CON_FREQ_DUALTIME= 1 - +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/harmonic_balance/HB.cfg b/TestCases/harmonic_balance/HB.cfg index fcfcfd2dec93..69d14cdc22ef 100644 --- a/TestCases/harmonic_balance/HB.cfg +++ b/TestCases/harmonic_balance/HB.cfg @@ -28,7 +28,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= HARMONIC_BALANCE +TIME_MARCHING= HARMONIC_BALANCE % % Number of time instances (Zones) TIME_INSTANCES= 3 @@ -37,7 +37,7 @@ TIME_INSTANCES= 3 HB_PERIOD= 0.05891103435003335 % % List of frequencies to be resolved for harmonic balance method -OMEGA_HB = [0,106.69842,-106.69842] +OMEGA_HB = (0,106.69842,-106.69842) % % Time Step for dual time stepping simulations (s) %UNST_TIMESTEP= 0.0023555025613149587 @@ -115,7 +115,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 70000 +ITER= 70000 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -257,24 +257,19 @@ DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -288,25 +283,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -315,7 +310,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg b/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg index f5e33d9f4b86..e2bb5479cdbd 100644 --- a/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg +++ b/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION,FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -28,7 +28,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= HARMONIC_BALANCE +TIME_MARCHING= HARMONIC_BALANCE % % Number of time instances (Zones) TIME_INSTANCES= 7 @@ -40,7 +40,7 @@ HB_PRECONDITION= YES HB_PERIOD= 0.057465 % % List of frequencies to be resolved for harmonic balance method -OMEGA_HB = [0,109.339, 218.678, 328.017,-109.339, -218.678, -328.017] +OMEGA_HB = (0,109.339, 218.678, 328.017,-109.339, -218.678, -328.017) % % % Type of mesh motion (NONE, FLUTTER, RIGID_ROTATION, RIGID_PITCHING) @@ -114,7 +114,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 70000 +ITER= 70000 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -200,24 +200,19 @@ CFL_REDUCTION_TURB= 0.4 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -231,22 +226,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 500 diff --git a/TestCases/hom_euler/InviscidVortex/2D/Quad32X32_nPoly4/InviscidVortex.cfg b/TestCases/hom_euler/InviscidVortex/2D/Quad32X32_nPoly4/InviscidVortex.cfg index 94dabe2acf58..b56e2dbc5d5d 100644 --- a/TestCases/hom_euler/InviscidVortex/2D/Quad32X32_nPoly4/InviscidVortex.cfg +++ b/TestCases/hom_euler/InviscidVortex/2D/Quad32X32_nPoly4/InviscidVortex.cfg @@ -61,16 +61,18 @@ REF_DIMENSIONALIZATION= DIMENSIONAL % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -%UNSTEADY_SIMULATION= NO -UNSTEADY_SIMULATION= TIME_STEPPING +%TIME_MARCHING= NO +TIME_MARCHING= TIME_STEPPING % % Time Step for time accurate simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 2.0e-3 +TIME_STEP= 2.0e-3 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.0 @@ -122,24 +124,19 @@ TIME_DISCRE_FLOW= CLASSICAL_RK4_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 15 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -152,27 +149,27 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -%SOLUTION_FLOW_FILENAME= solution_flow.dat -SOLUTION_FLOW_FILENAME= SolInterpolFrom3rdOrder.dat +%SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= SolInterpolFrom3rdOrder.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY -%OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV +%TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -181,7 +178,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/InviscidVortex/3D/nPoly2_Tets/InviscidVortex.cfg b/TestCases/hom_euler/InviscidVortex/3D/nPoly2_Tets/InviscidVortex.cfg index 2e3067078061..7e135cd553cc 100644 --- a/TestCases/hom_euler/InviscidVortex/3D/nPoly2_Tets/InviscidVortex.cfg +++ b/TestCases/hom_euler/InviscidVortex/3D/nPoly2_Tets/InviscidVortex.cfg @@ -60,16 +60,18 @@ REF_DIMENSIONALIZATION= DIMENSIONAL % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -%UNSTEADY_SIMULATION= NO -UNSTEADY_SIMULATION= TIME_STEPPING +%TIME_MARCHING= NO +TIME_MARCHING= TIME_STEPPING % % Time Step for time accurate simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 2.0e-3 +TIME_STEP= 2.0e-3 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.0 @@ -121,24 +123,19 @@ TIME_DISCRE_FLOW= CLASSICAL_RK4_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 15 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -151,27 +148,27 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -%SOLUTION_FLOW_FILENAME= solution_flow.dat -SOLUTION_FLOW_FILENAME= SolInterpolFrom3rdOrder.dat +%SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= SolInterpolFrom3rdOrder.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY -%OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV +%TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -180,7 +177,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/InviscidVortex/3D/nPoly4_Tets/InviscidVortex.cfg b/TestCases/hom_euler/InviscidVortex/3D/nPoly4_Tets/InviscidVortex.cfg index b7e7c6267aef..ca2505d08176 100644 --- a/TestCases/hom_euler/InviscidVortex/3D/nPoly4_Tets/InviscidVortex.cfg +++ b/TestCases/hom_euler/InviscidVortex/3D/nPoly4_Tets/InviscidVortex.cfg @@ -60,16 +60,18 @@ REF_DIMENSIONALIZATION= DIMENSIONAL % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -%UNSTEADY_SIMULATION= NO -UNSTEADY_SIMULATION= TIME_STEPPING +%TIME_MARCHING= NO +TIME_MARCHING= TIME_STEPPING % % Time Step for time accurate simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 1.0e-3 +TIME_STEP= 1.0e-3 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.0 @@ -121,24 +123,19 @@ TIME_DISCRE_FLOW= CLASSICAL_RK4_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 15 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -151,27 +148,27 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -%SOLUTION_FLOW_FILENAME= solution_flow.dat -SOLUTION_FLOW_FILENAME= SolInterpolFrom3rdOrder.dat +%SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= SolInterpolFrom3rdOrder.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY -%OUTPUT_FORMAT= PARAVIEW +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV +%TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -180,7 +177,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg b/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg index 3871e3e9c4fd..11271e71d4b1 100644 --- a/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg +++ b/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg @@ -119,24 +119,19 @@ TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -149,25 +144,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -176,7 +171,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg index 70497a4acc92..5f851a8a38c9 100644 --- a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg +++ b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg @@ -23,6 +23,9 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO %RESTART_SOL= YES +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -89,7 +92,7 @@ MARKER_DESIGNING = ( airfoil ) CFL_NUMBER= 0.1 % % Number of total iterations -EXT_ITER= 40000 +ITER= 40000 % % Runge-Kutta alpha coefficients %RK_ALPHA_COEFF= ( 0.25, 0.166667, 0.375, 0.5 , 1.0 ) @@ -122,24 +125,19 @@ TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -152,26 +150,26 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -%SOLUTION_FLOW_FILENAME= solution_flow.dat -SOLUTION_FLOW_FILENAME= solution_flow.dat_FullyConverged +%SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat_FullyConverged % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -180,7 +178,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -190,3 +188,6 @@ WRT_SOL_FREQ= 50000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT = (RMS_DENSITY, RMS_MOMENTUM-X, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg index 081439805c06..9749842c6ecb 100644 --- a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg +++ b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg @@ -25,6 +25,9 @@ MATH_PROBLEM= DIRECT RESTART_SOL= YES WRT_BINARY_RESTART= NO READ_BINARY_RESTART= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -91,7 +94,7 @@ MARKER_DESIGNING = ( airfoil ) CFL_NUMBER= 0.1 % % Number of total iterations -EXT_ITER= 11 +ITER= 11 % % Runge-Kutta alpha coefficients %RK_ALPHA_COEFF= ( 0.25, 0.166667, 0.375, 0.5 , 1.0 ) @@ -127,24 +130,19 @@ TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -157,25 +155,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_naca0012.dat +SOLUTION_FILENAME= solution_flow_naca0012.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -184,7 +182,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -194,3 +192,6 @@ WRT_SOL_FREQ= 50000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT=(INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb.cfg b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb.cfg index 9c83b92655dd..3da9645c1387 100644 --- a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb.cfg +++ b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb_WallBC.cfg b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb_WallBC.cfg index afec6f58eead..a7e8b4fe01f0 100644 --- a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb_WallBC.cfg +++ b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly3/Ringleb_WallBC.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb.cfg b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb.cfg index 8ddd4c4fdd56..855979cb5516 100644 --- a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb.cfg +++ b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb_WallBC.cfg b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb_WallBC.cfg index fb134a9ca303..d839246cbc36 100644 --- a/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb_WallBC.cfg +++ b/TestCases/hom_euler/Ringleb/Quad100X50_nPoly4/Ringleb_WallBC.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb.cfg b/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb.cfg index eae4f69fa73c..38ec92d1671b 100644 --- a/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb.cfg +++ b/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb_WallBC.cfg b/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb_WallBC.cfg index 1a7a62803bf0..a0bbae44e929 100644 --- a/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb_WallBC.cfg +++ b/TestCases/hom_euler/Ringleb/Quad200X100_nPoly4/Ringleb_WallBC.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb.cfg b/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb.cfg index 09df659325c9..471c101e3e53 100644 --- a/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb.cfg +++ b/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg b/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg index 4878c39c5619..7366214878a7 100644 --- a/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg +++ b/TestCases/hom_euler/Ringleb/Quad50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb.cfg b/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb.cfg index 272a4428553a..9bf0517eee8a 100644 --- a/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb.cfg +++ b/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb_WallBC.cfg b/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb_WallBC.cfg index fd1d2b042673..abd0968dc1ab 100644 --- a/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb_WallBC.cfg +++ b/TestCases/hom_euler/Ringleb/QuadDominantUnstr100X100_HalfGeom_nPoly4/Ringleb_WallBC.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb.cfg b/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb.cfg index 214fbd397519..9afcb47a579f 100644 --- a/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb.cfg +++ b/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg b/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg index cf2f2f4d9968..dd3fc378315d 100644 --- a/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg +++ b/TestCases/hom_euler/Ringleb/Triangle50X50_HalfGeom_nPoly4/Ringleb_WallBC.cfg @@ -116,24 +116,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -146,25 +141,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -173,7 +168,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg b/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg index 017eda5b029b..7a4b80ee8040 100644 --- a/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg +++ b/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg @@ -119,24 +119,19 @@ TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -149,25 +144,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -176,7 +171,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg b/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg index 51319a0755fb..ba18af864761 100644 --- a/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg +++ b/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg @@ -121,24 +121,19 @@ TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -152,26 +147,26 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -%SOLUTION_FLOW_FILENAME= solution_flow.dat -SOLUTION_FLOW_FILENAME= SolInterpolFrom3rdOrder.dat +%SOLUTION_FILENAME= solution_flow.dat +SOLUTION_FILENAME= SolInterpolFrom3rdOrder.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -180,7 +175,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg index 59698dc3bcae..a11a3dee05d5 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg @@ -129,24 +129,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -159,25 +154,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -186,7 +181,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg index e1e3708fe809..262c73f661b3 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg @@ -122,24 +122,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -152,25 +147,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -179,7 +174,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg index 6d2fe8bb84e1..73a6d673507b 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg @@ -129,24 +129,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -159,25 +154,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -186,7 +181,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg index 284b231b27b0..c9d6b0980fef 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg @@ -122,24 +122,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -152,25 +147,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -179,7 +174,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg index 2f22b854c59f..51dc50d8194f 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg @@ -129,24 +129,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -159,25 +154,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -186,7 +181,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg index 9f6ea6fd0461..d8fa1691154f 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg @@ -122,24 +122,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -152,25 +147,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -179,7 +174,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg b/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg index 71364fd9fca6..aa39f761f85b 100644 --- a/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg +++ b/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg @@ -22,6 +22,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -90,7 +93,7 @@ MARKER_DESIGNING = ( Cylinder ) CFL_NUMBER= 0.05 % % Number of total iterations -EXT_ITER= 11 +ITER= 11 % % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) @@ -120,24 +123,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -150,25 +148,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -177,7 +175,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -187,3 +185,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg b/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg index 201970246150..3592e124de09 100644 --- a/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg +++ b/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -93,7 +96,7 @@ MARKER_MONITORING= ( wall ) CFL_NUMBER= 1.0 % % Number of total iterations -EXT_ITER= 26 +ITER= 26 % % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) @@ -128,24 +131,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -159,25 +157,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -186,7 +184,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -196,3 +194,7 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) + diff --git a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg index d03f5fcf1313..1c71ce6e99b0 100644 --- a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg +++ b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg @@ -23,6 +23,8 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO %RESTART_SOL= YES +% New singlezone driver +SINGLEZONE_DRIVER=YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -91,7 +93,7 @@ MARKER_DESIGNING = ( Sphere ) CFL_NUMBER= 0.15 % % Number of total iterations -EXT_ITER= 11 +ITER= 11 % % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) @@ -121,24 +123,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -151,26 +148,26 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat -%SOLUTION_FLOW_FILENAME= InterpolFromNPoly1.dat +SOLUTION_FILENAME= restart_flow.dat +%SOLUTION_FILENAME= InterpolFromNPoly1.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -179,7 +176,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -189,3 +186,6 @@ WRT_SOL_FREQ= 2500 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg index 097e826fae2c..6a2b0a32da36 100644 --- a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg +++ b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg @@ -22,6 +22,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) %RESTART_SOL= YES +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -86,15 +89,16 @@ MARKER_DESIGNING = ( Sphere ) % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -UNSTEADY_SIMULATION= TIME_STEPPING +TIME_MARCHING= TIME_STEPPING % % Time Step for time accurate simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 2.0e-6 +TIME_STEP= 2.0e-6 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.15 @@ -105,7 +109,7 @@ UNST_CFL_NUMBER= 0.15 CFL_NUMBER= 0.125 % % Number of total iterations -EXT_ITER= 11 +TIME_ITER= 11 % ------------------ FEM FLOW NUMERICAL METHOD DEFINITION ----------------------% % @@ -143,24 +147,19 @@ LEVELS_TIME_ACCURATE_LTS= 4 % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -173,25 +172,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -200,7 +199,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -213,3 +212,7 @@ WRT_SOL_FREQ_DUALTIME= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT = (TIME_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) + diff --git a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg index d75fbc5ddb96..33e73e50c120 100644 --- a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg +++ b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg @@ -22,7 +22,10 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= YES - +% +RESTART_ITER=1 +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -89,15 +92,17 @@ MARKER_DESIGNING = ( Cylinder ) % ------------------------- UNSTEADY SIMULATION -------------------------------% % +% Enable time dependent simulation +TIME_DOMAIN=YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -UNSTEADY_SIMULATION= TIME_STEPPING +TIME_MARCHING= TIME_STEPPING % % Time Step for time accurate simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 1e-6 +TIME_STEP= 1e-6 % -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.05 @@ -108,7 +113,7 @@ UNST_CFL_NUMBER= 0.05 CFL_NUMBER= 0.125 % % Number of total iterations -EXT_ITER= 11 +TIME_ITER= 12 % ------------------ FEM FLOW NUMERICAL METHOD DEFINITION ----------------------% % @@ -135,24 +140,19 @@ TIME_DISCRE_FLOW= CLASSICAL_RK4_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -165,25 +165,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -192,7 +192,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -205,3 +205,6 @@ WRT_SOL_FREQ_DUALTIME= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg index aef8cf2be776..c09ea945ff2a 100644 --- a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg +++ b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg @@ -22,6 +22,11 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= YES +% +RESTART_ITER= 1 + +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -89,15 +94,18 @@ MARKER_DESIGNING = ( Cylinder ) % ------------------------- UNSTEADY SIMULATION -------------------------------% % +% Time dependent problem +TIME_DOMAIN= YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -UNSTEADY_SIMULATION= TIME_STEPPING +TIME_MARCHING= TIME_STEPPING % % Time Step for time accurate simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 1.6e-5 +TIME_STEP= 1.6e-5 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 +MAX_TIME= 50.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.05 @@ -108,7 +116,7 @@ UNST_CFL_NUMBER= 0.05 CFL_NUMBER= 0.125 % % Number of total iterations -EXT_ITER= 11 +TIME_ITER= 11 % ------------------ FEM FLOW NUMERICAL METHOD DEFINITION ----------------------% % @@ -146,24 +154,19 @@ LEVELS_TIME_ACCURATE_LTS= 8 % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -176,25 +179,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -203,7 +206,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -216,3 +219,7 @@ WRT_SOL_FREQ_DUALTIME= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) + diff --git a/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg b/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg index e83cfb709f42..2f536d21b528 100644 --- a/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg +++ b/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg @@ -21,6 +21,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -57,24 +60,6 @@ REF_LENGTH= 1.0 % Reference area for force coefficients (0 implies automatic calculation) REF_AREA= 1.0 -% ------------------------- UNSTEADY SIMULATION -------------------------------% -% -% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, -% DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= NO -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 1E-2 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Unsteady Courant-Friedrichs-Lewy number of the finest grid -UNST_CFL_NUMBER= 0.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 50 - % ----------------------- BOUNDARY CONDITION DEFINITION -----------------------% % % Euler wall boundary marker(s) (NONE = no marker) @@ -113,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 9999 +ITER= 9999 % -------------------------- MULTIGRID PARAMETERS -----------------------------% % @@ -166,24 +151,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 7 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 50 +CONV_CAUCHY_ELEMS= 50 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -194,25 +174,29 @@ MESH_FILENAME= mesh_NACA0012_5deg_6814.su2 MESH_FORMAT= SU2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 200 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, LIFT, DRAG) + diff --git a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg index 7434b63a4ff9..e11c88be9756 100644 --- a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg +++ b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg @@ -20,6 +20,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -169,13 +172,11 @@ CONV_NUM_METHOD_FLOW= FDS % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 9999 +ITER= 9999 % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -189,11 +190,11 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -202,14 +203,17 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 +% +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, LIFT, DRAG) diff --git a/TestCases/incomp_navierstokes/bend/lam_bend.cfg b/TestCases/incomp_navierstokes/bend/lam_bend.cfg index 2cf493dc501d..3b7206b08a79 100755 --- a/TestCases/incomp_navierstokes/bend/lam_bend.cfg +++ b/TestCases/incomp_navierstokes/bend/lam_bend.cfg @@ -192,26 +192,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 11 -% -% Convergence criteria (CAUCHY, RESIDUAL) -% -CONV_CRITERIA= RESIDUAL -% -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 +ITER= 11 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -225,25 +218,25 @@ MESH_FORMAT= CGNS MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -255,7 +248,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -274,3 +267,5 @@ WRT_CON_FREQ_DUALTIME= 10 % % Output residual values in the solution files WRT_RESIDUALS= NO +% +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, LIFT, DRAG) diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 5ddd44ca9bf5..46b76fcb8658 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -23,6 +23,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% new singlezone driver +SINGLEZONE_DRIVER=YES % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -135,7 +138,7 @@ MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -200,24 +203,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -231,25 +229,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +256,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -268,6 +266,9 @@ WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, LIFT, DRAG) % ----------------------- GEOMETRY EVALUATION PARAMETERS ----------------------% % diff --git a/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg index 91849624fa92..0ae6cd276a85 100644 --- a/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New Singlezone driver +SINGLEZONE_DRIVER= YES % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -53,25 +56,6 @@ REF_LENGTH= 1.0 % % Reference area for force coefficients (0 implies automatic calculation) REF_AREA= 1.0 - -% ------------------------- UNSTEADY SIMULATION -------------------------------% -% -% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, -% DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= NO -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 -% -% Unsteady Courant-Friedrichs-Lewy number of the finest grid -UNST_CFL_NUMBER= 0.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 - % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Navier-Stokes wall boundary marker(s) (NONE = no marker) @@ -105,7 +89,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 5000 +ITER= 5000 % % Coefficient for the Venkat's limiter. A larger values decrease the extent of limiting, % values approaching zero cause lower-order approximation to the solution. @@ -162,24 +146,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -190,25 +169,29 @@ MESH_FILENAME= mesh_cylinder_lam.su2 MESH_FORMAT= SU2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, LIFT, DRAG) + diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index 8158fb3de520..bf6242eeb176 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -148,7 +151,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 10000.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 1000 +ITER= 1000 % -------------------------- MULTIGRID PARAMETERS -----------------------------% % @@ -227,24 +230,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -255,14 +253,14 @@ MESH_FILENAME= mesh_cylinder_lam.su2 MESH_FORMAT= SU2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -271,13 +269,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -289,7 +287,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -299,3 +297,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TEMPERATURE, LIFT, DRAG) diff --git a/TestCases/incomp_rans/AhmedBody/turb_ahmed.cfg b/TestCases/incomp_rans/AhmedBody/turb_ahmed.cfg index 9afaac3c875f..9d61976d2b07 100644 --- a/TestCases/incomp_rans/AhmedBody/turb_ahmed.cfg +++ b/TestCases/incomp_rans/AhmedBody/turb_ahmed.cfg @@ -60,27 +60,6 @@ REF_LENGTH= 1.044 % Reference area for force coefficients (0 implies automatic calculation) REF_AREA= 0.677 -% ------------------------- UNSTEADY SIMULATION -------------------------------% -% -% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, -% DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= NO -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50.0 -% -% Unsteady Courant-Friedrichs-Lewy number of the finest grid -UNST_CFL_NUMBER= 0.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 -% -% Iteration number to begin unsteady restarts -UNST_RESTART_ITER= 0 - % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) @@ -300,26 +279,20 @@ FFD_ITERATIONS= 500 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -333,25 +306,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -363,7 +336,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/incomp_rans/naca0012/naca0012.cfg b/TestCases/incomp_rans/naca0012/naca0012.cfg index 61b4c3530a05..d92999b969e8 100644 --- a/TestCases/incomp_rans/naca0012/naca0012.cfg +++ b/TestCases/incomp_rans/naca0012/naca0012.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -25,12 +25,15 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ------------------------- UNSTEADY SIMULATION -------------------------------% % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= NO +TIME_MARCHING= NO % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -91,7 +94,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 2500 +ITER= 2500 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -184,24 +187,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -215,25 +213,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -242,7 +240,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -252,3 +250,7 @@ WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_NU_TILDE, LIFT, DRAG) + diff --git a/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg b/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg index 7f26864c322a..90c94d7edd3d 100644 --- a/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg +++ b/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST_SUST @@ -30,7 +30,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= NO +TIME_MARCHING= NO % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -91,7 +91,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 2500 +ITER= 2500 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -184,24 +184,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -215,25 +210,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -242,7 +237,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -252,3 +247,7 @@ WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) + diff --git a/TestCases/mms/dg_navierstokes/lam_mms_dg.cfg b/TestCases/mms/dg_navierstokes/lam_mms_dg.cfg index 2aa983cd4cc4..50212e85eb9f 100644 --- a/TestCases/mms/dg_navierstokes/lam_mms_dg.cfg +++ b/TestCases/mms/dg_navierstokes/lam_mms_dg.cfg @@ -86,7 +86,7 @@ MARKER_CUSTOM= ( BottomBoundary, LeftBoundary, RightBoundary, TopBoundary ) CFL_NUMBER= 0.03 % % Number of total iterations -EXT_ITER= 101 +ITER= 101 % % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) @@ -117,24 +117,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -147,25 +142,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -174,7 +169,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -184,3 +179,6 @@ WRT_SOL_FREQ= 25000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/mms/dg_navierstokes_3d/lam_mms_dg_3d.cfg b/TestCases/mms/dg_navierstokes_3d/lam_mms_dg_3d.cfg index 1d9211069f92..c310caa6aeb6 100644 --- a/TestCases/mms/dg_navierstokes_3d/lam_mms_dg_3d.cfg +++ b/TestCases/mms/dg_navierstokes_3d/lam_mms_dg_3d.cfg @@ -99,7 +99,7 @@ CFL_NUMBER= 0.2 %CFL_NUMBER=1.e-30 % % Number of total iterations -EXT_ITER= 101 +ITER= 101 % % Runge-Kutta alpha coefficients RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) @@ -135,24 +135,19 @@ TIME_DISCRE_FEM_FLOW= RUNGE-KUTTA_EXPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -165,25 +160,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -192,7 +187,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -202,3 +197,6 @@ WRT_SOL_FREQ= 25000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/mms/dg_ringleb/ringleb_dg.cfg b/TestCases/mms/dg_ringleb/ringleb_dg.cfg index a637be42dba6..de820fac4f29 100644 --- a/TestCases/mms/dg_ringleb/ringleb_dg.cfg +++ b/TestCases/mms/dg_ringleb/ringleb_dg.cfg @@ -95,8 +95,8 @@ CFL_NUMBER= 1.0 %CFL_NUMBER= 0.2 % For AUSM % % Number of total iterations -EXT_ITER= 101 -%EXT_ITER= 1 +ITER= 101 +%ITER= 1 % % Runge-Kutta alpha coefficients %RK_ALPHA_COEFF= ( 0.25, 0.166667, 0.375, 0.5, 1.0 ) @@ -134,24 +134,19 @@ USE_LUMPED_MASSMATRIX_DGFEM= YES % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -164,25 +159,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= PARAVIEW_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -191,7 +186,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -201,3 +196,6 @@ WRT_SOL_FREQ= 5000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg index 2701868c35eb..5beb1aff6534 100755 --- a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg +++ b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg @@ -87,7 +87,7 @@ MAX_DELTA_TIME= 1E30 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 9999 +ITER= 9999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -161,24 +161,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 15 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -192,25 +187,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -219,7 +214,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -229,3 +224,6 @@ WRT_SOL_FREQ= 50 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, LIFT, DRAG) diff --git a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg index 0645b340a060..96012707b413 100755 --- a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg +++ b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg @@ -105,7 +105,7 @@ MAX_DELTA_TIME= 1E30 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 9999 +ITER= 9999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -183,24 +183,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 15 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -214,25 +209,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -241,7 +236,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -251,3 +246,6 @@ WRT_SOL_FREQ= 50 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_VELOCITY-X, LIFT, DRAG) diff --git a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg index 233b8e3dd5bc..788772eb8238 100755 --- a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg +++ b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg @@ -122,7 +122,7 @@ MAX_DELTA_TIME= 1E30 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 9999 +ITER= 9999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -200,24 +200,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 15 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -14 +CONV_RESIDUAL_MINVAL= -14 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -231,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -268,3 +263,6 @@ WRT_SOL_FREQ= 50 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/moving_wall/cavity/lam_cavity.cfg b/TestCases/moving_wall/cavity/lam_cavity.cfg index a904e1329a40..e802c60b9c41 100644 --- a/TestCases/moving_wall/cavity/lam_cavity.cfg +++ b/TestCases/moving_wall/cavity/lam_cavity.cfg @@ -24,7 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -103,7 +105,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -168,24 +170,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -199,25 +196,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -226,7 +223,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -236,3 +233,7 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) + diff --git a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg index 93b9c97b190c..98f66ba40237 100644 --- a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg +++ b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -44,22 +47,6 @@ REYNOLDS_NUMBER= 200.0 % % Reynolds length (in meters) REYNOLDS_LENGTH= 1.0 - -% ------------------------- UNSTEADY SIMULATION -------------------------------% -% -% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, -% DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= NO -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.01 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 1.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 - % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, @@ -122,7 +109,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -200,24 +187,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-7 +CONV_CAUCHY_EPS= 1E-7 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -231,25 +213,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -258,7 +240,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -268,3 +250,6 @@ WRT_SOL_FREQ= 100 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg b/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg index 6bdf068a0207..2a5adcd4cc9f 100644 --- a/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg +++ b/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg @@ -28,8 +28,7 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO -ITER = 10 - +OUTPUT_FILES=(RESTART_ASCII) % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -96,7 +95,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 10 +ITER= 10 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -261,26 +260,20 @@ FFD_FIX_K= (15) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -294,25 +287,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -321,7 +314,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -340,7 +333,7 @@ WRT_CON_FREQ_DUALTIME= 10 % % Output rind layers in the solution files WRT_HALO= NO - +HISTORY_OUTPUT=(ITER, RMS_RES, AERO_COEFF, D_AERO_COEFF) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref b/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref index 17e06a9de71b..9b26b8580cf2 100644 --- a/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref +++ b/TestCases/multiple_ffd/naca0012/of_grad_directdiff.dat.ref @@ -1,3 +1,3 @@ -VARIABLES="VARIABLE" , "MASS_FLOW_IN" , "MOMENT_Z" , "FLOW_ANGLE_OUT", "MASS_FLOW_OUT" , "FLOW_ANGLE_IN" , "FORCE_Z" , "FORCE_Y" , "FORCE_X" , "TOTAL_EFFICIENCY", "TOTAL_STATIC_EFFICIENCY", "PRESSURE_RATIO", "EFFICIENCY" , "DRAG" , "LIFT" , "TOTAL_ENTHALPY_OUT", "TOTAL_PRESSURE_LOSS", "MOMENT_Y" , "MOMENT_X" , "SIDEFORCE" , "ENTHALPY_OUT" , "KINETIC_ENERGY_LOSS", "CUSTOM_OBJFUNC", "HEAT" , "MAX_HEAT" , "SURFACE_UNIFORMITY", "SURFACE_SECONDARY", "SURFACE_MOM_DISTORTION", "SURFACE_SECOND_OVER_UNIFORM", "SURFACE_PRESSURE_DROP" - 0 , 0.0 , 0.002242589 , 0.0 , 0.0 , 0.0 , 0.0 , 0.144713069 , 0.0592115615 , 0.0 , 0.0 , 0.0 , -0.396142792 , 0.0623543697 , 0.143386938 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 - 1 , 0.0 , -0.0122560782 , 0.0 , 0.0 , 0.0 , 0.0 , 0.321620498 , -0.0843395283 , 0.0 , 0.0 , 0.0 , 10.1834409 , -0.0773033435 , 0.323383818 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 +VARIABLES="VARIABLE" , "DRAG" , "EFFICIENCY" , "FORCE_X" , "FORCE_Y" , "FORCE_Z" , "LIFT" , "MOMENT_X" , "MOMENT_Y" , "MOMENT_Z" , "SIDEFORCE" + 0 , 0.06235436973 , -0.3961427924 , 0.05921156151 , 0.1447130695 , 0.0 , 0.1433869383 , 0.0 , 0.0 , 0.002242588997 , 0.0 + 1 , -0.07730334353 , 10.18344094 , -0.08433952825 , 0.3216204983 , 0.0 , 0.3233838184 , 0.0 , 0.0 , -0.01225607819 , 0.0 diff --git a/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg b/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg index 908370045391..7385fa9b9d73 100644 --- a/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg +++ b/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg @@ -25,6 +25,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -89,7 +92,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -159,24 +162,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -190,25 +188,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -217,7 +215,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -227,3 +225,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/navierstokes/cylinder/lam_cylinder.cfg b/TestCases/navierstokes/cylinder/lam_cylinder.cfg index a92b3a9f4e46..51c3909dd8fa 100644 --- a/TestCases/navierstokes/cylinder/lam_cylinder.cfg +++ b/TestCases/navierstokes/cylinder/lam_cylinder.cfg @@ -24,7 +24,10 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER= YES +% % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -88,7 +91,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -154,24 +157,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -185,25 +183,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -212,7 +210,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -222,3 +220,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/navierstokes/flatplate/lam_flatplate.cfg b/TestCases/navierstokes/flatplate/lam_flatplate.cfg index fbd57866de1d..f76540334c22 100644 --- a/TestCases/navierstokes/flatplate/lam_flatplate.cfg +++ b/TestCases/navierstokes/flatplate/lam_flatplate.cfg @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -103,7 +106,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 999999 +ITER= 999999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -171,24 +174,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -202,25 +200,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -229,7 +227,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -239,3 +237,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/navierstokes/naca0012/lam_NACA0012.cfg b/TestCases/navierstokes/naca0012/lam_NACA0012.cfg index 7f590cfcc458..7dcb0ff6e1c7 100644 --- a/TestCases/navierstokes/naca0012/lam_NACA0012.cfg +++ b/TestCases/navierstokes/naca0012/lam_NACA0012.cfg @@ -149,24 +149,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -180,25 +175,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -207,7 +202,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index fd4e26e965e9..c09d8828c46d 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -30,7 +30,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO - +% +% New singlezone driver +SINGLEZONE_DRIVER =YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -153,7 +155,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -198,24 +200,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 % @@ -229,25 +226,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -256,7 +253,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -266,3 +263,6 @@ WRT_SOL_FREQ= 500 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT=(INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg index ae4912ff6ddc..14150daad8b7 100644 --- a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg @@ -27,6 +27,9 @@ RESTART_SOL= YES % % Discard the restart metadata (iteration numbers) DISCARD_INFILES= YES +% +% New singlezone output +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -161,7 +164,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 10000.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -229,24 +232,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION ----------------------.su2 % @@ -260,25 +258,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_profile.dat +SOLUTION_FILENAME= solution_flow_profile.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -287,7 +285,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -297,3 +295,6 @@ WRT_SOL_FREQ= 25 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT=(INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/nicf/LS89/turb_SA_PR.cfg b/TestCases/nicf/LS89/turb_SA_PR.cfg index 305f03f4da97..54d4278fc6a4 100644 --- a/TestCases/nicf/LS89/turb_SA_PR.cfg +++ b/TestCases/nicf/LS89/turb_SA_PR.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -174,7 +177,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 5000 +ITER= 5000 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -255,24 +258,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -286,25 +284,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -313,7 +311,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -323,3 +321,6 @@ WRT_SOL_FREQ= 500 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/nicf/LS89/turb_SST_PR.cfg b/TestCases/nicf/LS89/turb_SST_PR.cfg index 030cd5c97c5f..d0551ce250fc 100644 --- a/TestCases/nicf/LS89/turb_SST_PR.cfg +++ b/TestCases/nicf/LS89/turb_SST_PR.cfg @@ -24,6 +24,8 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -174,7 +176,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 5000 +ITER= 5000 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -255,24 +257,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -286,25 +283,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -313,7 +310,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -323,3 +320,7 @@ WRT_SOL_FREQ= 500 % % Writing convergence history frequency WRT_CON_FREQ= 1 + +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/TestCases/nicf/edge/edge_PPR.cfg b/TestCases/nicf/edge/edge_PPR.cfg index e24166dbd4ef..82abf05b0582 100644 --- a/TestCases/nicf/edge/edge_PPR.cfg +++ b/TestCases/nicf/edge/edge_PPR.cfg @@ -20,6 +20,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES %---------------------- REFERENCE VALUE DEFINITION ---------------------------% @@ -107,7 +110,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 500 +ITER= 500 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -175,24 +178,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -206,25 +204,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -233,7 +231,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -243,3 +241,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/nicf/edge/edge_VW.cfg b/TestCases/nicf/edge/edge_VW.cfg index 25cbcc5a5538..7d695f3b0f00 100644 --- a/TestCases/nicf/edge/edge_VW.cfg +++ b/TestCases/nicf/edge/edge_VW.cfg @@ -20,6 +20,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES %---------------------- REFERENCE VALUE DEFINITION ---------------------------% @@ -107,7 +110,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 500 +ITER= 500 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -175,24 +178,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 12 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -206,25 +204,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -233,7 +231,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -243,3 +241,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg index 1a200fcbaf31..ef13c33b0cf1 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg @@ -97,7 +97,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER=1 +ITER=1 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -218,14 +218,12 @@ MARKER_ANALYZE_AVERAGE = AREA % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -11 +CONV_RESIDUAL_MINVAL= -11 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -239,25 +237,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -266,7 +264,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -282,6 +280,8 @@ WRT_BINARY_RESTART = NO % % Read binary restart files READ_BINARY_RESTART = NO +% +OUTPUT_FILES= (RESTART_ASCII, PARAVIEW, SURFACE_CSV) % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % @@ -416,3 +416,4 @@ OPT_BOUND_LOWER= -0.1 % Optimization design variables, separated by semicolons DEFINITION_DV= (19, 1.0| lower | MAIN_BOX, 3,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 4,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 5,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 6,0,0,1.0) +HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF) diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg index 925580f146e6..0e64eae3a2d6 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg @@ -98,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER=1 +ITER=1 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -219,14 +219,12 @@ MARKER_ANALYZE_AVERAGE = AREA % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -11 +CONV_RESIDUAL_MINVAL= -11 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -240,25 +238,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -267,7 +265,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -283,6 +281,9 @@ WRT_BINARY_RESTART = NO % % Read binary restart files READ_BINARY_RESTART = NO +% +% Output files +OUTPUT_FILES = (RESTART_ASCII, PARAVIEW, SURFACE_CSV) % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % @@ -417,3 +418,4 @@ OPT_BOUND_LOWER= -0.1 % Optimization design variables, separated by semicolons DEFINITION_DV= (19, 1.0| lower | MAIN_BOX, 3,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 4,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 5,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 6,0,0,1.0) +HISTORY_OUTPUT=(ITER, RMS_RES, AERO_COEFF, FLOW_COEFF, COMBO) diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg index dc9125836d5d..1515dec83ae3 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg @@ -98,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER=1 +ITER=1 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -219,14 +219,12 @@ MARKER_ANALYZE_AVERAGE = AREA % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -11 +CONV_RESIDUAL_MINVAL= -11 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -240,25 +238,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -267,7 +265,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -283,6 +281,9 @@ WRT_BINARY_RESTART = NO % % Read binary restart files READ_BINARY_RESTART = NO +% +% Output files +OUTPUT_FILES= (RESTART_ASCII, PARAVIEW, SURFACE_CSV) % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % @@ -417,3 +418,4 @@ OPT_BOUND_LOWER= -0.1 % Optimization design variables, separated by semicolons DEFINITION_DV= (19, 1.0| lower | MAIN_BOX, 3,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 4,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 5,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 6,0,0,1.0) +HISTORY_OUTPUT=(ITER, RMS_RES, AERO_COEFF, FLOW_COEFF, COMBO) diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg index 35719d323339..c2f05873f3ab 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg @@ -100,7 +100,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER=1 +ITER=1 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -221,14 +221,12 @@ MARKER_ANALYZE_AVERAGE = AREA % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -11 +CONV_RESIDUAL_MINVAL= -11 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -242,25 +240,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -269,7 +267,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -419,3 +417,4 @@ OPT_BOUND_LOWER= -0.1 % Optimization design variables, separated by semicolons DEFINITION_DV= (19, 1.0| lower | MAIN_BOX, 3,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 4,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 5,0,0,1.0);(19, 1.0| lower | MAIN_BOX, 6,0,0,1.0) +HISTORY_OUTPUT=(ITER, RMS_RES, AERO_COEFF, FLOW_COEFF, COMBO) diff --git a/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg b/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg index 4172724d76c0..f1ab985e9403 100644 --- a/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg +++ b/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg @@ -88,7 +88,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 2500 +ITER= 2500 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -216,26 +216,20 @@ DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -249,25 +243,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -276,7 +270,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg index 747010825348..d84ffff29aa1 100644 --- a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg +++ b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg @@ -29,19 +29,19 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0023555025613149587 +TIME_STEP= 0.0023555025613149587 % 24 steps per period: 0.0024536485013697488 % 25 steps per period: 0.0023555025613149587 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.59 +MAX_TIME= 0.59 % 10 periods: 0.5888756403287397 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 110 +INNER_ITER= 110 % % Starting direct iteration for unsteady adjoint UNST_ADJOINT_ITER= 251 @@ -138,7 +138,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -273,25 +273,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -305,25 +299,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -332,7 +326,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg index 9425a88008a7..39b739403fa5 100644 --- a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg +++ b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg @@ -43,18 +43,18 @@ FREESTREAM_TEMPERATURE= 288.15 % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.002161633860454094 +TIME_STEP= 0.002161633860454094 % 25 steps per period: 0.002161633860454094 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.541 +MAX_TIME= 0.541 % 10 periods: 0.5404084651135235 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 250 +INNER_ITER= 250 % % Direct iteration number at which to begin unsteady adjoint UNST_ADJOINT_ITER= 251 @@ -139,7 +139,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -252,25 +252,19 @@ GEO_MODE= FUNCTION % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -281,7 +275,7 @@ MESH_FILENAME= mesh_ONERAM6_inv.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -289,20 +283,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -311,7 +305,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg index d484192cfb08..86286b734805 100644 --- a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg +++ b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg @@ -108,7 +108,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -243,25 +243,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 8 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_MACH % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -274,25 +268,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -301,7 +295,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg b/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg index 71c4bad8b06b..f68661bf3596 100644 --- a/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg +++ b/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg @@ -95,7 +95,7 @@ OBJECTIVE_FUNCTION= INVERSE_DESIGN_PRESSURE CFL_NUMBER= 2.0 % % Number of total iterations -EXT_ITER= 250 +ITER= 250 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -233,24 +233,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -263,25 +258,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -290,7 +285,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg index b1bb5c8567a6..ca414bdc5c99 100644 --- a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg +++ b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg @@ -27,6 +27,9 @@ WRT_BINARY_RESTART= NO % % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO +% +% New single zone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -94,7 +97,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 250 +ITER= 250 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -240,26 +243,20 @@ DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -273,25 +270,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -300,7 +297,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -319,7 +316,12 @@ WRT_CON_FREQ_DUALTIME= 10 % % Output rind layers in the solution files WRT_HALO= NO - +% +% History output +HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF) +% +OUTPUT_FILES= (RESTART_ASCII, PARAVIEW, SURFACE_CSV) +% % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % % Available flow based objective functions or constraint functions diff --git a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg index af13e4480bdc..7c75b2c12449 100644 --- a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg +++ b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg @@ -88,7 +88,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 1000 +ITER= 1000 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -225,26 +225,20 @@ DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -13 +CONV_RESIDUAL_MINVAL= -13 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -258,25 +252,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -285,7 +279,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg index 5777d178fdd7..9a2d746347a2 100644 --- a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg +++ b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg @@ -98,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 1000 +ITER= 1000 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -209,26 +209,20 @@ GEO_MODE= FUNCTION % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 25 +CONV_STARTITER= 25 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -239,7 +233,7 @@ MESH_FILENAME= mesh_ONERAM6_inv_FFD.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -247,20 +241,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -269,7 +263,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -285,6 +279,8 @@ WRT_CON_FREQ= 1 % % Writing convergence history frequency (dual time, only written to screen) WRT_CON_FREQ_DUALTIME= 10 +% +OUTPUT_FILES=(RESTART, PARAVIEW, SURFACE_CSV) % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% % diff --git a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg index 6ffe64fc67d5..7bd0856dd6fd 100644 --- a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg +++ b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg @@ -98,7 +98,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 1000 +ITER= 1000 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -209,26 +209,20 @@ GEO_MODE= FUNCTION % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 25 +CONV_STARTITER= 25 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -239,7 +233,7 @@ MESH_FILENAME= mesh_ONERAM6_inv_FFD.su2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat @@ -247,20 +241,20 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Mesh input file format (SU2) MESH_FORMAT= SU2 % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -269,7 +263,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg b/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg index 59d718d7f79c..8119dd5f7ea3 100644 --- a/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg +++ b/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg @@ -29,20 +29,20 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0023555025613149587 +TIME_STEP= 0.0023555025613149587 % 24 steps per period: 0.0024536485013697488 % 25 steps per period: 0.0023555025613149587 % 36 steps per period: 0.0016357592286692995 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.59 +MAX_TIME= 0.59 % 10 periods: 0.5888756403287397 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 2000 +INNER_ITER= 2000 % % Direct iteration number at which to begin unsteady adjoint UNST_ADJOINT_ITER= 251 @@ -289,25 +289,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 4 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 1 +CONV_STARTITER= 1 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -321,25 +315,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= restart_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -348,7 +342,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg b/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg index 2b961a67fb18..137c4d7f1fc8 100644 --- a/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg +++ b/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg @@ -49,19 +49,19 @@ REYNOLDS_LENGTH= 0.64607 % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.002161633860454094 +TIME_STEP= 0.002161633860454094 % 25 steps per period: 0.002161633860454094 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.379 +MAX_TIME= 0.379 % 10 periods: 0.5404084651135235 % 7 periods: 0.37828592557946644 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 350 +INNER_ITER= 350 % % Direct iteration number at which to begin unsteady adjoint UNST_ADJOINT_ITER= 176 @@ -312,25 +312,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 1 +CONV_STARTITER= 1 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 50 +CONV_CAUCHY_ELEMS= 50 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -344,25 +338,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -371,7 +365,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg b/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg index 957d19d1f57d..a260161ac5cb 100644 --- a/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg +++ b/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg @@ -259,25 +259,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 1 +CONV_STARTITER= 1 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -291,25 +285,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -318,7 +312,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg b/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg index 368029becaf8..4c069c4a8731 100644 --- a/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg @@ -204,25 +204,19 @@ GEO_MODE= FUNCTION % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -236,25 +230,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -263,7 +257,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index d85f0db05581..520867292dd0 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -100,8 +100,8 @@ def main(): fixedCL_naca0012 = TestCase('fixedcl_naca0012') fixedCL_naca0012.cfg_dir = "fixed_cl/naca0012" fixedCL_naca0012.cfg_file = "inv_NACA0012.cfg" - fixedCL_naca0012.test_iter = 100 - fixedCL_naca0012.test_vals = [-2.437318, 2.967532, 0.290374, 0.019183] #last 4 columns + fixedCL_naca0012.test_iter = 10 + fixedCL_naca0012.test_vals = [-4.054559, 1.470661, 0.300113, 0.019483] #last 4 columns fixedCL_naca0012.su2_exec = "parallel_computation.py -f" fixedCL_naca0012.timeout = 1600 fixedCL_naca0012.tol = 0.00001 @@ -486,10 +486,11 @@ def main(): fem_ns_unsteady_cylinder = TestCase('fem_ns_unsteady_cylinder') fem_ns_unsteady_cylinder.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder.cfg_file = "fem_unst_cylinder.cfg" - fem_ns_unsteady_cylinder.test_iter = 10 + fem_ns_unsteady_cylinder.test_iter = 11 fem_ns_unsteady_cylinder.test_vals = [-3.558582,-3.014464,-0.038927,1.383983] #last 4 columns fem_ns_unsteady_cylinder.su2_exec = "SU2_CFD" fem_ns_unsteady_cylinder.timeout = 1600 + fem_ns_unsteady_cylinder.unsteady = True fem_ns_unsteady_cylinder.tol = 0.00001 test_list.append(fem_ns_unsteady_cylinder) @@ -497,10 +498,11 @@ def main(): fem_ns_unsteady_cylinder_ader = TestCase('fem_ns_unsteady_cylinder_ader') fem_ns_unsteady_cylinder_ader.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder_ader.cfg_file = "fem_unst_cylinder_ADER.cfg" - fem_ns_unsteady_cylinder_ader.test_iter = 10 + fem_ns_unsteady_cylinder_ader.test_iter = 11 fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000,-35.000000,-0.041003,1.391339] #last 4 columns fem_ns_unsteady_cylinder_ader.su2_exec = "SU2_CFD" fem_ns_unsteady_cylinder_ader.timeout = 1600 + fem_ns_unsteady_cylinder_ader.unsteady = True fem_ns_unsteady_cylinder_ader.tol = 0.00001 test_list.append(fem_ns_unsteady_cylinder_ader) @@ -561,7 +563,7 @@ def main(): contadj_fixed_CL_naca0012.cfg_dir = "fixed_cl/naca0012" contadj_fixed_CL_naca0012.cfg_file = "inv_NACA0012_ContAdj.cfg" contadj_fixed_CL_naca0012.test_iter = 100 - contadj_fixed_CL_naca0012.test_vals = [0.378865, -5.157403, 0.268320, -0.000149] #last 4 columns + contadj_fixed_CL_naca0012.test_vals = [0.378722, -5.157473, 0.268300, -0.000151] #last 4 columns contadj_fixed_CL_naca0012.su2_exec = "parallel_computation.py -f" contadj_fixed_CL_naca0012.timeout = 1600 contadj_fixed_CL_naca0012.tol = 0.00001 @@ -623,7 +625,7 @@ def main(): contadj_rans_naca0012_bin = TestCase('contadj_rans_naca0012_bin') contadj_rans_naca0012_bin.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012_bin.cfg_file = "turb_nasa_binary.cfg" - contadj_rans_naca0012_bin.test_iter = 20 + contadj_rans_naca0012_bin.test_iter = 18 contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] #last 4 columns contadj_rans_naca0012_bin.su2_exec = "parallel_computation.py -f" contadj_rans_naca0012_bin.timeout = 1600 @@ -713,6 +715,7 @@ def main(): harmonic_balance.su2_exec = "parallel_computation.py -f" harmonic_balance.timeout = 1600 harmonic_balance.tol = 0.00001 + harmonic_balance.new_output = False test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -724,6 +727,7 @@ def main(): hb_rans_preconditioning.su2_exec = "parallel_computation.py -f" hb_rans_preconditioning.timeout = 1600 hb_rans_preconditioning.tol = 0.00001 + hb_rans_preconditioning.new_output = False test_list.append(hb_rans_preconditioning) ###################################### @@ -788,7 +792,7 @@ def main(): aeroelastic.test_vals = [0.081587, 0.033262, -0.001666, -0.000155] #last 4 columns aeroelastic.su2_exec = "parallel_computation.py -f" aeroelastic.timeout = 1600 - aeroelastic.tol = 0.000001 + aeroelastic.tol = 0.00001 aeroelastic.unsteady = True test_list.append(aeroelastic) @@ -809,7 +813,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.735742, -7.020535, 1.185211, 0.283184] #last 4 columns + unst_inc_turb_naca0015_sa.test_vals = [-2.990702, -6.861616, 1.475736, 0.419771] #last 4 columns unst_inc_turb_naca0015_sa.su2_exec = "parallel_computation.py -f" unst_inc_turb_naca0015_sa.timeout = 1600 unst_inc_turb_naca0015_sa.tol = 0.00001 @@ -854,6 +858,7 @@ def main(): Jones_tc.test_vals = [-5.301576, 0.418692, 78.467450, 0.990201] #last 4 columns Jones_tc.su2_exec = "parallel_computation.py -f" Jones_tc.timeout = 1600 + Jones_tc.new_output = False Jones_tc.tol = 0.00001 test_list.append(Jones_tc) @@ -865,6 +870,7 @@ def main(): Jones_tc_rst.test_vals = [-4.344743, -1.553291, 82.250600, 2.791916] #last 4 columns Jones_tc_rst.su2_exec = "parallel_computation.py -f" Jones_tc_rst.timeout = 1600 + Jones_tc_rst.new_output = False Jones_tc_rst.tol = 0.00001 test_list.append(Jones_tc_rst) @@ -876,6 +882,7 @@ def main(): axial_stage2D.test_vals = [-1.790261, 5.696650, 73.362820, 0.904306] #last 4 columns axial_stage2D.su2_exec = "parallel_computation.py -f" axial_stage2D.timeout = 1600 + axial_stage2D.new_output = False axial_stage2D.tol = 0.00001 test_list.append(axial_stage2D) @@ -887,6 +894,7 @@ def main(): transonic_stator.test_vals = [-1.198895, 6.148362, 96.766820, 0.063115] #last 4 columns transonic_stator.su2_exec = "parallel_computation.py -f" transonic_stator.timeout = 1600 + transonic_stator.new_output = False transonic_stator.tol = 0.00001 test_list.append(transonic_stator) @@ -898,6 +906,7 @@ def main(): transonic_stator_rst.test_vals = [-8.248805, -2.976199, 5.285722, 0.003100] #last 4 columns transonic_stator_rst.su2_exec = "parallel_computation.py -f" transonic_stator_rst.timeout = 1600 + transonic_stator_rst.new_output = False transonic_stator_rst.tol = 0.00001 test_list.append(transonic_stator_rst) @@ -909,24 +918,26 @@ def main(): uniform_flow = TestCase('uniform_flow') uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" - uniform_flow.test_iter = 50 - uniform_flow.test_vals = [-0.367892, 5.156945, 0.000000, 0.000000] #last 4 columns + uniform_flow.test_iter = 5 + uniform_flow.test_vals = [5.000000, 0.000000, -0.188747, -10.631530] #last 4 columns uniform_flow.su2_exec = "parallel_computation.py -f" uniform_flow.timeout = 1600 uniform_flow.tol = 0.000001 uniform_flow.unsteady = True + uniform_flow.multizone = True test_list.append(uniform_flow) # Channel_2D channel_2D = TestCase('channel_2D') channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" - channel_2D.test_iter = 4 - channel_2D.test_vals = [-1.655365, 4.263893, 0.000000, 0.000000] #last 4 columns + channel_2D.test_iter = 2 + channel_2D.test_vals = [2.000000, 0.000000, 0.399698, 0.351908, 0.405704] #last 4 columns channel_2D.su2_exec = "parallel_computation.py -f" channel_2D.timeout = 100 channel_2D.tol = 0.00001 channel_2D.unsteady = True + channel_2D.multizone = True test_list.append(channel_2D) # Channel_3D @@ -934,11 +945,12 @@ def main(): channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_WA.cfg" channel_3D.test_iter = 2 - channel_3D.test_vals = [-1.996382, 3.963493, 0.000000, 0.000000] #last 4 columns + channel_3D.test_vals = [2.000000, 0.000000, 0.624073, 0.502950, 0.417050] #last 4 columns channel_3D.su2_exec = "parallel_computation.py -f" channel_3D.timeout = 1600 channel_3D.tol = 0.00001 channel_3D.unsteady = True + channel_3D.multizone = True test_list.append(channel_3D) # Pipe @@ -946,11 +958,12 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [-3.504317, 3.194211, 0.000000, 0.000000] #last 4 columns + pipe.test_vals = [0.117226, 0.491935, 0.676389, 0.974442, 1.024041] #last 4 columns pipe.su2_exec = "parallel_computation.py -f" pipe.timeout = 1600 pipe.tol = 0.00001 pipe.unsteady = True + pipe.multizone = True test_list.append(pipe) # Rotating cylinders @@ -958,11 +971,12 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [-1.149775, 4.619484, 0.000000, 0.000000] #last 4 columns + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.754346, 1.111512, 1.194307] #last 4 columns rotating_cylinders.su2_exec = "parallel_computation.py -f" rotating_cylinders.timeout = 1600 rotating_cylinders.tol = 0.00001 rotating_cylinders.unsteady = True + rotating_cylinders.multizone = True test_list.append(rotating_cylinders) # Supersonic vortex shedding @@ -970,11 +984,12 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [-0.211187, 5.611098, 0.000000, 0.000000] #last 4 columns + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.220915, 1.568306] #last 4 columns supersonic_vortex_shedding.su2_exec = "parallel_computation.py -f" supersonic_vortex_shedding.timeout = 1600 supersonic_vortex_shedding.tol = 0.00001 supersonic_vortex_shedding.unsteady = True + supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) # Bars_SST_2D @@ -982,10 +997,11 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [-2.132032, 1.651883, -0.000830, 0.117497] #last 4 columns + bars_SST_2D.test_vals = [13.000000, -0.719501, -1.608959] #last 4 columns bars_SST_2D.su2_exec = "SU2_CFD" bars_SST_2D.timeout = 1600 bars_SST_2D.tol = 0.00001 + bars_SST_2D.multizone = True test_list.append(bars_SST_2D) # Sliding mesh with incompressible flows (steady) @@ -993,10 +1009,11 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [-4.214657, 1.265231, 0.000000, 0.000000] #last 4 columns + slinc_steady.test_vals = [19.000000, -1.766116, -2.206522] #last 4 columns slinc_steady.su2_exec = "SU2_CFD" slinc_steady.timeout = 100 slinc_steady.tol = 0.00002 + slinc_steady.multizone = True test_list.append(slinc_steady) # Sliding mesh with incompressible flows (unsteady) @@ -1031,9 +1048,10 @@ def main(): dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 - dynbeam2d.test_vals = [-9.420641, -5.365871, -12.430382, 6.5210e+04] #last 4 columns + dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 6.6127e+04] #last 4 columns dynbeam2d.su2_exec = "parallel_computation_fsi.py -f" dynbeam2d.timeout = 1600 + dynbeam2d.unsteady = True dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) @@ -1042,9 +1060,11 @@ def main(): fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [2.000000, 0.500000, -6.878089, -0.260608] #last 4 columns + fsi2d.test_vals = [4.000000, 0.000000, -3.801272, -4.123968] #last 4 columns fsi2d.su2_exec = "parallel_computation_fsi.py -f" fsi2d.timeout = 1600 + fsi2d.multizone= True + fsi2d.unsteady = True fsi2d.tol = 0.00001 test_list.append(fsi2d) @@ -1052,9 +1072,10 @@ def main(): stat_fsi = TestCase('stat_fsi') stat_fsi.cfg_dir = "fea_fsi/stat_fsi" stat_fsi.cfg_file = "config.cfg" - stat_fsi.test_iter = 5000 - stat_fsi.test_vals = [-5.965844, -5.549896, -8.815105, -9.507963] #last 4 columns - stat_fsi.su2_exec = "SU2_CFD" + stat_fsi.test_iter = 7 + stat_fsi.test_vals = [-3.312222, -4.959311, 0.000000, 46.000000] #last 5 columns + stat_fsi.su2_exec = "mpirun -n 2 SU2_CFD" + stat_fsi.multizone = True stat_fsi.timeout = 1600 stat_fsi.tol = 0.00001 test_list.append(stat_fsi) @@ -1063,9 +1084,11 @@ def main(): dyn_fsi = TestCase('dyn_fsi') dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" - dyn_fsi.test_iter = 4000 - dyn_fsi.test_vals = [-4.709724, -2.913229, -7.186948, -8.186820] #last 4 columns - dyn_fsi.su2_exec = "SU2_CFD" + dyn_fsi.test_iter = 4 + dyn_fsi.test_vals = [-4.389734, -4.060117, 0.000000, 64.000000] #last 5 columns + dyn_fsi.multizone = True + dyn_fsi.unsteady = True + dyn_fsi.su2_exec = "mpirun -n 2 SU2_CFD" dyn_fsi.timeout = 1600 dyn_fsi.tol = 0.00001 test_list.append(dyn_fsi) @@ -1074,9 +1097,10 @@ def main(): stat_fsi_restart = TestCase('stat_fsi_restart') stat_fsi_restart.cfg_dir = "fea_fsi/stat_fsi" stat_fsi_restart.cfg_file = "config_restart.cfg" - stat_fsi_restart.test_iter = 3000 - stat_fsi_restart.test_vals = [-9.371585, -9.025672, -11.623159, -12.610272] #last 4 columns - stat_fsi_restart.su2_exec = "SU2_CFD" + stat_fsi_restart.test_iter = 1 + stat_fsi_restart.test_vals = [-3.422307, -4.212725, 0.000000, 46.000000] #last 5 columns + stat_fsi_restart.su2_exec = "mpirun -n 2 SU2_CFD" + stat_fsi_restart.multizone = True stat_fsi_restart.timeout = 1600 stat_fsi_restart.tol = 0.00001 test_list.append(stat_fsi_restart) @@ -1090,9 +1114,10 @@ def main(): cht_incompressible.cfg_dir = "coupled_cht/incompressible" cht_incompressible.cfg_file = "config.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [0.000000, 0.000000, -7.813888, -2543.238968] #last 4 columns - cht_incompressible.su2_exec = "parallel_computation.py -f" + cht_incompressible.test_vals = [10.000000, -2.607260, -2.708775] #last 4 columns + cht_incompressible.su2_exec = "mpirun -n 2 SU2_CFD" cht_incompressible.timeout = 1600 + cht_incompressible.multizone = True cht_incompressible.tol = 0.00001 test_list.append(cht_incompressible) @@ -1139,10 +1164,10 @@ def main(): pywrapper_aeroelastic.cfg_dir = "aeroelastic" pywrapper_aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" pywrapper_aeroelastic.test_iter = 2 - pywrapper_aeroelastic.test_vals = [0.081587, 0.033262, -0.001666, -0.000155] #last 4 columns + pywrapper_aeroelastic.test_vals = [0.081587, 0.033262, -0.001667, -0.000155] #last 4 columns pywrapper_aeroelastic.su2_exec = "mpirun -np 2 SU2_CFD.py --parallel -f" pywrapper_aeroelastic.timeout = 1600 - pywrapper_aeroelastic.tol = 0.000001 + pywrapper_aeroelastic.tol = 0.00001 pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) @@ -1151,9 +1176,11 @@ def main(): pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI.cfg" pywrapper_fsi2d.test_iter = 4 - pywrapper_fsi2d.test_vals = [2.000000, 0.500000, -6.878089, -0.260608] #last 4 columns + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.801272, -4.123968] #last 4 columns pywrapper_fsi2d.su2_exec = "mpirun -np 2 SU2_CFD.py --nZone 2 --fsi True --parallel -f" pywrapper_fsi2d.timeout = 1600 + pywrapper_fsi2d.unsteady = True + pywrapper_fsi2d.multizone = True pywrapper_fsi2d.tol = 0.00001 test_list.append(pywrapper_fsi2d) @@ -1162,11 +1189,12 @@ def main(): pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" pywrapper_unsteadyCHT.test_iter = 5 - pywrapper_unsteadyCHT.test_vals = [-1.598116, 2.263342, -0.000032, 0.145689] #last 4 columns + pywrapper_unsteadyCHT.test_vals = [-1.598116, 2.263342, -0.000029, 0.145689] #last 4 columns pywrapper_unsteadyCHT.su2_exec = "mpirun -np 2 python launch_unsteady_CHT_FlatPlate.py --parallel -f" pywrapper_unsteadyCHT.timeout = 1600 pywrapper_unsteadyCHT.tol = 0.00001 pywrapper_unsteadyCHT.unsteady = True + pywrapper_unsteadyCHT.new_output = True test_list.append(pywrapper_unsteadyCHT) # Rigid motion @@ -1278,7 +1306,6 @@ def main(): tutorial_turb_oneram6.su2_exec = "mpirun -np 2 SU2_CFD" tutorial_turb_oneram6.timeout = 1600 tutorial_turb_oneram6.tol = 0.00001 - tutorial_turb_oneram6.no_restart = True test_list.append(tutorial_turb_oneram6) # Inviscid NACA 0012 Design diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index e6daea0d3ba8..c7debc389a0c 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -120,7 +120,7 @@ def main(): discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 - discadj_incomp_NACA0012.test_vals = [-3.566362, -2.541739, 0.000000, 0.000000] #last 4 columns + discadj_incomp_NACA0012.test_vals = [20.000000, -3.566362, -2.541739, 0.000000] #last 4 columns discadj_incomp_NACA0012.su2_exec = "parallel_computation.py -f" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 @@ -135,7 +135,7 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [-2.104640, -2.004547, 0.0000e+00, 0.0000e+00] #last 4 columns + discadj_incomp_cylinder.test_vals = [20.000000, -2.104640, -2.004547, 0.0000e+00] #last 4 columns discadj_incomp_cylinder.su2_exec = "parallel_computation.py -f" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 @@ -150,7 +150,7 @@ def main(): discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 - discadj_incomp_turb_NACA0012_sa.test_vals = [-3.846036, -1.031071, 0.000000, 0.000000] #last 4 columns + discadj_incomp_turb_NACA0012_sa.test_vals = [10.000000, -3.846036, -1.031071, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 @@ -161,7 +161,7 @@ def main(): discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 - discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845805, -2.415680, 0.000000, 0.000000] #last 4 columns + discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845805, -2.415680, -8.430441, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "parallel_computation.py -f" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 @@ -208,7 +208,7 @@ def main(): discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 - discadj_pitchingNACA0012.test_vals = [-2.647642, -3.115408, -0.000691, 0.000002] #last 4 columns + discadj_pitchingNACA0012.test_vals = [-1.167347, -1.635137, -0.020862, 0.000050] #last 4 columns discadj_pitchingNACA0012.su2_exec = "parallel_computation.py -f" discadj_pitchingNACA0012.timeout = 1600 discadj_pitchingNACA0012.tol = 0.00001 @@ -224,7 +224,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [-1.923936, -2.119783, -0.510181, -20.818266] #last 4 columns + discadj_trans_stator.test_vals = [79.000000,-1.923936, -2.119783] #last 4 columns discadj_trans_stator.su2_exec = "parallel_computation.py -f" discadj_trans_stator.timeout = 1600 discadj_trans_stator.tol = 0.00001 @@ -239,7 +239,7 @@ def main(): discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 - discadj_fea.test_vals = [-5.394766, -5.572142, -0.000364, -8.708700] #last 4 columns + discadj_fea.test_vals = [-5.394766, -5.572142, -0.000364, -8.708681] #last 4 columns discadj_fea.su2_exec = "parallel_computation.py -f" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 @@ -254,7 +254,7 @@ def main(): discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 - discadj_heat.test_vals = [3.183906, 0.923840, -223.197830, -2059.808372] #last 4 columns + discadj_heat.test_vals = [3.183906, 0.923840, -223.200000, -2059.800000] #last 4 columns discadj_heat.su2_exec = "parallel_computation.py -f" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 @@ -264,16 +264,16 @@ def main(): ### Coupled FSI Adjoint ### ################################### - # Structural model - discadj_fsi = TestCase('discadj_fsi') - discadj_fsi.cfg_dir = "disc_adj_fsi" - discadj_fsi.cfg_file = "configAD_fsi.cfg" - discadj_fsi.test_iter = 3000 - discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns - discadj_fsi.su2_exec = "parallel_computation.py -f" - discadj_fsi.timeout = 1600 - discadj_fsi.tol = 0.00001 - test_list.append(discadj_fsi) +# # Structural model +# discadj_fsi = TestCase('discadj_fsi') +# discadj_fsi.cfg_dir = "disc_adj_fsi" +# discadj_fsi.cfg_file = "configAD_fsi.cfg" +# discadj_fsi.test_iter = 3000 +# discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns +# discadj_fsi.su2_exec = "parallel_computation.py -f" +# discadj_fsi.timeout = 1600 +# discadj_fsi.tol = 0.00001 +# test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### @@ -301,16 +301,16 @@ def main(): ### Coupled FSI Adjoint ### ################################### - discadj_fsi2 = TestCase('discadj_fsi_airfoil') - discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" - discadj_fsi2.cfg_file = "config.cfg" - discadj_fsi2.test_iter = 0 - discadj_fsi2.su2_exec = "parallel_computation.py" - discadj_fsi2.timeout = 1600 - discadj_fsi2.reference_file = "grad_young.opt.ref" - discadj_fsi2.test_file = "grad_young.opt" - pass_list.append(discadj_fsi2.run_filediff()) - test_list.append(discadj_fsi2) +# discadj_fsi2 = TestCase('discadj_fsi_airfoil') +# discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" +# discadj_fsi2.cfg_file = "config.cfg" +# discadj_fsi2.test_iter = 0 +# discadj_fsi2.su2_exec = "parallel_computation.py" +# discadj_fsi2.timeout = 1600 +# discadj_fsi2.reference_file = "grad_young.opt.ref" +# discadj_fsi2.test_file = "grad_young.opt" +# pass_list.append(discadj_fsi2.run_filediff()) +# test_list.append(discadj_fsi2) # Tests summary print('==================================================================') diff --git a/TestCases/polar/naca0012/inv_NACA0012.cfg b/TestCases/polar/naca0012/inv_NACA0012.cfg index a1dad86cd9b0..a50d8cdf0e8e 100644 --- a/TestCases/polar/naca0012/inv_NACA0012.cfg +++ b/TestCases/polar/naca0012/inv_NACA0012.cfg @@ -25,6 +25,9 @@ RESTART_SOL= NO % Number of Zones needed for python scripts NZONES= 1 % +% New singlezone driver +%SINGLEZONE_DRIVER=YES + % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % % Mach number (non-dimensional, based on the free-stream values) @@ -101,7 +104,7 @@ OBJECTIVE_FUNCTION= DRAG CFL_NUMBER= 4.0 % % Number of total iterations -EXT_ITER= 11 +ITER= 11 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -248,24 +251,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % Mesh input file @@ -278,25 +276,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= TECPLOT % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -305,7 +303,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -315,6 +313,12 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) +% +% History output +HISTORY_OUTPUT= (RMS_RES, AERO_COEFF) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/configAD_fem.cfg b/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/configAD_fem.cfg index fa326a496534..89ed78b53637 100644 --- a/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/configAD_fem.cfg +++ b/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/configAD_fem.cfg @@ -15,8 +15,6 @@ MATH_PROBLEM= DISCRETE_ADJOINT RESTART_SOL= NO -ITER = 1 - OBJECTIVE_FUNCTION= REFERENCE_NODE REFERENCE_NODE= 127 REFERENCE_NODE_DISPLACEMENT= (0.0, 0.0) @@ -42,20 +40,14 @@ DEAD_LOAD=NO FORMULATION_ELASTICITY_2D = PLANE_STRAIN NONLINEAR_FEM_SOLUTION_METHOD = NEWTON_RAPHSON -NONLINEAR_FEM_INT_ITER = 10 -RESIDUAL_FEM_UTOL = -9.0 -RESIDUAL_FEM_RTOL = -9.0 -RESIDUAL_FEM_ETOL = -9.0 - -RESIDUAL_CRITERIA_FEM = ABSOLUTE +INNER_ITER = 1 CONV_FILENAME= history -VOLUME_STRUCTURE_FILENAME= beam -WRITE_CONV_FILENAME_FSI = NO +VOLUME_FILENAME= beam BREAKDOWN_FILENAME= forces_breakdown.dat -SOLUTION_STRUCTURE_FILENAME= solution_beam.dat -RESTART_STRUCTURE_FILENAME= restart_beam.dat +SOLUTION_FILENAME= solution_beam.dat +RESTART_FILENAME= restart_beam.dat SOLUTION_ADJ_FILENAME= solution_adj.dat RESTART_ADJ_FILENAME= restart_adj.dat @@ -64,7 +56,7 @@ WRT_SRF_SOL = NO WRT_CSV_SOL = NO MESH_FORMAT= SU2 -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV WRT_CON_FREQ= 1 WRT_CON_FREQ_DUALTIME= 1 diff --git a/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/configAD_flow.cfg b/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/configAD_flow.cfg index 0adb534ea182..650670e6e949 100644 --- a/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/configAD_flow.cfg +++ b/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/configAD_flow.cfg @@ -29,8 +29,6 @@ INNER_ITER = 181 % ------------------------- UNSTEADY SIMULATION -------------------------------% -UNSTEADY_SIMULATION= NO - OBJECTIVE_FUNCTION = DRAG % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% @@ -123,15 +121,12 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% +CONV_FIELD = RMS_ADJ_DENSITY CONV_CRITERIA= RESIDUAL - -RESIDUAL_REDUCTION= 10 -RESIDUAL_MINVAL= -16 - -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-5 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -16 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-5 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -140,14 +135,14 @@ MESH_FILENAME= meshFlow.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat -RESTART_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= solution_flow.dat +RESTART_FILENAME= restart_flow.dat -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history -VOLUME_FLOW_FILENAME= flow -SURFACE_FLOW_FILENAME= surface_flow +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow WRT_SOL_FREQ= 1000 WRT_SOL_FREQ_DUALTIME= 1 diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index 8f1f55f292a2..0d6b815b4e12 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulence model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -157,25 +157,27 @@ KT_CONSTANT= 0.0257 % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 0.003 +TIME_STEP= 0.003 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 1.0 +MAX_TIME= 1.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 10 +INNER_ITER= 10 % % Iteration number to begin unsteady restarts -UNST_RESTART_ITER= 0 +RESTART_ITER= 0 +TIME_ITER=9999 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % Type of dynamic mesh (NONE, RIGID_MOTION, DEFORMING, ROTATING_FRAME, % MOVING_WALL, STEADY_TRANSLATION, FLUID_STRUCTURE, @@ -438,7 +440,7 @@ DEFORM_COEFF = 1E6 % % Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, % WALL_DISTANCE, CONSTANT_STIFFNESS) -DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME % % Deform the grid only close to the surface. It is possible to specify how much % of the volumetric grid is going to be deformed in meters or inches (1E6 by default) @@ -451,35 +453,24 @@ VISUALIZE_SURFACE_DEF= NO VISUALIZE_VOLUME_DEF= NO % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -% Number of total iterations -EXT_ITER= 999999 -% -ITER= 10 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 4 +CONV_STARTITER= 4 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 10 +CONV_CAUCHY_ELEMS= 10 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= LIFT % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -493,14 +484,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -509,13 +500,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -527,7 +518,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -556,11 +547,12 @@ WRT_SHARPEDGES= NO % Output the solution at each surface in the history file WRT_SURFACE= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO % % Write binary restart files (YES, NO) WRT_BINARY_RESTART= YES % % Read binary restart files (YES, NO) READ_BINARY_RESTART= YES +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py index 11bde132c027..95079487e740 100755 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py @@ -140,8 +140,8 @@ def main(): # Retrieve some control parameters from the driver deltaT = SU2Driver.GetUnsteady_TimeStep() - TimeIter = SU2Driver.GetExtIter() - nTimeIter = SU2Driver.GetnExtIter() + TimeIter = SU2Driver.GetTime_Iter() + nTimeIter = SU2Driver.GetnTimeIter() time = TimeIter*deltaT # Extract the initial position of each node on the moving marker @@ -159,8 +159,6 @@ def main(): comm.Barrier() while (TimeIter < nTimeIter): - # Time iteration preprocessing - SU2Driver.PreprocessExtIter(TimeIter) # Define the rigid body displacement and set the new coords of each node on the marker d_y = 0.0175*sin(2*pi*time) for iVertex in range(nVertex_MovingMarker): @@ -170,8 +168,8 @@ def main(): SU2Driver.SetVertexCoordY(MovingMarkerID, iVertex, newCoordY) SU2Driver.SetVertexCoordZ(MovingMarkerID, iVertex, 0.0) SU2Driver.SetVertexVarCoord(MovingMarkerID, iVertex) - # Tell the SU2 driver to update the mesh (dynamic mesh motion) - SU2Driver.DynamicMeshUpdate(TimeIter) + # Time iteration preprocessing + SU2Driver.Preprocess(TimeIter) # Run one time iteration (e.g. dual-time) SU2Driver.Run() # Update the solver for the next time iteration diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py index 4fa5ac0d0a11..930d0e5aca5f 100755 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py @@ -104,7 +104,7 @@ def main(): elif (options.nZone == 2) and (options.fsi): SU2Driver = pysu2.CFSIDriver(options.filename, options.nZone, comm); else: - SU2Driver = pysu2.CFluidDriver(options.filename, options.nZone, comm); + SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); except TypeError as exception: print('A TypeError occured in pysu2.CDriver : ',exception) if options.with_MPI == True: @@ -139,8 +139,8 @@ def main(): # Retrieve some control parameters from the driver deltaT = SU2Driver.GetUnsteady_TimeStep() - TimeIter = SU2Driver.GetExtIter() - nTimeIter = SU2Driver.GetnExtIter() + TimeIter = SU2Driver.GetTime_Iter() + nTimeIter = SU2Driver.GetnTimeIter() time = TimeIter*deltaT # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step @@ -152,7 +152,7 @@ def main(): while (TimeIter < nTimeIter): # Time iteration preprocessing - SU2Driver.PreprocessExtIter(TimeIter) + SU2Driver.Preprocess(TimeIter) # Define the homogeneous unsteady wall temperature on the structure (user defined) WallTemp = 293.0 + 57.0*sin(2*pi*time) # Set this temperature to all the vertices on the specified CHT marker diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg index ea7364bbbc59..c31d0d9144b1 100644 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulence model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -44,7 +44,6 @@ DISCARD_INFILES= NO % psf = lbf/ft^2, Density = slug/ft^3, % Speed = ft/s, Equiv. Area = ft^2 ) SYSTEM_MEASUREMENTS= SI - % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -157,23 +156,27 @@ KT_CONSTANT= 0.0257 % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES +% +TIME_ITER= 10 % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -- Only used when UNST_CFL_NUMBER = 0.0 -UNST_TIMESTEP= 0.003 +TIME_STEP= 0.003 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 1.0 +MAX_TIME= 1.0 % % Unsteady Courant-Friedrichs-Lewy number of the finest grid UNST_CFL_NUMBER= 0.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 10 +INNER_ITER= 10 % % Iteration number to begin unsteady restarts +RESTART_ITER= 0 % ----------------------- BODY FORCE DEFINITION -------------------------------% % @@ -431,33 +434,24 @@ VISUALIZE_VOLUME_DEF= NO % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 999999 -% % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 4 +CONV_STARTITER= 4 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 10 +CONV_CAUCHY_ELEMS= 10 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= LIFT % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -471,14 +465,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -487,13 +481,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -505,7 +499,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -534,11 +528,12 @@ WRT_SHARPEDGES= NO % Output the solution at each surface in the history file WRT_SURFACE= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO % % Write binary restart files (YES, NO) WRT_BINARY_RESTART= YES % % Read binary restart files (YES, NO) READ_BINARY_RESTART= YES +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/TestCases/rans/flatplate/turb_SA_flatplate.cfg b/TestCases/rans/flatplate/turb_SA_flatplate.cfg index d84e489b4895..131cadf8fcdb 100644 --- a/TestCases/rans/flatplate/turb_SA_flatplate.cfg +++ b/TestCases/rans/flatplate/turb_SA_flatplate.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= SA @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -101,7 +104,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -180,24 +183,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -211,25 +209,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, SLT) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -238,7 +236,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -248,3 +246,6 @@ WRT_SOL_FREQ= 1000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/rans/flatplate/turb_SST_flatplate.cfg b/TestCases/rans/flatplate/turb_SST_flatplate.cfg index 0af118a9ac93..ac40112d2b7c 100644 --- a/TestCases/rans/flatplate/turb_SST_flatplate.cfg +++ b/TestCases/rans/flatplate/turb_SST_flatplate.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= SST @@ -180,24 +180,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -15 +CONV_RESIDUAL_MINVAL= -15 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -211,25 +206,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, SLT) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -238,7 +233,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/rans/naca0012/turb_NACA0012_sa.cfg b/TestCases/rans/naca0012/turb_NACA0012_sa.cfg index 9e9ad75bb714..9c53745856f6 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sa.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sa.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -32,8 +32,9 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -102,7 +103,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -189,24 +190,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -220,25 +216,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sa.dat +SOLUTION_FILENAME= solution_flow_sa.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -247,7 +243,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -257,3 +253,7 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT=(INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) + diff --git a/TestCases/rans/naca0012/turb_NACA0012_sa_binary.cfg b/TestCases/rans/naca0012/turb_NACA0012_sa_binary.cfg index 622ee77a0d54..e570551f7bee 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sa_binary.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sa_binary.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -38,8 +38,9 @@ WRT_BINARY_RESTART= YES % Read binary restart files (YES, NO) READ_BINARY_RESTART= YES % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -108,7 +109,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -195,24 +196,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -226,25 +222,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sa_bin.dat +SOLUTION_FILENAME= solution_flow_sa_bin.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -253,7 +249,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -263,3 +259,7 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) + diff --git a/TestCases/rans/naca0012/turb_NACA0012_sa_neg.cfg b/TestCases/rans/naca0012/turb_NACA0012_sa_neg.cfg index ca272789b0b0..b9b854ed6d82 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sa_neg.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sa_neg.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA_NEG @@ -26,8 +26,6 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= YES % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -183,24 +181,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -214,25 +207,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sa.dat +SOLUTION_FILENAME= solution_flow_sa.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -241,7 +234,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst.cfg index b4c93e252844..bfa4a67aa2ce 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -32,8 +32,9 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -102,7 +103,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -188,24 +189,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -219,25 +215,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst.dat +SOLUTION_FILENAME= solution_flow_sst.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -246,7 +242,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -256,3 +252,7 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) + diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg index e9bbd8647ba0..940012cafe22 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg @@ -16,7 +16,7 @@ % TNE2_EULER, TNE2_NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, LINEAR_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulence model (NONE, SA, SST) KIND_TURB_MODEL= SST @@ -54,6 +54,9 @@ GRAVITY_FORCE= NO % % Axisymmetric simulation, only compressible (NO, YES) AXISYMMETRIC= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -137,34 +140,6 @@ MU_T_REF= 273.15 % % Sutherland constant (110.4 default value for AIR SI) SUTHERLAND_CONSTANT= 110.4 - -% ------------------------- UNSTEADY SIMULATION -------------------------------% -% -% Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, -% DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL) -%UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0001 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 5.0 -% 2500 iterations - 1.25 -% 3500 iterations - 1.75 -% 5000 iterations - 2.5 -% -% Unsteady Courant-Friedrichs-Lewy number of the finest grid -UNST_CFL_NUMBER= 0.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 100 -% -% Integer number of periodic time instances for Time Spectral -TIME_INSTANCES= 1 -% -% Iteration number to begin unsteady restarts -UNST_RESTART_ITER=2 - % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % % Navier-Stokes (no-slip), constant heat flux wall marker(s) (NONE = no marker) @@ -347,32 +322,26 @@ LIMIT_ADJFLOW= 1E6 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 100 +ITER= 100 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 7 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 30 +CONV_STARTITER= 30 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 500 +CONV_CAUCHY_ELEMS= 500 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -386,25 +355,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst_restart.dat +SOLUTION_FILENAME= solution_flow_sst_restart.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (TECPLOT, PARAVIEW, TECPLOT_BINARY) -OUTPUT_FORMAT= TECPLOT_BINARY +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -416,7 +385,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -444,3 +413,6 @@ WRT_LIMITERS= NO % % Write a CSV surface flow file WRT_CSV_SOL= NO +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg index 6badd3395364..11c5fc777071 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST_SUST @@ -32,8 +32,6 @@ WRT_BINARY_RESTART= NO % Read binary restart files (YES, NO) READ_BINARY_RESTART= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -108,7 +106,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -194,24 +192,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -225,25 +218,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst_sust.dat +SOLUTION_FILENAME= solution_flow_sst_sust.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -252,7 +245,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -262,3 +255,7 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) + diff --git a/TestCases/rans/oneram6/turb_ONERAM6.cfg b/TestCases/rans/oneram6/turb_ONERAM6.cfg index f4c54b445a56..19f10d1f9956 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulence model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -24,6 +24,8 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -137,7 +139,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 999999 +ITER= 999999 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -218,25 +220,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -250,25 +246,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -277,7 +273,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -288,3 +284,5 @@ WRT_SOL_FREQ= 250 % Writing convergence history frequency WRT_CON_FREQ= 1 % +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/rans/propeller/propeller.cfg b/TestCases/rans/propeller/propeller.cfg index d29e808826ba..aecb8e74d91c 100644 --- a/TestCases/rans/propeller/propeller.cfg +++ b/TestCases/rans/propeller/propeller.cfg @@ -12,7 +12,7 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulence model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -32,6 +32,9 @@ RESTART_SOL= NO % psf = lbf/ft^2, Density = slug/ft^3, % Speed = ft/s, Equiv. Area = ft^2 ) SYSTEM_MEASUREMENTS= US +% +% New singlezone driver +SINGLEZONE_DRIVER= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -202,20 +205,18 @@ RELAXATION_FACTOR_TURB= 0.9 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 15 +ITER= 15 % % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -229,14 +230,14 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (TECPLOT, TECPLOT_BINARY, PARAVIEW, % FIELDVIEW, FIELDVIEW_BINARY) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history @@ -245,13 +246,13 @@ CONV_FILENAME= history BREAKDOWN_FILENAME= forces_breakdown.dat % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -263,7 +264,7 @@ VALUE_OBJFUNC_FILENAME= of_eval.dat GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -289,5 +290,8 @@ WRT_LIMITERS= NO % Output the sharp edges detector WRT_SHARPEDGES= NO % -% Minimize the required output memory -LOW_MEMORY_OUTPUT= NO +% +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) + diff --git a/TestCases/rans/rae2822/turb_SA_RAE2822.cfg b/TestCases/rans/rae2822/turb_SA_RAE2822.cfg index 0aea81c5c3c1..09d1592e9a1d 100644 --- a/TestCases/rans/rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SA_RAE2822.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -85,7 +88,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= BCGSTAB @@ -195,24 +198,19 @@ FROZEN_VISC_CONT= YES % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -226,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -253,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -263,6 +261,9 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output fields +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_NU_TILDE, LIFT, DRAG) % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % diff --git a/TestCases/rans/rae2822/turb_SST_RAE2822.cfg b/TestCases/rans/rae2822/turb_SST_RAE2822.cfg index 01e56a0ff18e..c1dae33a56cb 100644 --- a/TestCases/rans/rae2822/turb_SST_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SST_RAE2822.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -24,6 +24,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -91,7 +94,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -172,24 +175,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -203,25 +201,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -230,7 +228,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -240,3 +238,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) + diff --git a/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg b/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg index 00de695c3417..36b56d24464d 100644 --- a/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST, SST_SUST) KIND_TURB_MODEL= SST_SUST @@ -91,7 +91,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES @@ -172,25 +172,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG - % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % % Mesh input file @@ -203,25 +197,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -230,7 +224,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -240,3 +234,6 @@ WRT_SOL_FREQ= 250 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% Screen output fields +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) + diff --git a/TestCases/rans/s809/trans_s809.cfg b/TestCases/rans/s809/trans_s809.cfg index b7fb243cfec3..f5a023105cdd 100644 --- a/TestCases/rans/s809/trans_s809.cfg +++ b/TestCases/rans/s809/trans_s809.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -166,24 +166,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -197,7 +192,7 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= trans_mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= trans_solution_flow.dat +SOLUTION_FILENAME= trans_solution_flow.dat % % Restart linear flow input file SOLUTION_LIN_FILENAME= trans_solution_lin.dat @@ -206,13 +201,13 @@ SOLUTION_LIN_FILENAME= trans_solution_lin.dat SOLUTION_ADJ_FILENAME= trans_solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= trans_history % % Output file restart flow -RESTART_FLOW_FILENAME= trans_restart_flow.dat +RESTART_FILENAME= trans_restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= trans_restart_adj.dat @@ -221,7 +216,7 @@ RESTART_ADJ_FILENAME= trans_restart_adj.dat RESTART_LIN_FILENAME= trans_restart_lin.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= trans_flow +VOLUME_FILENAME= trans_flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= trans_adjoint @@ -230,7 +225,7 @@ VOLUME_ADJ_FILENAME= trans_adjoint GRAD_OBJFUNC_FILENAME= trans_of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= trans_surface_flow +SURFACE_FILENAME= trans_surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= trans_surface_adjoint diff --git a/TestCases/rans/s809/turb_S809.cfg b/TestCases/rans/s809/turb_S809.cfg index b4e025d01bf0..13424e120b0e 100644 --- a/TestCases/rans/s809/turb_S809.cfg +++ b/TestCases/rans/s809/turb_S809.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -180,24 +180,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -211,25 +206,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -238,7 +233,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/rans/vki_turbine/turb_vki.cfg b/TestCases/rans/vki_turbine/turb_vki.cfg index 2f4d5005534f..38a3446b6394 100644 --- a/TestCases/rans/vki_turbine/turb_vki.cfg +++ b/TestCases/rans/vki_turbine/turb_vki.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -187,24 +187,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -218,25 +213,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -245,7 +240,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg index 4dbf2d842198..8f67d947faa0 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -179,24 +179,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -210,25 +205,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst.dat +SOLUTION_FILENAME= solution_flow_sst.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -237,7 +232,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg index e4094fe9e993..ba81b55bff5c 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -26,6 +26,8 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -111,7 +113,7 @@ CFL_ADAPT= YES CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % % Coefficient for the limiter @@ -196,24 +198,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -227,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -254,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -264,3 +261,7 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG + diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg index 5626e70efa13..4d2b24044495 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -26,6 +26,8 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -111,7 +113,7 @@ CFL_ADAPT= YES CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % % Coefficient for the limiter @@ -196,24 +198,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -227,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -254,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -264,3 +261,6 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg index dfb012a36cbb..3dfaa50c4f85 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -26,6 +26,8 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -111,7 +113,7 @@ CFL_ADAPT= YES CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % % Coefficient for the limiter @@ -196,24 +198,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -227,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -254,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -264,3 +261,6 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg index 2b6acee35764..5917a5c53e12 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -26,6 +26,8 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -111,7 +113,7 @@ CFL_ADAPT= YES CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % % Coefficient for the limiter @@ -196,24 +198,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -227,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -254,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -264,3 +261,6 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg index 124523eee99e..18528ed6562b 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SST @@ -26,6 +26,8 @@ MATH_PROBLEM= DIRECT % Restart solution (NO, YES) RESTART_SOL= NO % +% New singlezone driver +SINGLEZONE_DRIVER=YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -111,7 +113,7 @@ CFL_ADAPT= YES CFL_ADAPT_PARAM= ( 1.5, 0.5, 10.0, 100.0 ) % % Number of total iterations -EXT_ITER= 99999 +ITER= 99999 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % % Coefficient for the limiter @@ -196,24 +198,19 @@ CFL_REDUCTION_TURB= 1.0 % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -9 +CONV_RESIDUAL_MINVAL= -9 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -227,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -254,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -264,3 +261,6 @@ WRT_SOL_FREQ= 10000 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG diff --git a/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg b/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg index 5953662b6128..82db97c1cff0 100644 --- a/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg +++ b/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg @@ -168,24 +168,19 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-10 +CONV_CAUCHY_EPS= 1E-10 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -199,25 +194,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_caradonna_tung_periodic.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -226,7 +221,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/rotating/naca0012/rot_NACA0012.cfg b/TestCases/rotating/naca0012/rot_NACA0012.cfg index 936a3ce959d7..3850a936fb9c 100644 --- a/TestCases/rotating/naca0012/rot_NACA0012.cfg +++ b/TestCases/rotating/naca0012/rot_NACA0012.cfg @@ -264,24 +264,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -295,25 +290,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -322,7 +317,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 21a764d4377e..c2bb796f75ff 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -58,6 +58,7 @@ def main(): channel.test_vals = [-2.475874, 3.046368, -0.203968, 0.036020] #last 4 columns channel.su2_exec = "SU2_CFD" channel.timeout = 1600 + channel.new_output = True channel.tol = 0.00001 test_list.append(channel) @@ -69,6 +70,7 @@ def main(): naca0012.test_vals = [-4.021036, -3.511771, 0.339316, 0.022257] #last 4 columns naca0012.su2_exec = "SU2_CFD" naca0012.timeout = 1600 + naca0012.new_output= True naca0012.tol = 0.00001 test_list.append(naca0012) @@ -80,6 +82,7 @@ def main(): wedge.test_vals = [-0.942862, 4.784581, -0.208106, 0.036665] #last 4 columns wedge.su2_exec = "SU2_CFD" wedge.timeout = 1600 + wedge.new_output= True wedge.tol = 0.00001 test_list.append(wedge) @@ -91,6 +94,7 @@ def main(): oneram6.test_vals = [-7.077986, -6.539796, 0.282344, 0.011807] #last 4 columns oneram6.su2_exec = "SU2_CFD" oneram6.timeout = 9600 + oneram6.new_output = True oneram6.tol = 0.00001 test_list.append(oneram6) @@ -98,9 +102,10 @@ def main(): fixedCL_naca0012 = TestCase('fixedcl_naca0012') fixedCL_naca0012.cfg_dir = "fixed_cl/naca0012" fixedCL_naca0012.cfg_file = "inv_NACA0012.cfg" - fixedCL_naca0012.test_iter = 100 - fixedCL_naca0012.test_vals = [-2.552012, 2.855343, 0.295861, 0.019466] #last 4 columns + fixedCL_naca0012.test_iter = 10 + fixedCL_naca0012.test_vals = [-4.031390, 1.500719, 0.300135, 0.019485] #last 4 columns fixedCL_naca0012.su2_exec = "SU2_CFD" + fixedCL_naca0012.new_output = True fixedCL_naca0012.timeout = 1600 fixedCL_naca0012.tol = 0.00001 test_list.append(fixedCL_naca0012) @@ -110,6 +115,7 @@ def main(): polar_naca0012.cfg_dir = "polar/naca0012" polar_naca0012.cfg_file = "inv_NACA0012.cfg" polar_naca0012.polar = True + polar_naca0012.new_output= True polar_naca0012.test_iter = 10 polar_naca0012.test_vals = [-1.308958, 4.123692, 0.011587, 0.009698] #last 4 columns polar_naca0012.su2_exec = "compute_polar.py -n 1 -i 11" @@ -121,6 +127,7 @@ def main(): bluntbody = TestCase('bluntbody') bluntbody.cfg_dir = "euler/bluntbody" bluntbody.cfg_file = "blunt.cfg" + bluntbody.new_output = True bluntbody.test_iter = 20 bluntbody.test_vals = [0.553700, 6.926057, -0.000000, 1.792561] #last 4 columns bluntbody.su2_exec = "SU2_CFD" @@ -139,6 +146,7 @@ def main(): flatplate.test_iter = 20 flatplate.test_vals = [-4.680777, 0.781234, -0.135957, 0.022977] #last 4 columns flatplate.su2_exec = "SU2_CFD" + flatplate.new_output = True flatplate.timeout = 1600 flatplate.tol = 0.00001 test_list.append(flatplate) @@ -150,6 +158,7 @@ def main(): cylinder.test_iter = 25 cylinder.test_vals = [-6.765432, -1.297428, 0.019508, 0.310040] #last 4 columns cylinder.su2_exec = "SU2_CFD" + cylinder.new_output = True cylinder.timeout = 1600 cylinder.tol = 0.00001 test_list.append(cylinder) @@ -161,6 +170,7 @@ def main(): cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.850123, -1.388088, -0.056090, 108.140177] #last 4 columns cylinder_lowmach.su2_exec = "SU2_CFD" + cylinder_lowmach.new_output = True cylinder_lowmach.timeout = 1600 cylinder_lowmach.tol = 0.00001 test_list.append(cylinder_lowmach) @@ -172,10 +182,11 @@ def main(): poiseuille.test_iter = 10 poiseuille.test_vals = [-5.050732, 0.648355, 0.012273, 13.643219] #last 4 columns poiseuille.su2_exec = "SU2_CFD" + poiseuille.new_output = True poiseuille.timeout = 1600 poiseuille.tol = 0.00001 test_list.append(poiseuille) - + # 2D Poiseuille flow (inlet profile file) poiseuille_profile = TestCase('poiseuille_profile') poiseuille_profile.cfg_dir = "navierstokes/poiseuille" @@ -183,10 +194,11 @@ def main(): poiseuille_profile.test_iter = 10 poiseuille_profile.test_vals = [-12.494724, -7.712336, -0.000000, 2.085796] #last 4 columns poiseuille_profile.su2_exec = "SU2_CFD" + poiseuille_profile.new_output = True poiseuille_profile.timeout = 1600 poiseuille_profile.tol = 0.00001 test_list.append(poiseuille_profile) - + ########################## ### Compressible RANS ### ########################## @@ -199,6 +211,7 @@ def main(): rae2822_sa.test_vals = [-2.000469, -5.228296, 0.820188, 0.052004] #last 4 columns rae2822_sa.su2_exec = "SU2_CFD" rae2822_sa.timeout = 1600 + rae2822_sa.new_output = True rae2822_sa.tol = 0.00001 test_list.append(rae2822_sa) @@ -209,6 +222,7 @@ def main(): rae2822_sst.test_iter = 20 rae2822_sst.test_vals = [-0.510826, 4.909241, 0.825023, 0.052675] #last 4 columns rae2822_sst.su2_exec = "SU2_CFD" + rae2822_sst.new_output = True rae2822_sst.timeout = 1600 rae2822_sst.tol = 0.00001 test_list.append(rae2822_sst) @@ -231,6 +245,7 @@ def main(): turb_flatplate.test_iter = 20 turb_flatplate.test_vals = [-4.157169, -6.737133, -0.176253, 0.057446] #last 4 columns turb_flatplate.su2_exec = "SU2_CFD" + turb_flatplate.new_output = True turb_flatplate.timeout = 1600 turb_flatplate.tol = 0.00001 test_list.append(turb_flatplate) @@ -242,6 +257,7 @@ def main(): turb_oneram6.test_iter = 10 turb_oneram6.test_vals = [-2.327431, -6.564331, 0.230257, 0.155839]#last 4 columns turb_oneram6.su2_exec = "SU2_CFD" + turb_oneram6.new_output = True turb_oneram6.timeout = 3200 turb_oneram6.tol = 0.00001 test_list.append(turb_oneram6) @@ -253,6 +269,7 @@ def main(): turb_naca0012_sa.test_iter = 10 turb_naca0012_sa.test_vals = [-11.981166, -9.145363, 1.070528, 0.019417] #last 4 columns turb_naca0012_sa.su2_exec = "SU2_CFD" + turb_naca0012_sa.new_output = True turb_naca0012_sa.timeout = 3200 turb_naca0012_sa.tol = 0.00001 test_list.append(turb_naca0012_sa) @@ -264,6 +281,7 @@ def main(): turb_naca0012_sa_bin.test_iter = 10 turb_naca0012_sa_bin.test_vals = [-11.981289, -9.145363, 1.070528, 0.019417] #last 4 columns turb_naca0012_sa_bin.su2_exec = "SU2_CFD" + turb_naca0012_sa_bin.new_output = True turb_naca0012_sa_bin.timeout = 3200 turb_naca0012_sa_bin.tol = 0.00001 test_list.append(turb_naca0012_sa_bin) @@ -275,6 +293,7 @@ def main(): turb_naca0012_sst.test_iter = 10 turb_naca0012_sst.test_vals = [-12.454420, -6.572026, 1.059622, 0.019138] #last 4 columns turb_naca0012_sst.su2_exec = "SU2_CFD" + turb_naca0012_sst.new_output = True turb_naca0012_sst.timeout = 3200 turb_naca0012_sst.tol = 0.00001 test_list.append(turb_naca0012_sst) @@ -298,10 +317,10 @@ def main(): propeller.test_iter = 10 propeller.test_vals = [-3.378876, -8.396837, 0.000047, 0.055591] #last 4 columns propeller.su2_exec = "SU2_CFD" + propeller.new_output = True propeller.timeout = 3200 propeller.tol = 0.00001 test_list.append(propeller) - ################################# ## Compressible RANS Restart ### ################################# @@ -314,10 +333,11 @@ def main(): turb_naca0012_sst_restart_mg.ntest_vals = 5 turb_naca0012_sst_restart_mg.test_vals = [-6.459444, -4.595710, 1.201844, -0.007146, 0.080517] #last 5 columns turb_naca0012_sst_restart_mg.su2_exec = "SU2_CFD" + turb_naca0012_sst_restart_mg.new_output = True turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) - + ############################# ### Incompressible Euler ### ############################# @@ -329,6 +349,7 @@ def main(): inc_euler_naca0012.test_iter = 20 inc_euler_naca0012.test_vals = [-4.858287, -3.810487, 0.491850, 0.007002] #last 4 columns inc_euler_naca0012.su2_exec = "SU2_CFD" + inc_euler_naca0012.new_output = True inc_euler_naca0012.timeout = 1600 inc_euler_naca0012.tol = 0.00001 test_list.append(inc_euler_naca0012) @@ -340,6 +361,7 @@ def main(): inc_nozzle.test_iter = 20 inc_nozzle.test_vals = [-5.971283, -4.911145, -0.000201, 0.121631] #last 4 columns inc_nozzle.su2_exec = "SU2_CFD" + inc_nozzle.new_output = True inc_nozzle.timeout = 1600 inc_nozzle.tol = 0.00001 test_list.append(inc_nozzle) @@ -354,6 +376,7 @@ def main(): inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" inc_lam_cylinder.test_iter = 10 inc_lam_cylinder.test_vals = [-4.004277, -3.227956, 0.003852, 7.626578] #last 4 columns + inc_lam_cylinder.new_output = True inc_lam_cylinder.su2_exec = "SU2_CFD" inc_lam_cylinder.timeout = 1600 inc_lam_cylinder.tol = 0.00001 @@ -365,6 +388,7 @@ def main(): inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" inc_buoyancy.test_iter = 20 inc_buoyancy.test_vals = [-4.436657, 0.507847, 0.000000, 0.000000] #last 4 columns + inc_buoyancy.new_output = True inc_buoyancy.su2_exec = "SU2_CFD" inc_buoyancy.timeout = 1600 inc_buoyancy.tol = 0.00001 @@ -376,6 +400,7 @@ def main(): inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 inc_poly_cylinder.test_vals = [-8.108218, -2.158606, 0.019142, 1.902461] #last 4 columns + inc_poly_cylinder.new_output = True inc_poly_cylinder.su2_exec = "SU2_CFD" inc_poly_cylinder.timeout = 1600 inc_poly_cylinder.tol = 0.00001 @@ -402,6 +427,7 @@ def main(): inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 inc_turb_naca0012.test_vals = [-4.788495, -11.040511, 0.000023, 0.309503] #last 4 columns + inc_turb_naca0012.new_output = True inc_turb_naca0012.su2_exec = "SU2_CFD" inc_turb_naca0012.timeout = 1600 inc_turb_naca0012.tol = 0.00001 @@ -429,6 +455,7 @@ def main(): fem_euler_naca0012.test_iter = 10 fem_euler_naca0012.test_vals = [-6.519946,-5.976944,0.255551,0.000028] #last 4 columns fem_euler_naca0012.su2_exec = "SU2_CFD" + fem_euler_naca0012.new_output = True fem_euler_naca0012.timeout = 1600 fem_euler_naca0012.tol = 0.00001 test_list.append(fem_euler_naca0012) @@ -444,6 +471,7 @@ def main(): fem_ns_flatplate.test_iter = 25 fem_ns_flatplate.test_vals = [1.383727,3.175247,0.058387,0.257951] #last 4 columns fem_ns_flatplate.su2_exec = "SU2_CFD" + fem_ns_flatplate.new_output = True fem_ns_flatplate.timeout = 1600 fem_ns_flatplate.tol = 0.00001 test_list.append(fem_ns_flatplate) @@ -455,6 +483,7 @@ def main(): fem_ns_cylinder.test_iter = 10 fem_ns_cylinder.test_vals = [0.454960,0.979123,-0.000028,79.984799] #last 4 columns fem_ns_cylinder.su2_exec = "SU2_CFD" + fem_ns_cylinder.new_output = True fem_ns_cylinder.timeout = 1600 fem_ns_cylinder.tol = 0.00001 test_list.append(fem_ns_cylinder) @@ -466,6 +495,7 @@ def main(): fem_ns_sphere.test_iter = 10 fem_ns_sphere.test_vals = [-0.288121,0.240324,0.000258,21.797363] #last 4 columns fem_ns_sphere.su2_exec = "SU2_CFD" + fem_ns_sphere.new_output = True fem_ns_sphere.timeout = 1600 fem_ns_sphere.tol = 0.00001 test_list.append(fem_ns_sphere) @@ -477,6 +507,8 @@ def main(): fem_ns_sphere_ader.test_iter = 10 fem_ns_sphere_ader.test_vals = [-35.000000,-35.000000,0.000047,31.110911] #last 4 columns fem_ns_sphere_ader.su2_exec = "SU2_CFD" + fem_ns_sphere_ader.new_output = True + fem_ns_sphere_ader.unsteady = True fem_ns_sphere_ader.timeout = 1600 fem_ns_sphere_ader.tol = 0.00001 test_list.append(fem_ns_sphere_ader) @@ -485,9 +517,11 @@ def main(): fem_ns_unsteady_cylinder = TestCase('fem_ns_unsteady_cylinder') fem_ns_unsteady_cylinder.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder.cfg_file = "fem_unst_cylinder.cfg" - fem_ns_unsteady_cylinder.test_iter = 10 + fem_ns_unsteady_cylinder.test_iter = 11 fem_ns_unsteady_cylinder.test_vals = [-3.558582,-3.014464,-0.038927,1.383983] #last 4 columns fem_ns_unsteady_cylinder.su2_exec = "SU2_CFD" + fem_ns_unsteady_cylinder.new_output = True + fem_ns_unsteady_cylinder.unsteady = True fem_ns_unsteady_cylinder.timeout = 1600 fem_ns_unsteady_cylinder.tol = 0.00001 test_list.append(fem_ns_unsteady_cylinder) @@ -496,9 +530,11 @@ def main(): fem_ns_unsteady_cylinder_ader = TestCase('fem_ns_unsteady_cylinder_ader') fem_ns_unsteady_cylinder_ader.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder_ader.cfg_file = "fem_unst_cylinder_ADER.cfg" - fem_ns_unsteady_cylinder_ader.test_iter = 10 + fem_ns_unsteady_cylinder_ader.test_iter = 11 fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000,-35.000000,-0.041003,1.391339] #last 4 columns fem_ns_unsteady_cylinder_ader.su2_exec = "SU2_CFD" + fem_ns_unsteady_cylinder_ader.new_output = True + fem_ns_unsteady_cylinder_ader.unsteady = True fem_ns_unsteady_cylinder_ader.timeout = 1600 fem_ns_unsteady_cylinder_ader.tol = 0.00001 test_list.append(fem_ns_unsteady_cylinder_ader) @@ -512,6 +548,7 @@ def main(): schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff" schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" schubauer_klebanoff_transition.test_iter = 10 + schubauer_klebanoff_transition.new_output = True schubauer_klebanoff_transition.test_vals = [-8.029756, -14.278066, 0.000053, 0.007986] #last 4 columns schubauer_klebanoff_transition.su2_exec = "SU2_CFD" schubauer_klebanoff_transition.timeout = 1600 @@ -529,6 +566,7 @@ def main(): contadj_naca0012.test_iter = 5 contadj_naca0012.test_vals = [-9.787554, -15.192510, 3.0092e-01, 1.9552e-02] #last 4 columns contadj_naca0012.su2_exec = "SU2_CFD" + contadj_naca0012.new_output = True contadj_naca0012.timeout = 1600 contadj_naca0012.tol = 0.001 test_list.append(contadj_naca0012) @@ -540,6 +578,7 @@ def main(): contadj_oneram6.test_iter = 10 contadj_oneram6.test_vals = [-12.133160, -12.706697, 0.685900, 0.007594] #last 4 columns contadj_oneram6.su2_exec = "SU2_CFD" + contadj_oneram6.new_output = True contadj_oneram6.timeout = 1600 contadj_oneram6.tol = 0.00001 test_list.append(contadj_oneram6) @@ -551,6 +590,7 @@ def main(): contadj_wedge.test_iter = 10 contadj_wedge.test_vals = [2.856008, -2.767216, 1.0029e+06, 1.3024e-13] #last 4 columns contadj_wedge.su2_exec = "SU2_CFD" + contadj_wedge.new_output = True contadj_wedge.timeout = 1600 contadj_wedge.tol = 0.00001 test_list.append(contadj_wedge) @@ -560,8 +600,9 @@ def main(): contadj_fixedCL_naca0012.cfg_dir = "fixed_cl/naca0012" contadj_fixedCL_naca0012.cfg_file = "inv_NACA0012_ContAdj.cfg" contadj_fixedCL_naca0012.test_iter = 100 - contadj_fixedCL_naca0012.test_vals = [0.341038, -5.166613, 0.265510, -0.000322] #last 4 columns + contadj_fixedCL_naca0012.test_vals = [0.340921, -5.166616, 0.265490, -0.000324] #last 4 columns contadj_fixedCL_naca0012.su2_exec = "SU2_CFD" + contadj_fixedCL_naca0012.new_output= True contadj_fixedCL_naca0012.timeout = 1600 contadj_fixedCL_naca0012.tol = 0.00001 test_list.append(contadj_fixedCL_naca0012) @@ -577,6 +618,7 @@ def main(): contadj_ns_cylinder.test_iter = 20 contadj_ns_cylinder.test_vals = [ -3.665848, -9.132055, 2.056700, -0.000000] #last 4 columns contadj_ns_cylinder.su2_exec = "SU2_CFD" + contadj_ns_cylinder.new_output = True contadj_ns_cylinder.timeout = 1600 contadj_ns_cylinder.tol = 0.00001 test_list.append(contadj_ns_cylinder) @@ -588,6 +630,7 @@ def main(): contadj_ns_naca0012_sub.test_iter = 20 contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] #last 4 columns contadj_ns_naca0012_sub.su2_exec = "SU2_CFD" + contadj_ns_naca0012_sub.new_output =True contadj_ns_naca0012_sub.timeout = 1600 contadj_ns_naca0012_sub.tol = 0.00001 test_list.append(contadj_ns_naca0012_sub) @@ -599,6 +642,7 @@ def main(): contadj_ns_naca0012_trans.test_iter = 20 contadj_ns_naca0012_trans.test_vals = [-1.039664, -6.575019, 1.772300, 0.012495] #last 4 columns contadj_ns_naca0012_trans.su2_exec = "SU2_CFD" + contadj_ns_naca0012_trans.new_output = True contadj_ns_naca0012_trans.timeout = 1600 contadj_ns_naca0012_trans.tol = 0.00001 test_list.append(contadj_ns_naca0012_trans) @@ -614,6 +658,7 @@ def main(): contadj_rans_naca0012.test_iter = 20 contadj_rans_naca0012.test_vals = [ -0.794162, -5.761722, 19.214000, -0.000000] #last 4 columns contadj_rans_naca0012.su2_exec = "SU2_CFD" + contadj_rans_naca0012.new_output = True contadj_rans_naca0012.timeout = 1600 contadj_rans_naca0012.tol = 0.00001 test_list.append(contadj_rans_naca0012) @@ -622,9 +667,10 @@ def main(): contadj_rans_naca0012_bin = TestCase('contadj_rans_naca0012_bin') contadj_rans_naca0012_bin.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012_bin.cfg_file = "turb_nasa_binary.cfg" - contadj_rans_naca0012_bin.test_iter = 20 + contadj_rans_naca0012_bin.test_iter = 18 contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] #last 4 columns contadj_rans_naca0012_bin.su2_exec = "SU2_CFD" + contadj_rans_naca0012_bin.new_output = True contadj_rans_naca0012_bin.timeout = 1600 contadj_rans_naca0012_bin.tol = 0.00001 test_list.append(contadj_rans_naca0012_bin) @@ -636,6 +682,7 @@ def main(): contadj_rans_rae2822.test_iter = 20 contadj_rans_rae2822.test_vals = [-5.369688, -10.872209, -0.212470, 0.005448] #last 4 columns contadj_rans_rae2822.su2_exec = "SU2_CFD" + contadj_rans_rae2822.new_output = True contadj_rans_rae2822.timeout = 1600 contadj_rans_rae2822.tol = 0.00001 test_list.append(contadj_rans_rae2822) @@ -651,6 +698,7 @@ def main(): turb_naca0012_1c.test_iter = 10 turb_naca0012_1c.test_vals = [-4.946093, 1.262346, 5.578729, 2.059523] #last 4 columns turb_naca0012_1c.su2_exec = "SU2_CFD" + turb_naca0012_1c.new_output = True turb_naca0012_1c.timeout = 1600 turb_naca0012_1c.tol = 0.00001 test_list.append(turb_naca0012_1c) @@ -662,6 +710,7 @@ def main(): turb_naca0012_2c.test_iter = 10 turb_naca0012_2c.test_vals = [-5.343130, 1.137800, 5.337441, 1.919677] #last 4 columns turb_naca0012_2c.su2_exec = "SU2_CFD" + turb_naca0012_2c.new_output = True turb_naca0012_2c.timeout = 1600 turb_naca0012_2c.tol = 0.00001 test_list.append(turb_naca0012_2c) @@ -673,6 +722,7 @@ def main(): turb_naca0012_3c.test_iter = 10 turb_naca0012_3c.test_vals = [-5.421229, 1.099570, 5.184366, 1.835606] #last 4 columns turb_naca0012_3c.su2_exec = "SU2_CFD" + turb_naca0012_3c.new_output = True turb_naca0012_3c.timeout = 1600 turb_naca0012_3c.tol = 0.00001 test_list.append(turb_naca0012_3c) @@ -684,6 +734,7 @@ def main(): turb_naca0012_p1c1.test_iter = 10 turb_naca0012_p1c1.test_vals = [-5.021820, 1.281103, 5.960923, 2.302704] #last 4 columns turb_naca0012_p1c1.su2_exec = "SU2_CFD" + turb_naca0012_p1c1.new_output = True turb_naca0012_p1c1.timeout = 1600 turb_naca0012_p1c1.tol = 0.00001 test_list.append(turb_naca0012_p1c1) @@ -695,6 +746,7 @@ def main(): turb_naca0012_p1c2.test_iter = 10 turb_naca0012_p1c2.test_vals = [-5.356937, 1.155037, 5.636379, 2.088827] #last 4 columns turb_naca0012_p1c2.su2_exec = "SU2_CFD" + turb_naca0012_p1c2.new_output = True turb_naca0012_p1c2.timeout = 1600 turb_naca0012_p1c2.tol = 0.00001 test_list.append(turb_naca0012_p1c2) @@ -710,6 +762,7 @@ def main(): harmonic_balance.test_iter = 25 harmonic_balance.test_vals = [-1.592454, 3.916019, -0.001014, 0.096794] #last 4 columns harmonic_balance.su2_exec = "SU2_CFD" + harmonic_balance.new_output = False harmonic_balance.timeout = 1600 harmonic_balance.tol = 0.00001 test_list.append(harmonic_balance) @@ -721,6 +774,7 @@ def main(): hb_rans_preconditioning.test_iter = 25 hb_rans_preconditioning.test_vals = [-1.900982, -5.880438, 0.007758, 0.125934] #last 4 columns hb_rans_preconditioning.su2_exec = "SU2_CFD" + hb_rans_preconditioning.new_output= False hb_rans_preconditioning.timeout = 1600 hb_rans_preconditioning.tol = 0.00001 test_list.append(hb_rans_preconditioning) @@ -736,6 +790,7 @@ def main(): cavity.test_iter = 25 cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547034] #last 4 columns cavity.su2_exec = "SU2_CFD" + cavity.new_output = True cavity.timeout = 1600 cavity.tol = 0.00001 test_list.append(cavity) @@ -747,6 +802,7 @@ def main(): spinning_cylinder.test_iter = 25 spinning_cylinder.test_vals = [-7.719673, -2.279643, 1.721389, 1.710467] #last 4 columns spinning_cylinder.su2_exec = "SU2_CFD" + spinning_cylinder.new_output = True spinning_cylinder.timeout = 1600 spinning_cylinder.tol = 0.00001 test_list.append(spinning_cylinder) @@ -765,6 +821,7 @@ def main(): square_cylinder.timeout = 1600 square_cylinder.tol = 0.00001 square_cylinder.unsteady = True + square_cylinder.new_output = True test_list.append(square_cylinder) # Gust @@ -777,6 +834,7 @@ def main(): sine_gust.timeout = 1600 sine_gust.tol = 0.00001 sine_gust.unsteady = True + sine_gust.new_output = True test_list.append(sine_gust) # Aeroelastic @@ -787,8 +845,9 @@ def main(): aeroelastic.test_vals = [0.080202, 0.033233, -0.001666, -0.000155] #last 4 columns aeroelastic.su2_exec = "SU2_CFD" aeroelastic.timeout = 1600 - aeroelastic.tol = 0.000001 + aeroelastic.tol = 0.00001 aeroelastic.unsteady = True + aeroelastic.new_output = True test_list.append(aeroelastic) # Delayed Detached Eddy Simulation @@ -801,6 +860,7 @@ def main(): ddes_flatplate.timeout = 1600 ddes_flatplate.tol = 0.00001 ddes_flatplate.unsteady = True + ddes_flatplate.new_output = True test_list.append(ddes_flatplate) # unsteady pitching NACA0015, SA @@ -808,7 +868,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.734989, -7.016510, 1.176112, 0.282917] #last 4 columns + unst_inc_turb_naca0015_sa.test_vals = [ -2.994996, -6.865786, 1.434864, 0.416627] #last 4 columns unst_inc_turb_naca0015_sa.su2_exec = "SU2_CFD" unst_inc_turb_naca0015_sa.timeout = 1600 unst_inc_turb_naca0015_sa.tol = 0.00001 @@ -826,6 +886,7 @@ def main(): ls89_sa.test_iter = 20 ls89_sa.test_vals = [-5.046850, -13.386345, 0.174911, 0.430700] #last 4 columns ls89_sa.su2_exec = "SU2_CFD" + ls89_sa.new_output= True ls89_sa.timeout = 1600 ls89_sa.tol = 0.00001 test_list.append(ls89_sa) @@ -837,6 +898,7 @@ def main(): edge_VW.test_iter = 20 edge_VW.test_vals = [-0.711006, 5.491025, -0.000971, 0.000000] #last 4 columns edge_VW.su2_exec = "SU2_CFD" + edge_VW.new_output = True edge_VW.timeout = 1600 edge_VW.tol = 0.00001 test_list.append(edge_VW) @@ -848,6 +910,7 @@ def main(): edge_PPR.test_iter = 20 edge_PPR.test_vals = [-1.671554, 4.521719, 0.001027, 0.000000] #last 4 columns edge_PPR.su2_exec = "SU2_CFD" + edge_PPR.new_output = True edge_PPR.timeout = 1600 edge_PPR.tol = 0.00001 test_list.append(edge_PPR) @@ -864,6 +927,7 @@ def main(): Jones_tc.test_iter = 5 Jones_tc.test_vals = [-5.301588, 0.418684, 78.467650, 0.990182] #last 4 columns Jones_tc.su2_exec = "SU2_CFD" + Jones_tc.new_output = False Jones_tc.timeout = 1600 Jones_tc.tol = 0.00001 test_list.append(Jones_tc) @@ -875,6 +939,7 @@ def main(): Jones_tc_rst.test_iter = 5 Jones_tc_rst.test_vals = [-4.344742, -1.553279, 82.250600, 2.791916] #last 4 columns Jones_tc_rst.su2_exec = "SU2_CFD" + Jones_tc_rst.new_output = False Jones_tc_rst.timeout = 1600 Jones_tc_rst.tol = 0.00001 test_list.append(Jones_tc_rst) @@ -886,6 +951,7 @@ def main(): axial_stage2D.test_iter = 20 axial_stage2D.test_vals = [-1.790262, 5.696645, 73.362820, 0.904310] #last 4 columns axial_stage2D.su2_exec = "SU2_CFD" + axial_stage2D.new_output = False axial_stage2D.timeout = 1600 axial_stage2D.tol = 0.00001 test_list.append(axial_stage2D) @@ -897,6 +963,7 @@ def main(): transonic_stator.test_iter = 20 transonic_stator.test_vals = [-1.201657, 6.150672, 96.239670, 0.062740] #last 4 columns transonic_stator.su2_exec = "SU2_CFD" + transonic_stator.new_output = False transonic_stator.timeout = 1600 transonic_stator.tol = 0.00001 test_list.append(transonic_stator) @@ -908,6 +975,7 @@ def main(): transonic_stator_rst.test_iter = 20 transonic_stator_rst.test_vals = [-8.248816, -2.976167, 5.285722, 0.003100] #last 4 columns transonic_stator_rst.su2_exec = "SU2_CFD" + transonic_stator_rst.new_output = False transonic_stator_rst.timeout = 1600 transonic_stator_rst.tol = 0.00001 test_list.append(transonic_stator_rst) @@ -921,24 +989,26 @@ def main(): uniform_flow = TestCase('uniform_flow') uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" - uniform_flow.test_iter = 50 - uniform_flow.test_vals = [-0.367892, 5.156945, 0.000000, 0.000000] #last 4 columns + uniform_flow.test_iter = 2 + uniform_flow.test_vals = [2.000000, 0.000000, -0.205134, -13.254849] #last 4 columns uniform_flow.su2_exec = "SU2_CFD" uniform_flow.timeout = 1600 uniform_flow.tol = 0.000001 uniform_flow.unsteady = True + uniform_flow.multizone = True test_list.append(uniform_flow) - # Channel_2D + # Channel_2D channel_2D = TestCase('channel_2D') channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" - channel_2D.test_iter = 4 - channel_2D.test_vals = [-1.655354, 4.263889, 0.000000, 0.000000] #last 4 columns + channel_2D.test_iter = 2 + channel_2D.test_vals = [2.000000, 0.000000, 0.399677, 0.351915, 0.405680] #last 4 columns channel_2D.su2_exec = "SU2_CFD" channel_2D.timeout = 100 channel_2D.tol = 0.00001 channel_2D.unsteady = True + channel_2D.multizone = True test_list.append(channel_2D) # Channel_3D @@ -946,11 +1016,12 @@ def main(): channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_WA.cfg" channel_3D.test_iter = 1 - channel_3D.test_vals = [-1.901349, 4.033664, 0.000000, 0.000000] #last 4 columns + channel_3D.test_vals = [1.000000, 0.000000, 0.671143, 0.781742, 0.712844] #last 5 columns channel_3D.su2_exec = "SU2_CFD" channel_3D.timeout = 1600 channel_3D.tol = 0.00001 channel_3D.unsteady = True + channel_3D.multizone = True test_list.append(channel_3D) # Pipe @@ -958,11 +1029,12 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [-3.504317, 3.194211, 0.000000, 0.000000] #last 4 columns + pipe.test_vals = [0.491948, 0.676394, 0.974444, 1.024041] #last 4 columns pipe.su2_exec = "SU2_CFD" pipe.timeout = 1600 pipe.tol = 0.00001 pipe.unsteady = True + pipe.multizone = True test_list.append(pipe) # Rotating cylinders @@ -970,11 +1042,12 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [-1.149732, 4.619521, 0.000000, 0.000000] #last 4 columns + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.754350, 1.111514, 1.194297] #last 4 columns rotating_cylinders.su2_exec = "SU2_CFD" rotating_cylinders.timeout = 1600 rotating_cylinders.tol = 0.00001 rotating_cylinders.unsteady = True + rotating_cylinders.multizone = True test_list.append(rotating_cylinders) # Supersonic vortex shedding @@ -982,11 +1055,12 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [-0.211274, 5.611055, 0.000000, 0.000000] #last 4 columns + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.220867, 1.568306] #last 4 columns supersonic_vortex_shedding.su2_exec = "SU2_CFD" supersonic_vortex_shedding.timeout = 1600 supersonic_vortex_shedding.tol = 0.00001 supersonic_vortex_shedding.unsteady = True + supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) # Bars_SST_2D @@ -994,10 +1068,11 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [-2.132032, 1.651883, -0.000830, 0.117497] #last 4 columns + bars_SST_2D.test_vals = [13.000000, -0.719501, -1.608959] #last 3 columns bars_SST_2D.su2_exec = "SU2_CFD" bars_SST_2D.timeout = 1600 bars_SST_2D.tol = 0.00001 + bars_SST_2D.multizone = True test_list.append(bars_SST_2D) # Sliding mesh with incompressible flows (steady) @@ -1005,10 +1080,11 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [-4.214657,1.265231,0.000000,0.000000] #last 4 columns + slinc_steady.test_vals = [19.000000, -1.766116, -2.206522] #last 3 columns slinc_steady.su2_exec = "SU2_CFD" slinc_steady.timeout = 100 slinc_steady.tol = 0.00001 + slinc_steady.multizone = True test_list.append(slinc_steady) # Sliding mesh with incompressible flows (unsteady) @@ -1031,6 +1107,7 @@ def main(): statbeam3d = TestCase('statbeam3d') statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" + statbeam3d.new_output= True statbeam3d.test_iter = 0 statbeam3d.test_vals = [-8.498245, -8.230816, -8.123810, 64095.0] #last 4 columns statbeam3d.su2_exec = "SU2_CFD" @@ -1053,21 +1130,25 @@ def main(): dynbeam2d = TestCase('dynbeam2d') dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" + dynbeam2d.unsteady = True + dynbeam2d.new_output= True dynbeam2d.test_iter = 6 - dynbeam2d.test_vals = [-9.420640, -5.365872, -12.430382, 6.5210e+04] #last 4 columns + dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 6.6127e+04] #last 4 columns dynbeam2d.su2_exec = "SU2_CFD" dynbeam2d.timeout = 1600 dynbeam2d.tol = 0.00001 test_list.append(dynbeam2d) - # FSI, 2d + # # FSI, 2d fsi2d = TestCase('fsi2d') fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [2.000000, 0.500000, -6.878090, -0.260609] #last 4 columns + fsi2d.test_vals = [4.000000, 0.000000, -3.801272, -4.123970] #last 4 columns fsi2d.su2_exec = "SU2_CFD" fsi2d.timeout = 1600 + fsi2d.multizone = True + fsi2d.unsteady = True fsi2d.tol = 0.00001 test_list.append(fsi2d) @@ -1075,10 +1156,11 @@ def main(): stat_fsi = TestCase('stat_fsi') stat_fsi.cfg_dir = "fea_fsi/stat_fsi" stat_fsi.cfg_file = "config.cfg" - stat_fsi.test_iter = 5000 - stat_fsi.test_vals = [-5.965844, -5.549896, -8.815105, -9.507963] #last 4 columns + stat_fsi.test_iter = 7 + stat_fsi.test_vals = [-3.322483, -4.978664, 0.000000, 47.000000] #last 5 columns stat_fsi.su2_exec = "SU2_CFD" stat_fsi.timeout = 1600 + stat_fsi.multizone = True stat_fsi.tol = 0.00001 test_list.append(stat_fsi) @@ -1086,8 +1168,9 @@ def main(): stat_fsi_restart = TestCase('stat_fsi_restart') stat_fsi_restart.cfg_dir = "fea_fsi/stat_fsi" stat_fsi_restart.cfg_file = "config_restart.cfg" - stat_fsi_restart.test_iter = 3000 - stat_fsi_restart.test_vals = [-9.371585, -9.025672, -11.623159, -12.610272] #last 4 columns + stat_fsi_restart.test_iter = 1 + stat_fsi_restart.test_vals = [-3.407098, -4.248366, 0.000000, 47.000000] #last 5 columns + stat_fsi_restart.multizone = True stat_fsi_restart.su2_exec = "SU2_CFD" stat_fsi_restart.timeout = 1600 stat_fsi_restart.tol = 0.00001 @@ -1097,8 +1180,10 @@ def main(): dyn_fsi = TestCase('dyn_fsi') dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" - dyn_fsi.test_iter = 4000 - dyn_fsi.test_vals = [-4.709724, -2.913229, -7.186948, -8.186820] #last 4 columns + dyn_fsi.test_iter = 4 + dyn_fsi.test_vals = [-4.389732, -4.060110, 0.000000, 59.000000] #last 5 columns + dyn_fsi.multizone = True + dyn_fsi.unsteady = True dyn_fsi.su2_exec = "SU2_CFD" dyn_fsi.timeout = 1600 dyn_fsi.tol = 0.00001 @@ -1108,26 +1193,28 @@ def main(): airfoilRBF = TestCase('airfoil_fsi_rbf') airfoilRBF.cfg_dir = "fea_fsi/Airfoil_RBF" airfoilRBF.cfg_file = "config.cfg" - airfoilRBF.test_iter = 19 - airfoilRBF.test_vals = [-10.592268, -6.311998, -16.845204, 1.3902e+06] #last 4 columns + airfoilRBF.test_iter = 0 + airfoilRBF.test_vals = [0.000000, 1.440246, -2.236518] #last 4 columns airfoilRBF.su2_exec = "SU2_CFD" airfoilRBF.timeout = 1600 + airfoilRBF.multizone = True airfoilRBF.tol = 0.00001 test_list.append(airfoilRBF) - ########################## - ### Zonal multiphysics ### - ########################## + # ########################## + # ### Zonal multiphysics ### + # ########################## # CHT incompressible cht_incompressible = TestCase('cht_incompressible') cht_incompressible.cfg_dir = "coupled_cht/incompressible" cht_incompressible.cfg_file = "config.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [0.000000, 0.000000, -8.530925, -3091.634678] #last 4 columns + cht_incompressible.test_vals = [10.000000, -2.601006, -3.342894] #last 4 columns cht_incompressible.su2_exec = "SU2_CFD" cht_incompressible.timeout = 1600 - cht_incompressible.tol = 0.0001 + cht_incompressible.multizone = True + cht_incompressible.tol = 0.00001 test_list.append(cht_incompressible) ############################################## @@ -1408,6 +1495,7 @@ def main(): contadj_euler_py.timeout = 1600 contadj_euler_py.reference_file = "of_grad_cd.dat.ref" contadj_euler_py.test_file = "of_grad_cd.dat" + contadj_euler_py.new_output = True pass_list.append(contadj_euler_py.run_filediff()) test_list.append(contadj_euler_py) @@ -1419,6 +1507,7 @@ def main(): shape_opt_euler_py.test_vals = [1, 1, 2.134974E-05, 0.003847] #last 4 columns shape_opt_euler_py.su2_exec = "shape_optimization.py -g CONTINUOUS_ADJOINT -f" shape_opt_euler_py.timeout = 1600 + shape_opt_euler_py.new_output = True shape_opt_euler_py.tol = 0.00001 pass_list.append(shape_opt_euler_py.run_opt()) test_list.append(shape_opt_euler_py) @@ -1430,6 +1519,7 @@ def main(): contadj_multi_py.test_iter = 10 contadj_multi_py.su2_exec = "continuous_adjoint.py" contadj_multi_py.timeout = 1600 + contadj_multi_py.new_output = True contadj_multi_py.reference_file = "of_grad_combo.dat.ref" contadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(contadj_multi_py.run_filediff()) @@ -1438,28 +1528,28 @@ def main(): # Optimization with multiple objectives, with gradients evaluated individually # the difference in gradient value relative to combined case # is due to lack of solution file for the adjoint and small number of iterations - opt_multiobj_py = TestCase('opt_multiobj_py') - opt_multiobj_py.cfg_dir = "optimization_euler/multiobjective_wedge" - opt_multiobj_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" - opt_multiobj_py.test_iter = 1 - opt_multiobj_py.test_vals = [1.000000, 1.000000, 108.011100, 2.191747] #last 4 columns - opt_multiobj_py.su2_exec = "shape_optimization.py -g CONTINUOUS_ADJOINT -f" - opt_multiobj_py.timeout = 1600 - opt_multiobj_py.tol = 0.00001 - pass_list.append(opt_multiobj_py.run_opt()) - test_list.append(opt_multiobj_py) - - # test optimization, with multiple objectives and gradient evaluated as 'combo' - opt_multiobjcombo_py = TestCase('opt_multiobjcombo_py') - opt_multiobjcombo_py.cfg_dir = "optimization_euler/multiobjective_wedge" - opt_multiobjcombo_py.cfg_file = "inv_wedge_ROE_multiobj_combo.cfg" - opt_multiobjcombo_py.test_iter = 1 - opt_multiobjcombo_py.test_vals = [1.000000, 1.000000, 108.011100, 2.226539] #last 4 columns - opt_multiobjcombo_py.su2_exec = "shape_optimization.py -g CONTINUOUS_ADJOINT -f" - opt_multiobjcombo_py.timeout = 1600 - opt_multiobjcombo_py.tol = 0.00001 - pass_list.append(opt_multiobjcombo_py.run_opt()) - test_list.append(opt_multiobjcombo_py) +# opt_multiobj_py = TestCase('opt_multiobj_py') +# opt_multiobj_py.cfg_dir = "optimization_euler/multiobjective_wedge" +# opt_multiobj_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" +# opt_multiobj_py.test_iter = 1 +# opt_multiobj_py.test_vals = [1, 1, 1.084701E+02, 3.799222E+00] #last 4 columns +# opt_multiobj_py.su2_exec = "shape_optimization.py -g CONTINUOUS_ADJOINT -f" +# opt_multiobj_py.timeout = 1600 +# opt_multiobj_py.tol = 0.00001 +# pass_list.append(opt_multiobj_py.run_opt()) +# test_list.append(opt_multiobj_py) +# +# # test optimization, with multiple objectives and gradient evaluated as 'combo' +# opt_multiobjcombo_py = TestCase('opt_multiobjcombo_py') +# opt_multiobjcombo_py.cfg_dir = "optimization_euler/multiobjective_wedge" +# opt_multiobjcombo_py.cfg_file = "inv_wedge_ROE_multiobj_combo.cfg" +# opt_multiobjcombo_py.test_iter = 1 +# opt_multiobjcombo_py.test_vals = [1, 1, 1.084701E+02, 3.789322E+00] #last 4 columns +# opt_multiobjcombo_py.su2_exec = "shape_optimization.py -g CONTINUOUS_ADJOINT -f" +# opt_multiobjcombo_py.timeout = 1600 +# opt_multiobjcombo_py.tol = 0.00001 +# pass_list.append(opt_multiobjcombo_py.run_opt()) +# test_list.append(opt_multiobjcombo_py) # test optimization, with multiple objectives evaluated on a single surface opt_multiobj1surf_py = TestCase('opt_multiobj1surf_py') @@ -1496,6 +1586,7 @@ def main(): pywrapper_naca0012.test_iter = 20 pywrapper_naca0012.test_vals = [-4.021036, -3.511771, 0.339316, 0.022257] #last 4 columns pywrapper_naca0012.su2_exec = "SU2_CFD.py -f" + pywrapper_naca0012.new_output = True pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 test_list.append(pywrapper_naca0012) @@ -1508,6 +1599,7 @@ def main(): pywrapper_turb_naca0012_sst.test_iter = 10 pywrapper_turb_naca0012_sst.test_vals = [-12.454420, -6.572026, 1.059622, 0.019138] #last 4 columns pywrapper_turb_naca0012_sst.su2_exec = "SU2_CFD.py -f" + pywrapper_turb_naca0012_sst.new_output = True pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 test_list.append(pywrapper_turb_naca0012_sst) @@ -1533,8 +1625,9 @@ def main(): pywrapper_aeroelastic.test_iter = 2 pywrapper_aeroelastic.test_vals = [0.080202, 0.033233, -0.001666, -0.000155] #last 4 columns pywrapper_aeroelastic.su2_exec = "SU2_CFD.py -f" + pywrapper_aeroelastic.new_output = True pywrapper_aeroelastic.timeout = 1600 - pywrapper_aeroelastic.tol = 0.000001 + pywrapper_aeroelastic.tol = 0.00001 pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) pass_list.append(pywrapper_aeroelastic.run_test()) @@ -1544,8 +1637,11 @@ def main(): pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI.cfg" pywrapper_fsi2d.test_iter = 4 - pywrapper_fsi2d.test_vals = [2.000000, 0.500000, -6.878090, -0.260609] #last 4 columns + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.801272, -4.123970] #last 4 columns pywrapper_fsi2d.su2_exec = "SU2_CFD.py --nZone 2 --fsi True -f" + pywrapper_fsi2d.new_output = True + pywrapper_fsi2d.unsteady = True + pywrapper_fsi2d.multizone = True pywrapper_fsi2d.timeout = 1600 pywrapper_fsi2d.tol = 0.00001 test_list.append(pywrapper_fsi2d) @@ -1559,6 +1655,7 @@ def main(): pywrapper_unsteadyCHT.test_vals = [-1.598116, 2.263309, 0.001077, 0.145818] #last 4 columns pywrapper_unsteadyCHT.su2_exec = "python launch_unsteady_CHT_FlatPlate.py -f" pywrapper_unsteadyCHT.timeout = 1600 + pywrapper_unsteadyCHT.new_output = True pywrapper_unsteadyCHT.tol = 0.00001 pywrapper_unsteadyCHT.unsteady = True test_list.append(pywrapper_unsteadyCHT) @@ -1569,8 +1666,9 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.598116, 2.259671, -0.040621, 0.144134] #last 4 columns + pywrapper_rigidMotion.test_vals = [-1.598116, 2.259671, -0.040632, 0.144135] #last 4 columns pywrapper_rigidMotion.su2_exec = "python launch_flatPlate_rigidMotion.py -f" + pywrapper_rigidMotion.new_output = True pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 pywrapper_rigidMotion.unsteady = True diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 8a1026ea8707..bbe94ac14f5d 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -79,7 +79,7 @@ def main(): discadj_arina2k.cfg_dir = "disc_adj_euler/arina2k" discadj_arina2k.cfg_file = "Arina2KRS.cfg" discadj_arina2k.test_iter = 20 - discadj_arina2k.test_vals = [-0.779038, -0.816868, 319.800000, 0.000000] #last 4 columns + discadj_arina2k.test_vals = [2.244006, 1.701303, 47250.000000, 0.000000]#last 4 columns discadj_arina2k.su2_exec = "SU2_CFD_AD" discadj_arina2k.timeout = 8400 discadj_arina2k.tol = 0.00001 @@ -105,7 +105,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-1.654903, -0.491485, 0.109157, 0.000011] #last 4 columns + discadj_rans_naca0012_sst.test_vals = [-1.654903, -0.491485, 0.109160, 0.000011] #last 4 columns discadj_rans_naca0012_sst.su2_exec = "SU2_CFD_AD" discadj_rans_naca0012_sst.timeout = 1600 discadj_rans_naca0012_sst.tol = 0.00001 @@ -120,7 +120,7 @@ def main(): discadj_incomp_NACA0012.cfg_dir = "disc_adj_incomp_euler/naca0012" discadj_incomp_NACA0012.cfg_file = "incomp_NACA0012_disc.cfg" discadj_incomp_NACA0012.test_iter = 20 - discadj_incomp_NACA0012.test_vals = [-3.606555, -2.538181, 0.000000, 0.000000] #last 4 columns + discadj_incomp_NACA0012.test_vals = [20.000000, -3.606555, -2.538181, 0.000000] #last 4 columns discadj_incomp_NACA0012.su2_exec = "SU2_CFD_AD" discadj_incomp_NACA0012.timeout = 1600 discadj_incomp_NACA0012.tol = 0.00001 @@ -135,7 +135,7 @@ def main(): discadj_incomp_cylinder.cfg_dir = "disc_adj_incomp_navierstokes/cylinder" discadj_incomp_cylinder.cfg_file = "heated_cylinder.cfg" discadj_incomp_cylinder.test_iter = 20 - discadj_incomp_cylinder.test_vals = [-2.374306, -2.371564, 0.000000, 0.000000] #last 4 columns + discadj_incomp_cylinder.test_vals = [20.000000, -2.374306, -2.371564, 0.000000] #last 4 columns discadj_incomp_cylinder.su2_exec = "SU2_CFD_AD" discadj_incomp_cylinder.timeout = 1600 discadj_incomp_cylinder.tol = 0.00001 @@ -150,7 +150,7 @@ def main(): discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" discadj_incomp_turb_NACA0012_sa.test_iter = 10 - discadj_incomp_turb_NACA0012_sa.test_vals = [-3.845979, -1.031094, 0.000000, 0.000000] #last 4 columns + discadj_incomp_turb_NACA0012_sa.test_vals = [10.000000, -3.845979, -1.031095, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sa.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sa.timeout = 1600 discadj_incomp_turb_NACA0012_sa.tol = 0.00001 @@ -161,7 +161,7 @@ def main(): discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 - discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845759, -2.416668, 0.000000, 0.000000] #last 4 columns + discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845759, -2.416670, -8.430657, 0.000000] #last 4 columns discadj_incomp_turb_NACA0012_sst.su2_exec = "SU2_CFD_AD" discadj_incomp_turb_NACA0012_sst.timeout = 1600 discadj_incomp_turb_NACA0012_sst.tol = 0.00001 @@ -208,7 +208,7 @@ def main(): discadj_pitchingNACA0012.cfg_dir = "disc_adj_euler/naca0012_pitching" discadj_pitchingNACA0012.cfg_file = "inv_NACA0012_pitching.cfg" discadj_pitchingNACA0012.test_iter = 4 - discadj_pitchingNACA0012.test_vals = [-2.650611, -3.119337, -0.000687, 0.000001] #last 4 columns + discadj_pitchingNACA0012.test_vals = [-1.170348, -1.639086, -0.020749, 0.000040] #last 4 columns discadj_pitchingNACA0012.su2_exec = "SU2_CFD_AD" discadj_pitchingNACA0012.timeout = 1600 discadj_pitchingNACA0012.tol = 0.00001 @@ -224,7 +224,7 @@ def main(): discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 9 - discadj_fea.test_vals = [-6.319841, -6.375512, -0.000364, -8.708700] #last 4 columns + discadj_fea.test_vals = [-6.319841, -6.375512, -0.000364, -8.708681] #last 4 columns discadj_fea.su2_exec = "SU2_CFD_AD" discadj_fea.timeout = 1600 discadj_fea.tol = 0.00001 @@ -239,7 +239,7 @@ def main(): discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 - discadj_heat.test_vals = [3.139355, 1.144919, -1040.637744, -2464.935518] #last 4 columns + discadj_heat.test_vals = [3.139355, 1.144919, -1040.600000, -2464.900000] #last 4 columns discadj_heat.su2_exec = "SU2_CFD_AD" discadj_heat.timeout = 1600 discadj_heat.tol = 0.00001 @@ -250,15 +250,15 @@ def main(): ################################### # Structural model - discadj_fsi = TestCase('discadj_fsi') - discadj_fsi.cfg_dir = "disc_adj_fsi" - discadj_fsi.cfg_file = "configAD_fsi.cfg" - discadj_fsi.test_iter = 3000 - discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns - discadj_fsi.su2_exec = "SU2_CFD_AD" - discadj_fsi.timeout = 1600 - discadj_fsi.tol = 0.00001 - test_list.append(discadj_fsi) +# discadj_fsi = TestCase('discadj_fsi') +# discadj_fsi.cfg_dir = "disc_adj_fsi" +# discadj_fsi.cfg_file = "configAD_fsi.cfg" +# discadj_fsi.test_iter = 3000 +# discadj_fsi.test_vals = [0.958848,-0.157183,0.658415,1.302076] #last 4 columns +# discadj_fsi.su2_exec = "SU2_CFD_AD" +# discadj_fsi.timeout = 1600 +# discadj_fsi.tol = 0.00001 +# test_list.append(discadj_fsi) ###################################### ### RUN TESTS ### @@ -319,16 +319,16 @@ def main(): test_list.append(directdiff_multiple_ffd_py) # test continuous_adjoint.py, with multiple objectives - discadj_multi_py = TestCase('discadj_multi_py') - discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" - discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" - discadj_multi_py.test_iter = 10 - discadj_multi_py.su2_exec = "discrete_adjoint.py" - discadj_multi_py.timeout = 1600 - discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" - discadj_multi_py.test_file = "of_grad_combo.dat" - pass_list.append(discadj_multi_py.run_filediff()) - test_list.append(discadj_multi_py) +# discadj_multi_py = TestCase('discadj_multi_py') +# discadj_multi_py.cfg_dir = "cont_adj_euler/wedge" +# discadj_multi_py.cfg_file = "inv_wedge_ROE_multiobj.cfg" +# discadj_multi_py.test_iter = 10 +# discadj_multi_py.su2_exec = "discrete_adjoint.py" +# discadj_multi_py.timeout = 1600 +# discadj_multi_py.reference_file = "of_grad_combo.dat.refdiscrete" +# discadj_multi_py.test_file = "of_grad_combo.dat" +# pass_list.append(discadj_multi_py.run_filediff()) +# test_list.append(discadj_multi_py) # FEA AD Flow Load Sensitivity pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_FEA_AD_FlowLoad') @@ -338,8 +338,8 @@ def main(): pywrapper_FEA_AD_FlowLoad.test_vals = [-0.13945587401579657, -0.585985886606256, -0.00036377840086080753, -0.0031005670174756375] #last 4 columns pywrapper_FEA_AD_FlowLoad.su2_exec = "python run_adjoint.py -f" pywrapper_FEA_AD_FlowLoad.timeout = 1600 - pywrapper_FEA_AD_FlowLoad.tol = 0.00001 - pywrapper_FEA_AD_FlowLoad.unsteady = True + pywrapper_FEA_AD_FlowLoad.tol = 0.000001 + pywrapper_FEA_AD_FlowLoad.new_output = False test_list.append(pywrapper_FEA_AD_FlowLoad) pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) @@ -351,8 +351,8 @@ def main(): pywrapper_FEA_AD_FlowLoad.test_vals = [30.000000, -2.518695, 1.390150, 0.000000] #last 4 columns pywrapper_FEA_AD_FlowLoad.su2_exec = "python run_adjoint.py -f" pywrapper_FEA_AD_FlowLoad.timeout = 1600 - pywrapper_FEA_AD_FlowLoad.tol = 0.00001 - pywrapper_FEA_AD_FlowLoad.unsteady = True + pywrapper_FEA_AD_FlowLoad.tol = 0.000001 + pywrapper_FEA_AD_FlowLoad.new_output = False test_list.append(pywrapper_FEA_AD_FlowLoad) pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) diff --git a/TestCases/sliding_interface/bars_SST_2D/bars.cfg b/TestCases/sliding_interface/bars_SST_2D/bars.cfg index c130765c8641..7a1a9cbdf7d9 100644 --- a/TestCases/sliding_interface/bars_SST_2D/bars.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/bars.cfg @@ -8,7 +8,15 @@ % File Version 6.2.0 "Falcon" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + MULTIZONE=YES + +TIME_DOMAIN = NO +TIME_ITER = 3 +TIME_STEP = 0.005 +INNER_ITER= 1 +OUTER_ITER = 100 % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES, @@ -171,10 +179,6 @@ CFL_ADAPT= NO % CFL max value ) CFL_ADAPT_PARAM= ( 1.5, 0.5, 0.3,20.0 ) % -% Number of total iterations -OUTER_ITER= 14 -%EXT_ITER= 1 -% % Linear solver for the implicit formulation (BCGSTAB, FGMRES) LINEAR_SOLVER= FGMRES % @@ -256,29 +260,23 @@ CFL_REDUCTION_TURB= 0.10 % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % Epsilon for full multigrid method evaluation -%FULLMG_CAUCHY_EPS= 1E-4 +%FULLMG_CONV_CAUCHY_EPS= 1E-4 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -298,25 +296,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -325,7 +323,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg b/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg index 1f650e20c188..0c11516ed457 100644 --- a/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg +++ b/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg @@ -16,6 +16,22 @@ MULTIZONE = YES % List of sub config files to specify zone specific options CONFIG_LIST= (zone_1.cfg, zone_2.cfg, zone_3.cfg) % +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 50 +% +% Inner iterations +INNER_ITER= 1 +% +WRT_ZONE_CONV=YES % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -32,17 +48,8 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 50 - % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -173,32 +180,25 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 % % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -213,22 +213,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg b/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg index c6c12d599a64..16930aa9718e 100644 --- a/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg +++ b/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg @@ -13,11 +13,25 @@ % Enable multizone mode MULTIZONE = YES % -MULTIZONE_SOLVER= BLOCK_JACOBI -% % List of sub config files to specify zone specific options CONFIG_LIST= (zone_1.cfg, zone_2.cfg, zone_3.cfg) % +% +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 50 +% +% Inner iterations +INNER_ITER= 1 +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -34,17 +48,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 50 - +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -175,32 +179,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -215,22 +211,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/channel_2D/zone_2.cfg b/TestCases/sliding_interface/channel_2D/zone_2.cfg index 08ca4f7db548..94a109497593 100644 --- a/TestCases/sliding_interface/channel_2D/zone_2.cfg +++ b/TestCases/sliding_interface/channel_2D/zone_2.cfg @@ -1,3 +1,13 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: bars in a 2D channel with interface % +% Author: A. Rubino % +% Institution: Delft University of Technology % +% Date: Feb 27th, 2017 % +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % diff --git a/TestCases/sliding_interface/channel_2D/zone_3.cfg b/TestCases/sliding_interface/channel_2D/zone_3.cfg index f3b8e38812a0..155e1c219553 100644 --- a/TestCases/sliding_interface/channel_2D/zone_3.cfg +++ b/TestCases/sliding_interface/channel_2D/zone_3.cfg @@ -1,5 +1,15 @@ -% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: bars in a 2D channel with interface % +% Author: A. Rubino % +% Institution: Delft University of Technology % +% Date: Feb 27th, 2017 % +% File Version 6.2.0 "Falcon" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % +% ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % Type of dynamic mesh (NONE, ROTATING_FRAME) GRID_MOVEMENT= RIGID_MOTION % @@ -7,9 +17,8 @@ GRID_MOVEMENT= RIGID_MOTION % with the Reynolds number and for computing force coeffs. with dynamic meshes. MACH_MOTION= 0.35 % - +% Origin of the motion MOTION_ORIGIN= 0.0 0.0 0.0 - +% % Angular velocity vector (rad/s) about the motion origi. Example 1250 RPM -> 130.89969389957471 rad/s -ROTATION_RATE = 0.0 0.0 -0.1 - +ROTATION_RATE= 0.0 0.0 -0.1 diff --git a/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg b/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg index a13bc1bbba07..bde13568ebb9 100644 --- a/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg +++ b/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg @@ -16,6 +16,21 @@ MULTIZONE= YES % List of config files to specify zone options CONFIG_LIST= (zone_1.cfg, zone_2.cfg, zone_3.cfg) % +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 20 +% +% Inner iterations +INNER_ITER= 1 +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -32,17 +47,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 20 -% +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -176,32 +181,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -216,22 +213,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg b/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg index 5ea3386b2dd8..85f5d747e11d 100644 --- a/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg +++ b/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg @@ -13,11 +13,24 @@ % Enable Multizone mode MULTIZONE= YES % -MULTIZONE_SOLVER= BLOCK_JACOBI -% % List of config files to specify zone options CONFIG_LIST= (zone_1.cfg, zone_2.cfg, zone_3.cfg) % +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 20 +% +% Inner iterations +INNER_ITER= 1 +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -34,18 +47,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 20 -% -% +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -177,32 +179,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -217,22 +211,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/channel_3D/zone_1.cfg b/TestCases/sliding_interface/channel_3D/zone_1.cfg index ce58b4fac226..a1f382bb16dc 100644 --- a/TestCases/sliding_interface/channel_3D/zone_1.cfg +++ b/TestCases/sliding_interface/channel_3D/zone_1.cfg @@ -9,16 +9,10 @@ % File Version 4.3.0 "cardinal" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% -% Type of dynamic mesh (NONE, ROTATING_FRAME) -GRID_MOVEMENT= RIGID_MOTION % -% Motion mach number (non-dimensional). Used for intitializing a viscous flow -% with the Reynolds number and for computing force coeffs. with dynamic meshes. -MACH_MOTION= 0.35 +% Dynamic mesh simulation (NO, YES) +GRID_MOVEMENT= NONE % -MOTION_ORIGIN= 0.0 0.0 0.0 - -% Angular velocity vector (rad/s) about the motion origi. Example 1250 RPM -> 130.89969389957471 rad/s -ROTATION_RATE= 0.0 0.0 0.0 diff --git a/TestCases/sliding_interface/incompressible_steady/config.cfg b/TestCases/sliding_interface/incompressible_steady/config.cfg index 726a9d964948..cfc7414fa7dd 100644 --- a/TestCases/sliding_interface/incompressible_steady/config.cfg +++ b/TestCases/sliding_interface/incompressible_steady/config.cfg @@ -14,9 +14,13 @@ SOLVER= MULTIPHYSICS CONFIG_LIST = (configOut.cfg, configCircle.cfg) MARKER_ZONE_INTERFACE= (circleOut, circleIn) +MARKER_FLUID_INTERFACE= (circleOut, circleIn) MULTIZONE_MESH= NO TIME_DOMAIN = NO -OUTER_ITER = 21 +OUTER_ITER = 2000 +WRT_ZONE_CONV=NO + +INNER_ITER=1 diff --git a/TestCases/sliding_interface/incompressible_steady/configCircle.cfg b/TestCases/sliding_interface/incompressible_steady/configCircle.cfg index 5d92b298799b..694d12ac692a 100644 --- a/TestCases/sliding_interface/incompressible_steady/configCircle.cfg +++ b/TestCases/sliding_interface/incompressible_steady/configCircle.cfg @@ -65,7 +65,6 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -EXT_ITER= 200 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% @@ -100,12 +99,10 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 12 -RESIDUAL_MINVAL= -16 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-6 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -16 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 % --------------------------- TURBULENCE PARAMETERS --------------------------% FREESTREAM_TURBULENCEINTENSITY = 0.001 @@ -118,21 +115,21 @@ MESH_FILENAME= meshCircle.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history_converge -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_ADJ_FILENAME= restart_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint WRT_SOL_FREQ= 1000 diff --git a/TestCases/sliding_interface/incompressible_steady/configOut.cfg b/TestCases/sliding_interface/incompressible_steady/configOut.cfg index b89d0da86dc7..88fecf2fb3eb 100644 --- a/TestCases/sliding_interface/incompressible_steady/configOut.cfg +++ b/TestCases/sliding_interface/incompressible_steady/configOut.cfg @@ -75,7 +75,6 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -EXT_ITER= 200 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% @@ -110,12 +109,10 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 12 -RESIDUAL_MINVAL= -16 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-6 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -16 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -124,21 +121,21 @@ MESH_FILENAME= meshOut.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_ADJ_FILENAME= restart_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint WRT_SOL_FREQ= 1000 diff --git a/TestCases/sliding_interface/incompressible_unsteady/config.cfg b/TestCases/sliding_interface/incompressible_unsteady/config.cfg index 943998ef9c1d..81a7c8bbf02b 100644 --- a/TestCases/sliding_interface/incompressible_unsteady/config.cfg +++ b/TestCases/sliding_interface/incompressible_unsteady/config.cfg @@ -18,7 +18,8 @@ MARKER_ZONE_INTERFACE= (circleOut, circleIn) MULTIZONE_MESH=NO TIME_DOMAIN = YES -TIME_ITER = 1 +TIME_ITER = 10000 TIME_STEP = 1.0 +INNER_ITER=200 OUTER_ITER = 20 diff --git a/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg b/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg index 7521bbd1f4c0..1a46e22fda5e 100644 --- a/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg +++ b/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg @@ -25,12 +25,11 @@ MULTIZONE_MESH = NO % ------------------------- UNSTEADY SIMULATION -------------------------------% -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -UNST_TIMESTEP= 1.0 -UNST_INT_ITER= 20 -UNST_RESTART_ITER = 2 -INNER_ITER = 1 -UNST_TIME= 100 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +TIME_STEP= 1.0 +INNER_ITER= 20 +RESTART_ITER = 2 +MAX_TIME= 100 % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% @@ -74,7 +73,6 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -EXT_ITER= 200 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% @@ -109,12 +107,10 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 12 -RESIDUAL_MINVAL= -16 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-6 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -16 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -123,21 +119,21 @@ MESH_FILENAME= meshCircle.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_ADJ_FILENAME= restart_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint WRT_SOL_FREQ= 1 diff --git a/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg b/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg index 69acef819cdc..b3873938ef93 100644 --- a/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg +++ b/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg @@ -25,12 +25,11 @@ MULTIZONE_MESH = NO % ------------------------- UNSTEADY SIMULATION -------------------------------% -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -UNST_TIMESTEP= 1.0 -UNST_INT_ITER= 20 -UNST_RESTART_ITER = 2 -INNER_ITER = 1 -UNST_TIME= 100 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +TIME_STEP= 1.0 +INNER_ITER= 20 +RESTART_ITER = 2 +MAX_TIME= 100 % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% @@ -84,7 +83,6 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 15.0, 1e10) MAX_DELTA_TIME= 1E6 RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -EXT_ITER= 200 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% @@ -119,12 +117,10 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 12 -RESIDUAL_MINVAL= -16 -STARTCONV_ITER= 10 -CAUCHY_ELEMS= 100 -CAUCHY_EPS= 1E-6 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -16 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -133,21 +129,21 @@ MESH_FILENAME= meshOut.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV CONV_FILENAME= history -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat RESTART_ADJ_FILENAME= restart_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint WRT_SOL_FREQ= 1 diff --git a/TestCases/sliding_interface/pipe/pipe_NN.cfg b/TestCases/sliding_interface/pipe/pipe_NN.cfg index 2c511192b167..f4e5a9dc1a3b 100644 --- a/TestCases/sliding_interface/pipe/pipe_NN.cfg +++ b/TestCases/sliding_interface/pipe/pipe_NN.cfg @@ -18,6 +18,16 @@ MULTIZONE_SOLVER= BLOCK_JACOBI % List of config files for zone specific options CONFIG_LIST= (zone_1.cfg, zone_2.cfg, zone_3.cfg, zone_4.cfg, zone_5.cfg) % +TIME_DOMAIN=YES +% +% Time step +TIME_STEP= 0.1 +% +TIME_ITER= 10 +% +OUTER_ITER=10 +% +INNER_ITER=1 % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -33,17 +43,8 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 - % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % % Mach number (non-dimensional, based on the free-stream values) @@ -84,8 +85,8 @@ MARKER_RIEMANN= (intake_upper_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, % % Zone interaction boundary definition MARKER_ZONE_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4 ) -% MARKER_FLUID_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4 ) +% %KIND_INTERPOLATION= ISOPARAMETRIC @@ -184,33 +185,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % @@ -226,22 +218,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/pipe/pipe_WA.cfg b/TestCases/sliding_interface/pipe/pipe_WA.cfg index 64cde59f44c6..276de07977c5 100644 --- a/TestCases/sliding_interface/pipe/pipe_WA.cfg +++ b/TestCases/sliding_interface/pipe/pipe_WA.cfg @@ -16,6 +16,16 @@ MULTIZONE= YES % List of config files for zone specific options CONFIG_LIST= (zone_1.cfg, zone_2.cfg, zone_3.cfg, zone_4.cfg, zone_5.cfg) % +TIME_DOMAIN=YES +% +TIME_STEP= 0.1 +% +TIME_ITER= 10 +% +OUTER_ITER=200 +% +INNER_ITER=1 +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -31,16 +41,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -81,7 +82,7 @@ MARKER_EULER= ( intake_sidewall, component_sidewall_1, component_sidewall_2, com MARKER_RIEMANN= (intake_upper_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 3.0, 0.0, 0.0, intake_lower_inlet, STATIC_SUPERSONIC_INFLOW_PT, 95750, 288.15, 1.5, 0.0, 0.0, outlet_interface_4 STATIC_PRESSURE, 95750.0, 0.0, 0.0, 0.0, 0.0 ) % % Zone interaction boundary definition -MARKER_ZONE_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4, outlet_interface_4 ) +MARKER_ZONE_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4 ) % MARKER_FLUID_INTERFACE= ( intake_interface, inlet_interface_1, outlet_interface_1, inlet_interface_2, outlet_interface_2, inlet_interface_3, outlet_interface_3, inlet_interface_4 ) % @@ -183,33 +184,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % @@ -225,22 +217,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/pipe/zone_1.cfg b/TestCases/sliding_interface/pipe/zone_1.cfg index d10d68687212..16a97b51449f 100644 --- a/TestCases/sliding_interface/pipe/zone_1.cfg +++ b/TestCases/sliding_interface/pipe/zone_1.cfg @@ -11,7 +11,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% - % % Type of dynamic mesh (NONE, ROTATING_FRAME) GRID_MOVEMENT= RIGID_MOTION diff --git a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg index c684a7ac59a7..0c2a4dda36a8 100644 --- a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg +++ b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg @@ -15,6 +15,21 @@ MULTIZONE= YES % Config list for zone specific options CONFIG_LIST = (zone_1.cfg, zone_2.cfg, zone_3.cfg) % +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 10 +% +% Inner iterations +INNER_ITER= 1 +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -31,18 +46,8 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 - -UNST_RESTART_ITER = 2 % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -179,32 +184,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -219,22 +216,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg index a008932fbc99..9911c580bb90 100644 --- a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg +++ b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg @@ -13,11 +13,25 @@ % Enable multizone mode MULTIZONE= YES % -MULTIZONE_SOLVER= BLOCK_JACOBI -% % Config list for zone specific options CONFIG_LIST = (zone_1.cfg, zone_2.cfg, zone_3.cfg) % +MULTIZONE_SOLVER= BLOCK_JACOBI +% +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 10 +% +% Inner iterations +INNER_ITER= 1 % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % @@ -35,18 +49,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 50 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 200 - -UNST_RESTART_ITER = 2 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -118,7 +121,7 @@ CFL_ADAPT_PARAM= ( 0.3, 0.5, 1.0, 1000.0) LINEAR_SOLVER= FGMRES % % Preconditioner of the Krylov linear solver (ILU, LU_SGS, LINELET, JACOBI) -LINEAR_SOLVER_PREC= LU_SGS +LINEAR_SOLVER_PREC= ILU % % Min error of the linear solver for the implicit formulation LINEAR_SOLVER_ERROR= 1E-4 @@ -183,33 +186,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -224,22 +218,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/single_stage/single_stage_NN.cfg b/TestCases/sliding_interface/single_stage/single_stage_NN.cfg index a1a73d4e93c4..14a23937bf7d 100644 --- a/TestCases/sliding_interface/single_stage/single_stage_NN.cfg +++ b/TestCases/sliding_interface/single_stage/single_stage_NN.cfg @@ -34,20 +34,22 @@ RESTART_SOL= NO % % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 +TIME_STEP= 0.1 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 +MAX_TIME= 10.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 200 +INNER_ITER= 200 -UNST_RESTART_ITER = 2 +RESTART_ITER = 2 % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -225,33 +227,24 @@ RELAXATION_FACTOR_TURB= 1.0 % % % --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % @@ -269,22 +262,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/single_stage/single_stage_WA.cfg b/TestCases/sliding_interface/single_stage/single_stage_WA.cfg index 48a0618a5499..e231aa261af1 100644 --- a/TestCases/sliding_interface/single_stage/single_stage_WA.cfg +++ b/TestCases/sliding_interface/single_stage/single_stage_WA.cfg @@ -36,20 +36,21 @@ RESTART_SOL= NO % % ------------------------- UNSTEADY SIMULATION -------------------------------% % +TIME_DOMAIN=YES % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 +TIME_STEP= 0.1 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 +MAX_TIME= 10.0 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 200 +INNER_ITER= 200 -UNST_RESTART_ITER = 2 +RESTART_ITER = 2 % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -225,32 +226,24 @@ RELAXATION_FACTOR_TURB= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % @@ -268,22 +261,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg index 3d3d60fbb26e..296594694862 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg @@ -16,6 +16,21 @@ MULTIZONE= YES % % List of config files to specify zone options CONFIG_LIST= (zone_1.cfg, zone_2.cfg) +% +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 5 +% +% Inner iterations +INNER_ITER= 1 % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -33,16 +48,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 100 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -181,32 +187,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -221,22 +219,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg index e29b75685372..8ee81a64d3c7 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg @@ -18,6 +18,21 @@ MULTIZONE_SOLVER=BLOCK_JACOBI % % List of config files to specify zone options CONFIG_LIST= (zone_1.cfg, zone_2.cfg) +% +% Enable time dependent problem +TIME_DOMAIN = YES +% +% Number of time steps +TIME_ITER = 32000 +% +% Time step +TIME_STEP = 0.1 +% +% Number of outer iterations (Block-Gauss-Seidel) +OUTER_ITER = 5 +% +% Inner iterations +INNER_ITER= 1 % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -35,16 +50,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.1 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 10.0 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 100 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -181,32 +187,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -221,22 +219,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg b/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg index 789c9efbebb0..b32195abce41 100644 --- a/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg +++ b/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg @@ -13,12 +13,18 @@ % Enable Multizone mode MULTIZONE= YES % -MULTIZONE_SOLVER= BLOCK_JACOBI +MULTIZONE_SOLVER=BLOCK_JACOBI + +% List of config files to specify zone options +CONFIG_LIST= (zone_1.cfg, zone_2.cfg) +% % TIME_DOMAIN=YES % -% List of config files to specify zone options -CONFIG_LIST= (zone_1.cfg, zone_2.cfg) +TIME_STEP= 1e-04 +TIME_ITER= 10 +OUTER_ITER= 120 +INNER_ITER= 1 % % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % @@ -36,18 +42,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-1ST_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 1E-4 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.01 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 120 - -UNST_RESTART_ITER = 2 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -189,32 +184,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -229,22 +216,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg b/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg index 50cb00ae1faa..961758c2d7ab 100644 --- a/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg +++ b/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg @@ -13,9 +13,19 @@ % Enable Multizone mode MULTIZONE= YES % +MULTIZONE_SOLVER=BLOCK_JACOBI + % List of config files to specify zone options CONFIG_LIST= (zone_1.cfg, zone_2.cfg) % +% +TIME_DOMAIN=YES +% +TIME_STEP= 1e-04 +TIME_ITER= 10 +OUTER_ITER= 120 +INNER_ITER= 1 +% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % % Physical governing equations (EULER, NAVIER_STOKES) @@ -32,18 +42,7 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-1ST_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -% -% Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 1E-4 -% -% Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.01 -% -% Number of internal iterations (dual time method) -UNST_INT_ITER= 120 - -UNST_RESTART_ITER = 2 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -86,12 +85,14 @@ MARKER_EULER= (outlet) MARKER_ZONE_INTERFACE= ( external_interface, internal_interface) MARKER_FLUID_INTERFACE= ( external_interface, internal_interface) -% KIND_INTERPOLATION= WEIGHTED_AVERAGE % % Periodic boundary marker(s) (NONE = no marker) % Format: ( periodic marker, donor marker, rot_cen_x, rot_cen_y, rot_cen_z, rot_angle_x-axis, rot_angle_y-axis, rot_angle_z-axis, translation_x, translation_y, translation_z) MARKER_SYM= ( up, down ) +% +% + % % % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% @@ -183,32 +184,24 @@ RELAXATION_FACTOR_FLOW= 1.0 % % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -% Number of total iterations -EXT_ITER= 32000 -% % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -223,22 +216,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= PARAVIEW +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 50 diff --git a/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg index c3e2a430f1f6..a867d88d90b1 100644 --- a/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, LINEAR_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -179,24 +179,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -20 +CONV_RESIDUAL_MINVAL= -20 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -210,25 +205,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -237,7 +232,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg index a9d992eb687e..3f09057081f9 100644 --- a/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, LINEAR_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -28,6 +28,9 @@ MATH_PROBLEM= DIRECT % % Restart solution (NO, YES) RESTART_SOL= NO +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % @@ -119,7 +122,7 @@ CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) % % Number of total iterations -EXT_ITER= 250000 +ITER= 250000 % ----------------------- SLOPE LIMITER DEFINITION ----------------------------% % @@ -212,24 +215,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -20 +CONV_RESIDUAL_MINVAL= -20 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -243,25 +241,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -270,7 +268,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -280,3 +278,6 @@ WRT_SOL_FREQ= 500 % % Writing convergence history frequency WRT_CON_FREQ= 1 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_PRESSURE, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg index b3771ba7c208..ea56609ab479 100644 --- a/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg @@ -15,7 +15,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, LINEAR_ELASTICITY, % POISSON_EQUATION) -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS % % Specify turbulent model (NONE, SA, SA_NEG, SST) KIND_TURB_MODEL= SA @@ -198,24 +198,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 10 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -20 +CONV_RESIDUAL_MINVAL= -20 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -229,25 +224,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -256,7 +251,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/turbomachinery/APU_turbocharger/Jones.cfg b/TestCases/turbomachinery/APU_turbocharger/Jones.cfg index a8f256513907..1362b58f30f2 100755 --- a/TestCases/turbomachinery/APU_turbocharger/Jones.cfg +++ b/TestCases/turbomachinery/APU_turbocharger/Jones.cfg @@ -276,31 +276,25 @@ RELAXATION_FACTOR_TURB= 0.95 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 11 +OUTER_ITER= 6 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -315,25 +309,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= meshout.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -342,7 +336,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/turbomachinery/APU_turbocharger/Jones_rst.cfg b/TestCases/turbomachinery/APU_turbocharger/Jones_rst.cfg index 3174d5035bb9..f16bd867d18b 100755 --- a/TestCases/turbomachinery/APU_turbocharger/Jones_rst.cfg +++ b/TestCases/turbomachinery/APU_turbocharger/Jones_rst.cfg @@ -281,31 +281,25 @@ RELAXATION_FACTOR_TURB= 0.95 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 11 +OUTER_ITER= 6 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -320,25 +314,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= meshout.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -347,7 +341,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg b/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg index 3c2e28dda6e6..a868f32f19e6 100755 --- a/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg +++ b/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg @@ -270,31 +270,25 @@ RELAXATION_FACTOR_TURB= 0.95 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 2001 +OUTER_ITER= 21 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -309,25 +303,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= meshout.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -336,7 +330,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg index 06ca8a5fe46a..74d9c8dfc22f 100755 --- a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg +++ b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg @@ -307,31 +307,26 @@ RELAXATION_FACTOR_TURB= 1.0 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 12000 +ITER= 12000 % % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % @@ -348,22 +343,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 500 diff --git a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg index ccad26c1d8d8..757be80790e9 100755 --- a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg +++ b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg @@ -315,31 +315,26 @@ RELAXATION_FACTOR_TURB= 1.0 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 32000 +ITER= 32000 % % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % % Flow functional for the Residual criteria (RHO, RHO_ENERGY) -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % % % @@ -356,22 +351,22 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Writing solution file frequency WRT_SOL_FREQ= 500 diff --git a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg index 24b8b99f435b..73a7326e7bbd 100644 --- a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg +++ b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator.cfg @@ -278,31 +278,25 @@ RELAXATION_FACTOR_TURB= 1.0 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 2001 +ITER= 2001 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -317,25 +311,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -344,7 +338,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg index 8cfd5319df38..329a81058e2e 100644 --- a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg +++ b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_rst.cfg @@ -283,31 +283,25 @@ RELAXATION_FACTOR_TURB= 1.0 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % % Number of total iterations -EXT_ITER= 201 +ITER= 201 % Convergence criteria (CAUCHY, RESIDUAL) % CONV_CRITERIA= RESIDUAL % -RESIDUAL_FUNC_FLOW= RHO_ENERGY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 6 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -16 +CONV_RESIDUAL_MINVAL= -16 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% @@ -322,25 +316,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow_sst.dat +SOLUTION_FILENAME= solution_flow_sst.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -349,7 +343,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg b/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg index 7905138ebaef..94a6971466cb 100644 --- a/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg +++ b/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg @@ -1,25 +1,20 @@ % ------------------------- PHYSICAL PROBLEM ----------------------------------% % -SOLVER= INC_NAVIER_STOKES +SOLVER= INC_RANS KIND_TURB_MODEL= SA MATH_PROBLEM= DIRECT RESTART_SOL= NO % ------------------------- UNSTEADY SIMULATION -------------------------------% % -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER -UNST_TIMESTEP= 0.016849% 25 time steps per period -UNST_TIME= 2.528% 6 periods -% -% Old driver -EXT_ITER= 151 -UNST_INT_ITER= 201 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +TIME_STEP= 0.016849% 25 time steps per period +MAX_TIME= 2.528% 6 periods % % New driver -%SINGLEZONE_DRIVER= YES -%TIME_DOMAIN= YES -%TIME_ITER= 151 -%ITER= 201 +TIME_DOMAIN= YES +TIME_ITER= 2 +INNER_ITER= 50 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % GRID_MOVEMENT= RIGID_MOTION @@ -98,31 +93,28 @@ CFL_REDUCTION_TURB= 1.0 % --------------------------- CONVERGENCE PARAMETERS --------------------------% % -CONV_CRITERIA= RESIDUAL -RESIDUAL_REDUCTION= 3 -RESIDUAL_MINVAL= -12 -STARTCONV_ITER= 1 -CAUCHY_ELEMS= 100 -CAUCHY_FUNC_FLOW= DRAG +CONV_RESIDUAL_MINVAL= -12 +CONV_STARTITER= 1 +CONV_CAUCHY_ELEMS= 100 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % MESH_FILENAME= mesh_naca0015_ogrid_m151_cvc_v2_147.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat -OUTPUT_FORMAT= PARAVIEW_BINARY +TABULAR_FORMAT= CSV CONV_FILENAME= history -RESTART_FLOW_FILENAME= solution_flow.dat +RESTART_FILENAME= solution_flow.dat RESTART_ADJ_FILENAME= solution_adj.dat -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint WRT_SOL_FREQ= 100 WRT_SOL_FREQ_DUALTIME= 1 WRT_CON_FREQ= 1 WRT_CON_FREQ_DUALTIME= 10 - +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_PRESSURE, RMS_NU_TILDE, LIFT, DRAG) diff --git a/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg b/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg index e1ead86a07f0..494b08ffb7a6 100644 --- a/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg +++ b/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg @@ -29,19 +29,19 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0023555025613149587 +TIME_STEP= 0.0023555025613149587 % 24 steps per period: 0.0024536485013697488 % 25 steps per period: 0.0023555025613149587 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.59 +MAX_TIME= 0.59 % 10 periods: 0.5888756403287397 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 110 +INNER_ITER= 110 % % Starting direct iteration for unsteady adjoint UNST_ADJOINT_ITER= 251 @@ -265,25 +265,19 @@ VISUALIZE_VOLUME_DEF= NO % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-6 +CONV_CAUCHY_EPS= 1E-6 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -297,25 +291,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -324,7 +318,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg b/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg index c158a819968a..99b0378ae5a3 100644 --- a/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg +++ b/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg @@ -29,20 +29,20 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0023555025613149587 +TIME_STEP= 0.0023555025613149587 % 24 steps per period: 0.0024536485013697488 % 25 steps per period: 0.0023555025613149587 % 36 steps per period: 0.0016357592286692995 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.59 +MAX_TIME= 0.59 % 10 periods: 0.5888756403287397 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 2000 +INNER_ITER= 2000 % % Direct iteration number at which to begin unsteady adjoint UNST_ADJOINT_ITER= 251 @@ -289,25 +289,19 @@ VISUALIZE_VOLUME_DEF= YES % CONV_CRITERIA= CAUCHY % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 4 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -8 +CONV_RESIDUAL_MINVAL= -8 % % Start Cauchy criteria at iteration number -STARTCONV_ITER= 1 +CONV_STARTITER= 1 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, SENS_GEOMETRY, SENS_MACH, -% DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -321,25 +315,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= restart_flow.dat +SOLUTION_FILENAME= restart_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= restart_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -348,7 +342,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg b/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg index db07cb7bda93..55af6c78a076 100644 --- a/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg +++ b/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg @@ -29,19 +29,19 @@ RESTART_SOL= NO % % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0023555025613149587 +TIME_STEP= 0.0023555025613149587 % 24 steps per period: 0.0024536485013697488 % 25 steps per period: 0.0023555025613149587 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 0.5888756403287397 +MAX_TIME= 0.5888756403287397 % 10 periods: 0.5888756403287397 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 1000 +INNER_ITER= 1000 % ----------------------- DYNAMIC MESH DEFINITION -----------------------------% % @@ -191,21 +191,16 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convergence criteria (CAUCHY, RESIDUAL) CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -12 +CONV_RESIDUAL_MINVAL= -12 % % Start convergence criteria at iteration number -STARTCONV_ITER= 1 +CONV_STARTITER= 1 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -219,25 +214,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % % Output file format (PARAVIEW, TECPLOT, STL) -OUTPUT_FORMAT= TECPLOT +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -246,7 +241,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint diff --git a/TestCases/unsteady/square_cylinder/turb_square.cfg b/TestCases/unsteady/square_cylinder/turb_square.cfg index 04974044e1eb..32ccd237de0a 100644 --- a/TestCases/unsteady/square_cylinder/turb_square.cfg +++ b/TestCases/unsteady/square_cylinder/turb_square.cfg @@ -14,7 +14,7 @@ % Physical governing equations (EULER, NAVIER_STOKES, % WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY, % POISSON_EQUATION) -SOLVER= NAVIER_STOKES +SOLVER= RANS % % If Navier-Stokes, kind of turbulent model (NONE, SA) KIND_TURB_MODEL= SST @@ -32,25 +32,30 @@ WRT_BINARY_RESTART= NO READ_BINARY_RESTART= NO % % Unsteady restart iteration (need previous restart files) -UNST_RESTART_ITER= 2 - +RESTART_ITER= 2 +% +% New singlezone driver +SINGLEZONE_DRIVER=YES % ------------------------- UNSTEADY SIMULATION -------------------------------% % +% Enable time domain +TIME_DOMAIN = YES +% % Unsteady simulation (NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, % DUAL_TIME_STEPPING-2ND_ORDER, HARMONIC_BALANCE) -UNSTEADY_SIMULATION= DUAL_TIME_STEPPING-2ND_ORDER +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER % % Time Step for dual time stepping simulations (s) -UNST_TIMESTEP= 0.0015 +TIME_STEP= 0.0015 % % Total Physical Time for dual time stepping simulations (s) -UNST_TIME= 3.75 +MAX_TIME= 3.75 % 2500 iterations - 3.75 % 3500 iterations - 5.25 % 5000 iterations - 7.50 % % Number of internal iterations (dual time method) -UNST_INT_ITER= 10 +INNER_ITER= 10 % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % @@ -119,7 +124,7 @@ CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % % Number of total iterations -EXT_ITER= 3 +TIME_ITER= 3 % % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% @@ -198,24 +203,19 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 3 % % Min value of the residual (log10 of the residual) -RESIDUAL_MINVAL= -10 +CONV_RESIDUAL_MINVAL= -10 % % Start convergence criteria at iteration number -STARTCONV_ITER= 10 +CONV_STARTITER= 10 % % Number of elements to apply the criteria -CAUCHY_ELEMS= 100 +CONV_CAUCHY_ELEMS= 100 % % Epsilon to control the series convergence -CAUCHY_EPS= 1E-5 +CONV_CAUCHY_EPS= 1E-5 % -% Function to apply the criteria (LIFT, DRAG, NEARFIELD_PRESS, SENS_GEOMETRY, -% SENS_MACH, DELTA_LIFT, DELTA_DRAG) -CAUCHY_FUNC_FLOW= DRAG % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % @@ -229,25 +229,25 @@ MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 % % Restart flow input file -SOLUTION_FLOW_FILENAME= solution_flow.dat +SOLUTION_FILENAME= solution_flow.dat % % Restart adjoint input file SOLUTION_ADJ_FILENAME= solution_adj.dat % -% Output file format (PARAVIEW, TECPLOT) -OUTPUT_FORMAT= TECPLOT +% Output tabular format (CSV, TECPLOT) +TABULAR_FORMAT= CSV % % Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow -RESTART_FLOW_FILENAME= restart_flow.dat +RESTART_FILENAME= restart_flow.dat % % Output file restart adjoint RESTART_ADJ_FILENAME= restart_adj.dat % % Output file flow (w/o extension) variables -VOLUME_FLOW_FILENAME= flow +VOLUME_FILENAME= flow % % Output file adjoint (w/o extension) variables VOLUME_ADJ_FILENAME= adjoint @@ -256,7 +256,7 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat % % Output file surface flow coefficient (w/o extension) -SURFACE_FLOW_FILENAME= surface_flow +SURFACE_FILENAME= surface_flow % % Output file surface adjoint coefficient (w/o extension) SURFACE_ADJ_FILENAME= surface_adjoint @@ -272,3 +272,6 @@ WRT_CON_FREQ= 1 % % Writing convergence history frequency (dual time, only written to screen) WRT_CON_FREQ_DUALTIME= 1 +% +% Screen output +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/config_template.cfg b/config_template.cfg index 3d533e42d2dd..3a376c493fff 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -1244,8 +1244,6 @@ EXT_ITER= 1000 % CONV_CRITERIA= RESIDUAL % -% Residual reduction (order of magnitude with respect to the initial value) -RESIDUAL_REDUCTION= 5 % % Min value of the residual (log10 of the residual) RESIDUAL_MINVAL= -8 @@ -1259,11 +1257,7 @@ CAUCHY_ELEMS= 100 % Epsilon to control the series convergence CAUCHY_EPS= 1E-10 % -% Direct function to apply the convergence criteria (LIFT, DRAG, NEARFIELD_PRESS) -CAUCHY_FUNC_FLOW= DRAG % -% Adjoint function to apply the convergence criteria (SENS_GEOMETRY, SENS_MACH) -CAUCHY_FUNC_ADJFLOW= SENS_GEOMETRY % ----------------------- DRIVER REFACTORED ITERATORS -------------------------% % As of now, these are only strictly necessary for single-zone discrete adjoint diff --git a/externals/meson b/externals/meson index c904d3eefe2a..e9bd7d49bdc8 160000 --- a/externals/meson +++ b/externals/meson @@ -1 +1 @@ -Subproject commit c904d3eefe2a01ca60027e2a5192e1f1c7ca5d9d +Subproject commit e9bd7d49bdc8c630cca3bf4cc02c437841b6aaf6 diff --git a/externals/ninja b/externals/ninja index e0bc2e5fd903..20b30dac6698 160000 --- a/externals/ninja +++ b/externals/ninja @@ -1 +1 @@ -Subproject commit e0bc2e5fd9036a31d507881e1383adde3672aaef +Subproject commit 20b30dac6698d119e7797b34d6ed2c4ed8f48417