diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 4698f4d9747..2551bed0c0e 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -64,7 +64,7 @@ class CConfig { SU2_MPI::Comm SU2_Communicator; /*!< \brief MPI communicator of SU2.*/ int rank, size; /*!< \brief MPI rank and size.*/ bool base_config; - unsigned short Kind_SU2; /*!< \brief Kind of SU2 software component.*/ + SU2_COMPONENT Kind_SU2; /*!< \brief Kind of SU2 software component.*/ unsigned short Ref_NonDim; /*!< \brief Kind of non dimensionalization.*/ unsigned short Ref_Inc_NonDim; /*!< \brief Kind of non dimensionalization.*/ unsigned short Kind_AverageProcess; /*!< \brief Kind of mixing process.*/ @@ -151,7 +151,7 @@ class CConfig { su2double CM_Target; /*!< \brief Fixed Cl mode Target CM. */ su2double *HTP_Min_XCoord, *HTP_Min_YCoord; /*!< \brief Identification of the HTP. */ - unsigned short TimeMarching; /*!< \brief Steady or unsteady (time stepping or dual time stepping) computation. */ + TIME_MARCHING 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. */ @@ -160,7 +160,7 @@ class CConfig { unsigned long LimiterIter; /*!< \brief Freeze the value of the limiter after a number of iterations */ su2double AdjSharp_LimiterCoeff; /*!< \brief Coefficient to identify the limit of a sharp edge. */ unsigned short SystemMeasurements; /*!< \brief System of measurements. */ - unsigned short Kind_Regime; /*!< \brief Kind of adjoint function. */ + ENUM_REGIME Kind_Regime; /*!< \brief Kind of flow regime: in/compressible. */ unsigned short *Kind_ObjFunc; /*!< \brief Kind of objective function. */ su2double *Weight_ObjFunc; /*!< \brief Weight applied to objective function. */ unsigned short Kind_SensSmooth; /*!< \brief Kind of sensitivity smoothing technique. */ @@ -464,8 +464,10 @@ class CConfig { *MG_CorrecSmooth; /*!< \brief Multigrid Jacobi implicit smoothing of the correction. */ su2double *LocationStations; /*!< \brief Airfoil sections in wing slicing subroutine. */ + ENUM_MULTIZONE Kind_MZSolver; /*!< \brief Kind of multizone solver. */ + INC_DENSITYMODEL Kind_DensityModel; /*!< \brief Kind of the density model for incompressible flows. */ + CHT_COUPLING Kind_CHT_Coupling; /*!< \brief Kind of coupling method used at CHT interfaces. */ unsigned short Kind_Solver, /*!< \brief Kind of solver Euler, NS, Continuous adjoint, etc. */ - Kind_MZSolver, /*!< \brief Kind of multizone solver. */ Kind_FluidModel, /*!< \brief Kind of the Fluid Model: Ideal or Van der Walls, ... . */ Kind_ViscosityModel, /*!< \brief Kind of the Viscosity Model*/ Kind_ConductivityModel, /*!< \brief Kind of the Thermal Conductivity Model*/ @@ -473,7 +475,6 @@ class CConfig { Kind_FreeStreamOption, /*!< \brief Kind of free stream option to choose if initializing with density or temperature */ Kind_InitOption, /*!< \brief Kind of Init option to choose if initializing with Reynolds number or with thermodynamic conditions */ Kind_TransCoeffModel, /*!< \brief Transport coefficient Model for NEMO solver. */ - Kind_DensityModel, /*!< \brief Kind of the density model for incompressible flows. */ Kind_GridMovement, /*!< \brief Kind of the static mesh movement. */ *Kind_SurfaceMovement, /*!< \brief Kind of the static mesh movement. */ nKind_SurfaceMovement, /*!< \brief Kind of the dynamic mesh movement. */ @@ -528,8 +529,7 @@ class CConfig { Kind_FEM_Flow, /*!< \brief Finite element scheme for the flow equations. */ Kind_FEM_DG_Shock, /*!< \brief Shock capturing method for the FEM DG solver. */ Kind_Matrix_Coloring, /*!< \brief Type of matrix coloring for sparse Jacobian computation. */ - Kind_BGS_RelaxMethod, /*!< \brief Kind of relaxation method for Block Gauss Seidel method in FSI problems. */ - Kind_CHT_Coupling; /*!< \brief Kind of coupling method used at CHT interfaces. */ + Kind_BGS_RelaxMethod; /*!< \brief Kind of relaxation method for Block Gauss Seidel method in FSI problems. */ bool ReconstructionGradientRequired; /*!< \brief Enable or disable a second gradient calculation for upwind reconstruction only. */ bool LeastSquaresRequired; /*!< \brief Enable or disable memory allocation for least-squares gradient methods. */ bool Energy_Equation; /*!< \brief Solve the energy equation for incompressible flows. */ @@ -558,10 +558,11 @@ class CConfig { unsigned short Kind_SGS_Model; /*!< \brief LES SGS model definition. */ unsigned short Kind_Trans_Model, /*!< \brief Transition model definition. */ Kind_ActDisk, Kind_Engine_Inflow, - Kind_Inlet, *Kind_Inc_Inlet, - *Kind_Inc_Outlet, *Kind_Data_Riemann, *Kind_Data_Giles; /*!< \brief Kind of inlet boundary treatment. */ + INLET_TYPE Kind_Inlet; + INLET_TYPE *Kind_Inc_Inlet; + INC_OUTLET_TYPE *Kind_Inc_Outlet; unsigned short *Kind_Wall; /*!< \brief Type of wall treatment. */ unsigned short nWall_Types; /*!< \brief Number of wall treatment types listed. */ unsigned short nInc_Inlet; /*!< \brief Number of inlet boundary treatment types listed. */ @@ -999,11 +1000,11 @@ class CConfig { array kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */ bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */ - unsigned short Kind_Streamwise_Periodic; /*!< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */ - bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or otherwise outlet source term. */ - su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ - su2double Streamwise_Periodic_TargetMassFlow; /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ - su2double Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ + ENUM_STREAMWISE_PERIODIC Kind_Streamwise_Periodic; /*!< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */ + bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or otherwise outlet source term. */ + su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */ + su2double Streamwise_Periodic_TargetMassFlow; /*!< \brief Value of prescribed massflow [kg/s] which results in an delta p and therefore an artificial body force vector. */ + su2double Streamwise_Periodic_OutletHeat; /*!< /brief Heatflux boundary [W/m^2] imposed at streamwise periodic outlet. */ su2double *FreeStreamTurboNormal; /*!< \brief Direction to initialize the flow in turbomachinery computation */ su2double Restart_Bandwidth_Agg; /*!< \brief The aggregate of the bandwidth for writing binary restarts (to be averaged later). */ @@ -1012,14 +1013,14 @@ class CConfig { string top_optim_output_file; /*!< \brief File to where the derivatives w.r.t. element densities will be written to. */ su2double simp_exponent; /*!< \brief Exponent for the density-based stiffness penalization of the SIMP method. */ su2double simp_minimum_stiffness; /*!< \brief Lower bound for the stiffness penalization of the SIMP method. */ - unsigned short top_optim_nKernel, /*!< \brief Number of kernels specified. */ - *top_optim_kernels, /*!< \brief The kernels to use. */ - top_optim_nKernelParams, /*!< \brief Number of kernel parameters specified. */ - top_optim_nRadius, /*!< \brief Number of radius values specified. */ - top_optim_search_lim; /*!< \brief Limit the maximum "logical radius" considered during filtering. */ - su2double *top_optim_kernel_params, /*!< \brief The kernel parameters. */ - *top_optim_filter_radius; /*!< \brief Radius of the filter(s) used on the design density for topology optimization. */ - unsigned short top_optim_proj_type; /*!< \brief The projection function used in topology optimization. */ + ENUM_FILTER_KERNEL* top_optim_kernels; /*!< \brief The kernels to use. */ + unsigned short top_optim_nKernel; /*!< \brief Number of kernels specified. */ + unsigned short top_optim_nKernelParams; /*!< \brief Number of kernel parameters specified. */ + unsigned short top_optim_nRadius; /*!< \brief Number of radius values specified. */ + unsigned short top_optim_search_lim; /*!< \brief Limit the maximum "logical radius" considered during filtering. */ + su2double *top_optim_kernel_params; /*!< \brief The kernel parameters. */ + su2double *top_optim_filter_radius; /*!< \brief Radius of the filter(s) used on the design density for topology optimization. */ + ENUM_PROJECTION_FUNCTION top_optim_proj_type; /*!< \brief The projection function used in topology optimization. */ su2double top_optim_proj_param; /*!< \brief The value of the parameter for the projection function. */ bool HeatSource; /*!< \brief Flag to know if there is a volumetric heat source on the flow. */ su2double ValHeatSource; /*!< \brief Value of the volumetric heat source on the flow (W/m3). */ @@ -1190,12 +1191,12 @@ class CConfig { // enum types work differently than all of the others because there are a small number of valid // string entries for the type. One must also provide a list of all the valid strings of that type. - template - void addEnumOption(const string name, unsigned short & option_field, const map & enum_map, Tenum default_value); + template + void addEnumOption(const string name, Tfield& option_field, const map& enum_map, Tenum default_value); // input_size is the number of options read in from the config file - template - void addEnumListOption(const string name, unsigned short & input_size, unsigned short * & option_field, const map & enum_map); + template + void addEnumListOption(const string name, unsigned short& input_size, Tfield*& option_field, const map& enum_map); void addDoubleArrayOption(const string name, const int size, su2double* option_field); @@ -1271,22 +1272,22 @@ class CConfig { /*! * \brief Constructor of the class which reads the input file. */ - CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_software, bool verb_high); + CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software, bool verb_high); /*! * \brief Constructor of the class which takes an istream buffer containing the config options. */ - CConfig(istream &case_buffer, unsigned short val_software, bool verb_high); + CConfig(istream &case_buffer, SU2_COMPONENT val_software, bool verb_high); /*! * \brief Constructor of the class which reads the input file and uses default options from another config. */ - CConfig(CConfig * config, char case_filename[MAX_STRING_SIZE], unsigned short val_software, unsigned short val_iZone, unsigned short val_nZone, bool verb_high); + CConfig(CConfig * config, char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software, unsigned short val_iZone, unsigned short val_nZone, bool verb_high); /*! * \brief Constructor of the class which reads the input file. */ - CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_software); + CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software); /*! * \brief Constructor of the class which reads the input file. @@ -1317,7 +1318,7 @@ class CConfig { * \brief Print the header to screen * \param val_software - Kind of software component */ - void SetHeader(unsigned short val_software) const; + void SetHeader(SU2_COMPONENT val_software) const; /*! * \brief Get the MPI communicator of SU2. @@ -3595,14 +3596,14 @@ class CConfig { * \brief Kind of Multizone Solver. * \return Governing equation that we are solving. */ - unsigned short GetKind_MZSolver(void) const { return Kind_MZSolver; } + ENUM_MULTIZONE GetKind_MZSolver(void) const { return Kind_MZSolver; } /*! * \brief Governing equations of the flow (it can be different from the run time equation). * \param[in] val_zone - Zone where the soler is applied. * \return Governing equation that we are solving. */ - unsigned short GetKind_Regime(void) const { return Kind_Regime; } + ENUM_REGIME GetKind_Regime(void) const { return Kind_Regime; } /*! * \brief Governing equations of the flow (it can be different from the run time equation). @@ -3647,7 +3648,7 @@ class CConfig { * \brief Option to define the density model for incompressible flows. * \return Density model option */ - unsigned short GetKind_DensityModel(void) const { return Kind_DensityModel; } + INC_DENSITYMODEL GetKind_DensityModel(void) const { return Kind_DensityModel; } /*! * \brief Flag for whether to solve the energy equation for incompressible flows. @@ -4135,7 +4136,7 @@ class CConfig { * \brief Get the kind of SU2 software component. * \return Kind of the SU2 software component. */ - unsigned short GetKind_SU2(void) const { return Kind_SU2; } + SU2_COMPONENT GetKind_SU2(void) const { return Kind_SU2; } /*! * \brief Get the kind of non-dimensionalization. @@ -4153,7 +4154,7 @@ class CConfig { * \brief Get the kind of SU2 software component. * \return Kind of the SU2 software component. */ - void SetKind_SU2(unsigned short val_kind_su2) { Kind_SU2 = val_kind_su2 ; } + void SetKind_SU2(SU2_COMPONENT val_kind_su2) { Kind_SU2 = val_kind_su2 ; } /*! * \brief Get the kind of the turbulence model. @@ -4652,7 +4653,7 @@ class CConfig { * \brief Get the kind of inlet boundary condition treatment (total conditions or mass flow). * \return Kind of inlet boundary condition. */ - unsigned short GetKind_Inlet(void) const { return Kind_Inlet; } + INLET_TYPE GetKind_Inlet(void) const { return Kind_Inlet; } /*! * \brief Check if the inlet profile(s) are specified in an input file @@ -4682,7 +4683,7 @@ class CConfig { * \brief Get the type of incompressible inlet from the list. * \return Kind of the incompressible inlet. */ - unsigned short GetKind_Inc_Inlet(string val_marker) const; + INLET_TYPE GetKind_Inc_Inlet(string val_marker) const; /*! * \brief Get the total number of types in Kind_Inc_Inlet list @@ -4700,7 +4701,7 @@ class CConfig { * \brief Get the type of incompressible outlet from the list. * \return Kind of the incompressible outlet. */ - unsigned short GetKind_Inc_Outlet(string val_marker) const; + INC_OUTLET_TYPE GetKind_Inc_Outlet(string val_marker) const; /*! * \brief Get the damping factor applied to velocity updates at incompressible pressure inlets. @@ -5046,7 +5047,7 @@ class CConfig { * \return The kind of time integration: Steady state, time stepping method (unsteady) or * dual time stepping method (unsteady). */ - unsigned short GetTime_Marching(void) const { return TimeMarching; } + TIME_MARCHING GetTime_Marching() const { return TimeMarching; } /*! * \brief Provides the number of species present in the plasma @@ -5750,7 +5751,7 @@ class CConfig { * \brief Get information about the streamwise periodicity (None, Pressure_Drop, Massflow). * \return Driving force identification. */ - unsigned short GetKind_Streamwise_Periodic(void) const { return Kind_Streamwise_Periodic; } + ENUM_STREAMWISE_PERIODIC GetKind_Streamwise_Periodic(void) const { return Kind_Streamwise_Periodic; } /*! * \brief Get information about the streamwise periodicity Energy equation handling. @@ -7894,17 +7895,17 @@ class CConfig { /*! * \brief Config file postprocessing. */ - void SetPostprocessing(unsigned short val_software, unsigned short val_izone, unsigned short val_nDim); + void SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_izone, unsigned short val_nDim); /*! * \brief Config file markers processing. */ - void SetMarkers(unsigned short val_software); + void SetMarkers(SU2_COMPONENT val_software); /*! * \brief Config file output. */ - void SetOutput(unsigned short val_software, unsigned short val_izone); + void SetOutput(SU2_COMPONENT val_software, unsigned short val_izone); /*! * \brief Value of Aeroelastic solution coordinate at time n+1. @@ -8834,7 +8835,7 @@ class CConfig { * \brief Get the CHT couling method. * \return Kind of the method. */ - unsigned short GetKind_CHT_Coupling(void) const { return Kind_CHT_Coupling; } + CHT_COUPLING GetKind_CHT_Coupling() const { return Kind_CHT_Coupling; } /*! * \brief Check if values passed to the BC_HeatFlux-Routine are already integrated. @@ -8882,7 +8883,7 @@ class CConfig { /*! * \brief Get the i'th kernel to use, its parameter, and the radius. */ - void GetTopology_Optim_Kernel(const unsigned short iKernel, unsigned short &type, + void GetTopology_Optim_Kernel(const unsigned short iKernel, ENUM_FILTER_KERNEL &type, su2double ¶m, su2double &radius) const { type = top_optim_kernels[iKernel]; param = top_optim_kernel_params[iKernel]; @@ -8897,7 +8898,7 @@ class CConfig { /*! * \brief Get the type and parameter for the projection function used in topology optimization */ - void GetTopology_Optim_Projection(unsigned short &type, su2double ¶m) const { + void GetTopology_Optim_Projection(ENUM_PROJECTION_FUNCTION &type, su2double ¶m) const { type = top_optim_proj_type; param = top_optim_proj_param; } diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index 07dc11447d9..93ed622fa81 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -1545,7 +1545,8 @@ class CGeometry { * \param[in] search_limit - Max degree of neighborhood considered for neighbor search, avoids excessive work in fine regions. * \param[in,out] values - On entry, the "raw" values, on exit, the filtered values. */ - void FilterValuesAtElementCG(const vector &filter_radius, const vector > &kernels, + void FilterValuesAtElementCG(const vector &filter_radius, + const vector > &kernels, const unsigned short search_limit, su2double *values) const; /*! diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index bd83bd84019..091521977f5 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -63,12 +63,12 @@ using MapType = CEmptyMap; /*! * \brief Different software components of SU2 */ -enum SU2_COMPONENT { - SU2_CFD = 1, /*!< \brief Running the SU2_CFD software. */ - SU2_DEF = 2, /*!< \brief Running the SU2_DEF software. */ - SU2_DOT = 3, /*!< \brief Running the SU2_DOT software. */ - SU2_GEO = 5, /*!< \brief Running the SU2_GEO software. */ - SU2_SOL = 6 /*!< \brief Running the SU2_SOL software. */ +enum class SU2_COMPONENT { + SU2_CFD, /*!< \brief Running the SU2_CFD software. */ + SU2_DEF, /*!< \brief Running the SU2_DEF software. */ + SU2_DOT, /*!< \brief Running the SU2_DOT software. */ + SU2_GEO, /*!< \brief Running the SU2_GEO software. */ + SU2_SOL /*!< \brief Running the SU2_SOL software. */ }; const unsigned int EXIT_DIVERGENCE = 2; /*!< \brief Exit code (divergence). */ @@ -237,13 +237,13 @@ static const MapType Solver_Map = { /*! * \brief Different solver types for multizone problems */ -enum ENUM_MULTIZONE { - MZ_BLOCK_GAUSS_SEIDEL = 0, /*!< \brief Definition of a Block-Gauss-Seidel multizone solver. */ - MZ_BLOCK_JACOBI = 1 /*!< \brief Definition of a Block-Jacobi solver. */ +enum class ENUM_MULTIZONE { + MZ_BLOCK_GAUSS_SEIDEL, /*!< \brief Definition of a Block-Gauss-Seidel multizone solver. */ + MZ_BLOCK_JACOBI, /*!< \brief Definition of a Block-Jacobi solver. */ }; static const MapType Multizone_Map = { - MakePair("BLOCK_GAUSS_SEIDEL", MZ_BLOCK_GAUSS_SEIDEL) - MakePair("BLOCK_JACOBI", MZ_BLOCK_JACOBI) + MakePair("BLOCK_GAUSS_SEIDEL", ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL) + MakePair("BLOCK_JACOBI", ENUM_MULTIZONE::MZ_BLOCK_JACOBI) }; /*! @@ -395,7 +395,7 @@ enum ENUM_TRANSFER { /*! * \brief different regime modes */ -enum ENUM_REGIME { +enum class ENUM_REGIME { COMPRESSIBLE = 0, /*!< \brief Definition of compressible solver. */ INCOMPRESSIBLE = 1, /*!< \brief Definition of incompressible solver. */ NO_FLOW = 2 @@ -594,15 +594,15 @@ MakePair("GUPTA-YOS", GUPTAYOS) /*! * \brief Types of density models */ -enum ENUM_DENSITYMODEL { - CONSTANT = 0, - BOUSSINESQ = 1, /*!< \brief BoussinesQ density model. */ - VARIABLE = 2 /*!< \brief Variable density model. */ +enum class INC_DENSITYMODEL { + CONSTANT, /*!< \brief Constant density. */ + BOUSSINESQ, /*!< \brief Boussinesq density model. */ + VARIABLE, /*!< \brief Variable density model. */ }; -static const MapType DensityModel_Map = { - MakePair("CONSTANT", CONSTANT) - MakePair("BOUSSINESQ", BOUSSINESQ) - MakePair("VARIABLE", VARIABLE) +static const MapType DensityModel_Map = { + MakePair("CONSTANT", INC_DENSITYMODEL::CONSTANT) + MakePair("BOUSSINESQ", INC_DENSITYMODEL::BOUSSINESQ) + MakePair("VARIABLE", INC_DENSITYMODEL::VARIABLE) }; /*! @@ -1239,17 +1239,17 @@ static const MapType P1_Init_Map = { * The first (temperature) part determines the BC method on the fluid side, the second (heatflux) part determines * the BC method on the solid side of the CHT interface. */ -enum ENUM_CHT_COUPLING { - DIRECT_TEMPERATURE_NEUMANN_HEATFLUX = 0, - AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX = 1, - DIRECT_TEMPERATURE_ROBIN_HEATFLUX = 2, - AVERAGED_TEMPERATURE_ROBIN_HEATFLUX = 3 +enum CHT_COUPLING { + DIRECT_TEMPERATURE_NEUMANN_HEATFLUX, + AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX, + DIRECT_TEMPERATURE_ROBIN_HEATFLUX, + AVERAGED_TEMPERATURE_ROBIN_HEATFLUX, }; -static const MapType CHT_Coupling_Map = { - MakePair("DIRECT_TEMPERATURE_NEUMANN_HEATFLUX", DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) - MakePair("AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX", AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) - MakePair("DIRECT_TEMPERATURE_ROBIN_HEATFLUX", DIRECT_TEMPERATURE_ROBIN_HEATFLUX) - MakePair("AVERAGED_TEMPERATURE_ROBIN_HEATFLUX", AVERAGED_TEMPERATURE_ROBIN_HEATFLUX) +static const MapType CHT_Coupling_Map = { + MakePair("DIRECT_TEMPERATURE_NEUMANN_HEATFLUX", CHT_COUPLING::DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) + MakePair("AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX", CHT_COUPLING::AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) + MakePair("DIRECT_TEMPERATURE_ROBIN_HEATFLUX", CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) + MakePair("AVERAGED_TEMPERATURE_ROBIN_HEATFLUX", CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX) }; /*! @@ -1377,30 +1377,30 @@ enum TURBO_MARKER_TYPE{ * \brief Types inlet boundary treatments */ enum INLET_TYPE { - TOTAL_CONDITIONS = 1, /*!< \brief User specifies total pressure, total temperature, and flow direction. */ - MASS_FLOW = 2, /*!< \brief User specifies density and velocity (mass flow). */ - INPUT_FILE = 3, /*!< \brief User specifies an input file. */ - VELOCITY_INLET = 4, /*!< \brief Velocity inlet for an incompressible flow. */ - PRESSURE_INLET = 5 /*!< \brief Total pressure inlet for an incompressible flow. */ + TOTAL_CONDITIONS, /*!< \brief User specifies total pressure, total temperature, and flow direction. */ + MASS_FLOW, /*!< \brief User specifies density and velocity (mass flow). */ + INPUT_FILE, /*!< \brief User specifies an input file. */ + VELOCITY_INLET, /*!< \brief Velocity inlet for an incompressible flow. */ + PRESSURE_INLET, /*!< \brief Total pressure inlet for an incompressible flow. */ }; static const MapType Inlet_Map = { - MakePair("TOTAL_CONDITIONS", TOTAL_CONDITIONS) - MakePair("MASS_FLOW", MASS_FLOW) - MakePair("INPUT_FILE", INPUT_FILE) - MakePair("VELOCITY_INLET", VELOCITY_INLET) - MakePair("PRESSURE_INLET", PRESSURE_INLET) + MakePair("TOTAL_CONDITIONS", INLET_TYPE::TOTAL_CONDITIONS) + MakePair("MASS_FLOW", INLET_TYPE::MASS_FLOW) + MakePair("INPUT_FILE", INLET_TYPE::INPUT_FILE) + MakePair("VELOCITY_INLET", INLET_TYPE::VELOCITY_INLET) + MakePair("PRESSURE_INLET", INLET_TYPE::PRESSURE_INLET) }; /*! * \brief Types outlet boundary treatments */ -enum OUTLET_TYPE { - PRESSURE_OUTLET = 1, /*!< \brief Gauge pressure outlet for incompressible flow */ - MASS_FLOW_OUTLET = 2, /*!< \brief Mass flow outlet for incompressible flow. */ +enum class INC_OUTLET_TYPE { + PRESSURE_OUTLET, /*!< \brief Gauge pressure outlet for incompressible flow */ + MASS_FLOW_OUTLET, /*!< \brief Mass flow outlet for incompressible flow. */ }; -static const MapType Outlet_Map = { - MakePair("PRESSURE_OUTLET", PRESSURE_OUTLET) - MakePair("MASS_FLOW_OUTLET", MASS_FLOW_OUTLET) +static const MapType Inc_Outlet_Map = { + MakePair("PRESSURE_OUTLET", INC_OUTLET_TYPE::PRESSURE_OUTLET) + MakePair("MASS_FLOW_OUTLET", INC_OUTLET_TYPE::MASS_FLOW_OUTLET) }; /*! @@ -1998,21 +1998,21 @@ static const MapType Geo_Description_Map = { /*! * \brief Types of schemes for unsteady computations */ -enum ENUM_UNSTEADY { - STEADY = 0, /*!< \brief A steady computation. */ - TIME_STEPPING = 1, /*!< \brief Use a time stepping strategy for unsteady computations. */ - DT_STEPPING_1ST = 2, /*!< \brief Use a dual time stepping strategy for unsteady computations (1st order). */ - DT_STEPPING_2ND = 3, /*!< \brief Use a dual time stepping strategy for unsteady computations (2nd order). */ - ROTATIONAL_FRAME = 4, /*!< \brief Use a rotational source term. */ - HARMONIC_BALANCE = 5 /*!< \brief Use a harmonic balance source term. */ +enum class TIME_MARCHING { + STEADY, /*!< \brief A steady computation. */ + TIME_STEPPING, /*!< \brief Use a time stepping strategy for unsteady computations. */ + DT_STEPPING_1ST, /*!< \brief Use a dual time stepping strategy for unsteady computations (1st order). */ + DT_STEPPING_2ND, /*!< \brief Use a dual time stepping strategy for unsteady computations (2nd order). */ + ROTATIONAL_FRAME, /*!< \brief Use a rotational source term. */ + HARMONIC_BALANCE, /*!< \brief Use a harmonic balance source term. */ }; -static const MapType TimeMarching_Map = { - MakePair("NO", STEADY) - MakePair("TIME_STEPPING", TIME_STEPPING) - MakePair("DUAL_TIME_STEPPING-1ST_ORDER", DT_STEPPING_1ST) - MakePair("DUAL_TIME_STEPPING-2ND_ORDER", DT_STEPPING_2ND) - MakePair("HARMONIC_BALANCE", HARMONIC_BALANCE) - MakePair("ROTATIONAL_FRAME", ROTATIONAL_FRAME) +static const MapType TimeMarching_Map = { + MakePair("NO", TIME_MARCHING::STEADY) + MakePair("TIME_STEPPING", TIME_MARCHING::TIME_STEPPING) + MakePair("DUAL_TIME_STEPPING-1ST_ORDER", TIME_MARCHING::DT_STEPPING_1ST) + MakePair("DUAL_TIME_STEPPING-2ND_ORDER", TIME_MARCHING::DT_STEPPING_2ND) + MakePair("HARMONIC_BALANCE", TIME_MARCHING::HARMONIC_BALANCE) + MakePair("ROTATIONAL_FRAME", TIME_MARCHING::ROTATIONAL_FRAME) }; /*! @@ -2177,36 +2177,36 @@ static const MapType Comm_Map = { MakePair("FULL", COMM_FULL) }; -/* +/*! * \brief Types of filter kernels, initially intended for structural topology optimization applications */ -enum ENUM_FILTER_KERNEL { - CONSTANT_WEIGHT_FILTER = 0, /*!< \brief Uniform weight. */ - CONICAL_WEIGHT_FILTER = 1, /*!< \brief Linear decay with distance from center point [Bruns and Tortorelli, 2001]. */ - GAUSSIAN_WEIGHT_FILTER = 2, /*!< \brief Bell shape around center point [Bruns and Tortorelli, 2003]. */ - DILATE_MORPH_FILTER = 3, /*!< \brief Continuous version of the dilate morphology operator [Sigmund 2007]. */ - ERODE_MORPH_FILTER = 4, /*!< \brief Continuous version of the erode morphology operator [Sigmund 2007].*/ +enum class ENUM_FILTER_KERNEL { + CONSTANT_WEIGHT, /*!< \brief Uniform weight. */ + CONICAL_WEIGHT, /*!< \brief Linear decay with distance from center point [Bruns and Tortorelli, 2001]. */ + GAUSSIAN_WEIGHT, /*!< \brief Bell shape around center point [Bruns and Tortorelli, 2003]. */ + DILATE_MORPH, /*!< \brief Continuous version of the dilate morphology operator [Sigmund 2007]. */ + ERODE_MORPH, /*!< \brief Continuous version of the erode morphology operator [Sigmund 2007].*/ }; static const MapType Filter_Kernel_Map = { - MakePair("CONSTANT", CONSTANT_WEIGHT_FILTER) - MakePair("CONICAL" , CONICAL_WEIGHT_FILTER) - MakePair("GAUSSIAN", GAUSSIAN_WEIGHT_FILTER) - MakePair("DILATE" , DILATE_MORPH_FILTER) - MakePair("ERODE" , ERODE_MORPH_FILTER) + MakePair("CONSTANT", ENUM_FILTER_KERNEL::CONSTANT_WEIGHT) + MakePair("CONICAL", ENUM_FILTER_KERNEL::CONICAL_WEIGHT) + MakePair("GAUSSIAN", ENUM_FILTER_KERNEL::GAUSSIAN_WEIGHT) + MakePair("DILATE", ENUM_FILTER_KERNEL::DILATE_MORPH) + MakePair("ERODE", ENUM_FILTER_KERNEL::ERODE_MORPH) }; /*! * \brief Types of projection function, initially intended for structural topology optimization applications */ -enum ENUM_PROJECTION_FUNCTION { - NO_PROJECTION = 0, /*!< \brief No projection. */ - HEAVISIDE_UP = 1, /*!< \brief Project values towards 1. */ - HEAVISIDE_DOWN = 2, /*!< \brief Project values towards 0. */ +enum class ENUM_PROJECTION_FUNCTION { + NONE, /*!< \brief No projection. */ + HEAVISIDE_UP, /*!< \brief Project values towards 1. */ + HEAVISIDE_DOWN, /*!< \brief Project values towards 0. */ }; static const MapType Projection_Function_Map = { - MakePair("NO_PROJECTION" , NO_PROJECTION) - MakePair("HEAVISIDE_UP" , HEAVISIDE_UP) - MakePair("HEAVISIDE_DOWN", HEAVISIDE_DOWN) + MakePair("NO_PROJECTION", ENUM_PROJECTION_FUNCTION::NONE) + MakePair("HEAVISIDE_UP", ENUM_PROJECTION_FUNCTION::HEAVISIDE_UP) + MakePair("HEAVISIDE_DOWN", ENUM_PROJECTION_FUNCTION::HEAVISIDE_DOWN) }; /*! @@ -2246,15 +2246,15 @@ static const MapType Verification_Solution_ /*! * \brief Types of streamwise periodicity. */ -enum ENUM_STREAMWISE_PERIODIC { - NO_STREAMWISE_PERIODIC = 0, /*!< \brief No streamwise periodic flow. */ - PRESSURE_DROP = 1, /*!< \brief Prescribed pressure drop. */ - STREAMWISE_MASSFLOW = 2, /*!< \brief Prescribed massflow. */ +enum class ENUM_STREAMWISE_PERIODIC { + NONE, /*!< \brief No streamwise periodic flow. */ + PRESSURE_DROP, /*!< \brief Prescribed pressure drop. */ + MASSFLOW, /*!< \brief Prescribed massflow. */ }; static const MapType Streamwise_Periodic_Map = { - MakePair("NONE", NO_STREAMWISE_PERIODIC) - MakePair("PRESSURE_DROP", PRESSURE_DROP) - MakePair("MASSFLOW", STREAMWISE_MASSFLOW) + MakePair("NONE", ENUM_STREAMWISE_PERIODIC::NONE) + MakePair("PRESSURE_DROP", ENUM_STREAMWISE_PERIODIC::PRESSURE_DROP) + MakePair("MASSFLOW", ENUM_STREAMWISE_PERIODIC::MASSFLOW) }; /*! diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index 342f1976c72..2b34dc98106 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -26,48 +26,50 @@ * License along with SU2. If not, see . */ -template -class COptionEnum : public COptionBase { +template +class COptionEnum final : public COptionBase { - map m; - unsigned short & field; // Reference to the feildname - Tenum def; // Default value - string name; // identifier for the option + const map& m; + TField& field; // Reference to the fieldname + const Tenum def; // Default value + const string name; // identifier for the option public: - COptionEnum(string option_field_name, const map m, unsigned short & option_field, Tenum default_value) : field(option_field) { - this->m = m; - this->def = default_value; - this->name = option_field_name; + COptionEnum() = delete; + + COptionEnum(string option_field_name, const map& m_, TField& option_field, Tenum default_value) : + m(m_), + field(option_field), + def(default_value), + name(std::move(option_field_name)) { } - ~COptionEnum() override {}; + ~COptionEnum() = default; + string SetValue(vector option_value) override { COptionBase::SetValue(option_value); // Check if there is more than one string - string out = optionCheckMultipleValues(option_value, "enum", this->name); + string out = optionCheckMultipleValues(option_value, "enum", name); if (out.compare("") != 0) { return out; } // Check to see if the enum value is in the map - if (this->m.find(option_value[0]) == m.end()) { - string str; - str.append(this->name); + auto it = m.find(option_value[0]); + + if (it == m.cend()) { + string str = name; str.append(": invalid option value "); str.append(option_value[0]); str.append(". Check current SU2 options in config_template.cfg."); return str; } // If it is there, set the option value - Tenum val = this->m[option_value[0]]; - this->field = val; + field = it->second; return ""; } - void SetDefault() override { - this->field = this->def; - } + void SetDefault() override { field = def; } }; template @@ -105,12 +107,12 @@ public: return badValue(option_value, typeName, name); } - void SetDefault() override { + void SetDefault() final { field = def; } }; -class COptionDouble : public COptionScalar { +class COptionDouble final : public COptionScalar { public: template COptionDouble(Ts&&... args) : @@ -118,7 +120,7 @@ public: } }; -class COptionInt : public COptionScalar { +class COptionInt final : public COptionScalar { public: template COptionInt(Ts&&... args) : @@ -126,7 +128,7 @@ public: } }; -class COptionULong : public COptionScalar { +class COptionULong final : public COptionScalar { public: template COptionULong(Ts&&... args) : @@ -134,7 +136,7 @@ public: } }; -class COptionUShort : public COptionScalar { +class COptionUShort final : public COptionScalar { public: template COptionUShort(Ts&&... args) : @@ -142,7 +144,7 @@ public: } }; -class COptionLong : public COptionScalar { +class COptionLong final : public COptionScalar { public: template COptionLong(Ts&&... args) : @@ -150,7 +152,7 @@ public: } }; -class COptionString : public COptionScalar { +class COptionString final : public COptionScalar { public: template COptionString(Ts&&... args) : @@ -158,7 +160,7 @@ public: } }; -class COptionBool : public COptionScalar { +class COptionBool final : public COptionScalar { public: template COptionBool(Ts&&... args) : @@ -186,55 +188,59 @@ public: } }; -template -class COptionEnumList : public COptionBase { +template +class COptionEnumList final : public COptionBase { - map m; - unsigned short * & field; // Reference to the feildname - string name; // identifier for the option - unsigned short & size; + const map& m; + TField*& field; + unsigned short& mySize; + const string name; public: - COptionEnumList(string option_field_name, const map m, unsigned short * & option_field, unsigned short & list_size) : field(option_field) , size(list_size) { - this->m = m; - this->name = option_field_name; + COptionEnumList() = delete; + + COptionEnumList(string option_field_name, const map& m_, TField*& option_field, unsigned short& list_size) : + m(m_), + field(option_field), + mySize(list_size), + name(option_field_name) { } - ~COptionEnumList() override {}; + ~COptionEnumList() = default; + string SetValue(vector option_value) override { COptionBase::SetValue(option_value); if (option_value.size() == 1 && option_value[0].compare("NONE") == 0) { - this->size = 0; + mySize = 0; return ""; } // size is the length of the option list - this->size = option_value.size(); - unsigned short * enums = new unsigned short[size]; - for (int i = 0; i < this->size; i++) { + mySize = option_value.size(); + field = new TField[mySize]; + + for (unsigned short i = 0; i < mySize; i++) { // Check to see if the enum value is in the map - if (this->m.find(option_value[i]) == m.end()) { - string str; - str.append(this->name); + + auto it = m.find(option_value[i]); + + if (it == m.cend()) { + string str = name; str.append(": invalid option value "); str.append(option_value[i]); str.append(". Check current SU2 options in config_template.cfg."); return str; } // If it is there, set the option value - enums[i] = this->m[option_value[i]]; + field[i] = it->second; } - this->field = enums; return ""; } - void SetDefault() override { - // No default to set - size = 0; - } + void SetDefault() override { mySize = 0; } }; template -class COptionArray : public COptionBase { +class COptionArray final : public COptionBase { string name; // Identifier for the option const int size; // Number of elements Type* field; // Reference to the field @@ -297,9 +303,9 @@ public: typeName(type_name) { } - ~COptionScalarList() override = default; + ~COptionScalarList() = default; - string SetValue(vector option_value) override { + string SetValue(vector option_value) final { COptionBase::SetValue(option_value); // The size is the length of option_value mySize = option_value.size(); @@ -315,7 +321,6 @@ public: istringstream is(option_value[i]); Scalar val; if (!(is >> val)) { - delete [] field; return badValue(option_value, typeName+" list", name); } field[i] = std::move(val); @@ -323,12 +328,12 @@ public: return ""; } - void SetDefault() override { + void SetDefault() final { mySize = 0; // There is no default value for list } }; -class COptionDoubleList : public COptionScalarList { +class COptionDoubleList final : public COptionScalarList { public: template COptionDoubleList(Ts&&... args) : @@ -336,7 +341,7 @@ public: } }; -class COptionShortList : public COptionScalarList { +class COptionShortList final : public COptionScalarList { public: template COptionShortList(Ts&&... args) : @@ -344,7 +349,7 @@ public: } }; -class COptionUShortList : public COptionScalarList { +class COptionUShortList final : public COptionScalarList { public: template COptionUShortList(Ts&&... args) : @@ -352,7 +357,7 @@ public: } }; -class COptionStringList : public COptionScalarList { +class COptionStringList final : public COptionScalarList { public: template COptionStringList(Ts&&... args) : diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 14061dfbb86..6f82025635d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -59,7 +59,7 @@ vector GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for thi //#pragma omp threadprivate(Profile_Function_tp, Profile_Time_tp, Profile_ID_tp, Profile_Map_tp) -CConfig::CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_software, bool verb_high) { +CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software, bool verb_high) { /*--- Set the case name to the base config file name without extension ---*/ @@ -104,7 +104,7 @@ CConfig::CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_softwar } -CConfig::CConfig(istream &case_buffer, unsigned short val_software, bool verb_high) { +CConfig::CConfig(istream &case_buffer, SU2_COMPONENT val_software, bool verb_high) { base_config = true; @@ -140,7 +140,7 @@ CConfig::CConfig(istream &case_buffer, unsigned short val_software, bool verb_hi } -CConfig::CConfig(CConfig* config, char case_filename[MAX_STRING_SIZE], unsigned short val_software, unsigned short val_iZone, unsigned short val_nZone, bool verb_high) { +CConfig::CConfig(CConfig* config, char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software, unsigned short val_iZone, unsigned short val_nZone, bool verb_high) { caseName = config->GetCaseName(); @@ -186,7 +186,7 @@ CConfig::CConfig(CConfig* config, char case_filename[MAX_STRING_SIZE], unsigned } -CConfig::CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_software) { +CConfig::CConfig(char case_filename[MAX_STRING_SIZE], SU2_COMPONENT val_software) { /*--- Set the case name to the base config file name without extension ---*/ @@ -346,22 +346,22 @@ void CConfig::addBoolOption(const string name, bool & option_field, bool default // enum types work differently than all of the others because there are a small number of valid // string entries for the type. One must also provide a list of all the valid strings of that type. -template -void CConfig::addEnumOption(const string name, unsigned short & option_field, const map & enum_map, Tenum default_value) { +template +void CConfig::addEnumOption(const string name, TField& option_field, const map& enum_map, Tenum default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionEnum(name, enum_map, option_field, default_value); + COptionBase* val = new COptionEnum(name, enum_map, option_field, default_value); option_map.insert(pair(name, val)); return; } // input_size is the number of options read in from the config file -template -void CConfig::addEnumListOption(const string name, unsigned short & input_size, unsigned short * & option_field, const map & enum_map) { +template +void CConfig::addEnumListOption(const string name, unsigned short& input_size, TField*& option_field, const map& enum_map) { input_size = 0; assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionEnumList(name, enum_map, option_field, input_size); + COptionBase* val = new COptionEnumList(name, enum_map, option_field, input_size); option_map.insert( pair(name, val) ); } @@ -1067,7 +1067,7 @@ void CConfig::SetConfig_Options() { /*!\brief MULTIZONE \n DESCRIPTION: Enable multizone mode \ingroup Config*/ addBoolOption("MULTIZONE", Multizone_Problem, NO); /*!\brief PHYSICAL_PROBLEM \n DESCRIPTION: Physical governing equations \n Options: see \link Solver_Map \endlink \n DEFAULT: NO_SOLVER \ingroup Config*/ - addEnumOption("MULTIZONE_SOLVER", Kind_MZSolver, Multizone_Map, MZ_BLOCK_GAUSS_SEIDEL); + addEnumOption("MULTIZONE_SOLVER", Kind_MZSolver, Multizone_Map, ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL); #ifdef CODI_REVERSE_TYPE const bool discAdjDefault = true; #else @@ -1106,7 +1106,7 @@ void CConfig::SetConfig_Options() { addDoubleArrayOption("BODY_FORCE_VECTOR", 3, body_force); /* DESCRIPTION: Apply a body force as a source term for periodic boundary conditions \n Options: NONE, PRESSURE_DROP, MASSFLOW \n DEFAULT: NONE \ingroup Config */ - addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, NO_STREAMWISE_PERIODIC); + addEnumOption("KIND_STREAMWISE_PERIODIC", Kind_Streamwise_Periodic, Streamwise_Periodic_Map, ENUM_STREAMWISE_PERIODIC::NONE); /* DESCRIPTION: Use real periodicity for temperature \n Options: NO, YES \n DEFAULT: NO \ingroup Config */ addBoolOption("STREAMWISE_PERIODIC_TEMPERATURE", Streamwise_Periodic_Temperature, false); /* DESCRIPTION: Heatflux boundary at streamwise periodic 'outlet', choose heat [W] such that net domain heatflux is zero. Only active if STREAMWISE_PERIODIC_TEMPERATURE is active. \n DEFAULT: 0.0 \ingroup Config */ @@ -1246,7 +1246,7 @@ void CConfig::SetConfig_Options() { /*--- Options related to incompressible flow solver ---*/ /* DESCRIPTION: Option to choose the density model used in the incompressible flow solver. */ - addEnumOption("INC_DENSITY_MODEL", Kind_DensityModel, DensityModel_Map, CONSTANT); + addEnumOption("INC_DENSITY_MODEL", Kind_DensityModel, DensityModel_Map, INC_DENSITYMODEL::CONSTANT); /*!\brief ENERGY_EQUATION \n DESCRIPTION: Solve the energy equation in the incompressible flow solver. \ingroup Config*/ addBoolOption("INC_ENERGY_EQUATION", Energy_Equation, false); /*!\brief INC_DENSITY_REF \n DESCRIPTION: Reference density for incompressible flows \ingroup Config*/ @@ -1421,8 +1421,8 @@ void CConfig::SetConfig_Options() { addStringOption("ACTDISK_FILENAME", ActDisk_FileName, string("actdiskinput.dat")); /*!\brief INLET_TYPE \n DESCRIPTION: Inlet boundary type \n OPTIONS: see \link Inlet_Map \endlink \n DEFAULT: TOTAL_CONDITIONS \ingroup Config*/ - addEnumOption("INLET_TYPE", Kind_Inlet, Inlet_Map, TOTAL_CONDITIONS); - /*!\brief INC_INLET_TYPE \n DESCRIPTION: List of inlet types for incompressible flows. List length must match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. \ingroup Config*/ + addEnumOption("INLET_TYPE", Kind_Inlet, Inlet_Map, INLET_TYPE::TOTAL_CONDITIONS); + /*!\brief INC_INLET_TYPE \n DESCRIPTION: List of inlet types for incompressible flows. List length must match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET, INPUT_FILE. \ingroup Config*/ addEnumListOption("INC_INLET_TYPE", nInc_Inlet, Kind_Inc_Inlet, Inlet_Map); addBoolOption("SPECIFIED_INLET_PROFILE", Inlet_From_File, false); /*!\brief INLET_FILENAME \n DESCRIPTION: Input file for a specified inlet profile (w/ extension) \n DEFAULT: inlet.dat \ingroup Config*/ @@ -1506,8 +1506,8 @@ void CConfig::SetConfig_Options() { /*!\brief MARKER_OUTLET \n DESCRIPTION: Outlet boundary marker(s)\n Format: ( outlet marker, back pressure (static), ... ) \ingroup Config*/ addStringDoubleListOption("MARKER_OUTLET", nMarker_Outlet, Marker_Outlet, Outlet_Pressure); - /*!\brief INC_INLET_TYPE \n DESCRIPTION: List of inlet types for incompressible flows. List length must match number of inlet markers. Options: VELOCITY_INLET, PRESSURE_INLET. \ingroup Config*/ - addEnumListOption("INC_OUTLET_TYPE", nInc_Outlet, Kind_Inc_Outlet, Outlet_Map); + /*!\brief INC_INLET_TYPE \n DESCRIPTION: List of outlet types for incompressible flows. List length must match number of inlet markers. Options: PRESSURE_OUTLET, MASS_FLOW_OUTLET. \ingroup Config*/ + addEnumListOption("INC_OUTLET_TYPE", nInc_Outlet, Kind_Inc_Outlet, Inc_Outlet_Map); /*!\brief MARKER_ISOTHERMAL DESCRIPTION: Isothermal wall boundary marker(s)\n * Format: ( isothermal marker, wall temperature (static), ... ) \ingroup Config */ addStringDoubleListOption("MARKER_ISOTHERMAL", nMarker_Isothermal, Marker_Isothermal, Isothermal_Temperature); @@ -1607,7 +1607,7 @@ void CConfig::SetConfig_Options() { /*--- Options related to time-marching ---*/ /* DESCRIPTION: Unsteady simulation */ - addEnumOption("TIME_MARCHING", TimeMarching, TimeMarching_Map, STEADY); + addEnumOption("TIME_MARCHING", TimeMarching, TimeMarching_Map, TIME_MARCHING::STEADY); /* DESCRIPTION: Courant-Friedrichs-Lewy condition of the finest grid */ addDoubleOption("CFL_NUMBER", CFLFineGrid, 1.25); /* DESCRIPTION: Max time step in local time stepping simulations */ @@ -2356,7 +2356,7 @@ void CConfig::SetConfig_Options() { addDoubleListOption("TOPOL_OPTIM_FILTER_RADIUS", top_optim_nRadius, top_optim_filter_radius); addDoubleListOption("TOPOL_OPTIM_KERNEL_PARAM", top_optim_nKernelParams, top_optim_kernel_params); addUnsignedShortOption("TOPOL_OPTIM_SEARCH_LIMIT", top_optim_search_lim, 0); - addEnumOption("TOPOL_OPTIM_PROJECTION_TYPE", top_optim_proj_type, Projection_Function_Map, NO_PROJECTION); + addEnumOption("TOPOL_OPTIM_PROJECTION_TYPE", top_optim_proj_type, Projection_Function_Map, ENUM_PROJECTION_FUNCTION::NONE); addDoubleOption("TOPOL_OPTIM_PROJECTION_PARAM", top_optim_proj_param, 0.0); /* CONFIG_CATEGORY: FSI solver */ @@ -2497,7 +2497,7 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: CHT interface coupling methods */ /* Options: NO, YES \ingroup Config */ - addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, DIRECT_TEMPERATURE_ROBIN_HEATFLUX); + addEnumOption("CHT_COUPLING_METHOD", Kind_CHT_Coupling, CHT_Coupling_Map, CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX); /* DESCRIPTION: Thermal diffusivity constant */ addDoubleOption("THERMAL_DIFFUSIVITY", Thermal_Diffusivity, 1.172E-5); @@ -3050,7 +3050,7 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { } -void CConfig::SetHeader(unsigned short val_software) const{ +void CConfig::SetHeader(SU2_COMPONENT val_software) const{ if ((iZone == 0) && (rank == MASTER_NODE)){ cout << endl << "-------------------------------------------------------------------------" << endl; @@ -3058,11 +3058,11 @@ void CConfig::SetHeader(unsigned short val_software) const{ cout << "| / __| | | |_ ) Release 7.1.1 \"Blackbird\" |" << endl; cout << "| \\__ \\ |_| |/ / |" << endl; switch (val_software) { - case SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break; - case SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |" << endl; break; - case SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |" << endl; break; - case SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |" << endl; break; - case SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |" << endl; break; + case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break; + case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |" << endl; break; + case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |" << endl; break; + case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |" << endl; break; + case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |" << endl; break; } cout << "| |" << endl; @@ -3153,7 +3153,7 @@ void CConfig::SetnZone(){ } -void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_izone, unsigned short val_nDim) { +void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_izone, unsigned short val_nDim) { unsigned short iCFL, iMarker; bool ideal_gas = ((Kind_FluidModel == STANDARD_AIR) || @@ -3408,9 +3408,9 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Check for unsteady problem ---*/ - if ((TimeMarching == TIME_STEPPING || - TimeMarching == DT_STEPPING_1ST || - TimeMarching == DT_STEPPING_2ND) && !Time_Domain){ + if ((TimeMarching == TIME_MARCHING::TIME_STEPPING || + TimeMarching == TIME_MARCHING::DT_STEPPING_1ST || + TimeMarching == TIME_MARCHING::DT_STEPPING_2ND) && !Time_Domain){ SU2_MPI::Error("TIME_DOMAIN must be set to YES if TIME_MARCHING is " "TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER or DUAL_TIME_STEPPING-2ND_ORDER", CURRENT_FUNCTION); } @@ -3419,7 +3419,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Delta_UnstTime = Time_Step; Delta_DynTime = Time_Step; - if (TimeMarching == TIME_STEPPING){ InnerIter = 1; } + if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ InnerIter = 1; } /*--- Set the default write frequency to 1 if unsteady instead of 250 ---*/ if (!OptionIsSet("OUTPUT_WRT_FREQ")) { VolumeWrtFreq = 1; } @@ -3443,7 +3443,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ ScreenWrtFreq[0] = 1; HistoryWrtFreq[0] = 1; - if (TimeMarching != HARMONIC_BALANCE) { TimeMarching = STEADY; } + if (TimeMarching != TIME_MARCHING::HARMONIC_BALANCE) { TimeMarching = TIME_MARCHING::STEADY; } } /*--- Ensure that Discard_InFiles is false, owerwise the gradient could be wrong ---*/ @@ -3454,7 +3454,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Deactivate the multigrid in the adjoint problem ---*/ if ((ContinuousAdjoint && !MG_AdjointFlow) || - (TimeMarching == TIME_STEPPING)) { nMGLevels = 0; } + (TimeMarching == TIME_MARCHING::TIME_STEPPING)) { nMGLevels = 0; } if (Kind_Solver == EULER || Kind_Solver == NAVIER_STOKES || @@ -3465,16 +3465,16 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kind_Solver == FEM_NAVIER_STOKES || Kind_Solver == FEM_RANS || Kind_Solver == FEM_LES){ - Kind_Regime = COMPRESSIBLE; + Kind_Regime = ENUM_REGIME::COMPRESSIBLE; } else if (Kind_Solver == INC_EULER || Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS){ - Kind_Regime = INCOMPRESSIBLE; + Kind_Regime = ENUM_REGIME::INCOMPRESSIBLE; } else { - Kind_Regime = NO_FLOW; + Kind_Regime = ENUM_REGIME::NO_FLOW; } - if ((rank == MASTER_NODE) && ContinuousAdjoint && (Ref_NonDim == DIMENSIONAL) && (Kind_SU2 == SU2_CFD)) { + if ((rank == MASTER_NODE) && ContinuousAdjoint && (Ref_NonDim == DIMENSIONAL) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { cout << "WARNING: The adjoint solver should use a non-dimensional flow solution." << endl; } @@ -3496,7 +3496,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Check for unsupported features. ---*/ - if ((Kind_Solver != EULER && Kind_Solver != NAVIER_STOKES && Kind_Solver != RANS) && (TimeMarching == HARMONIC_BALANCE)){ + if ((Kind_Solver != EULER && Kind_Solver != NAVIER_STOKES && Kind_Solver != RANS) && (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE)){ SU2_MPI::Error("Harmonic Balance not yet implemented for the incompressible solver.", CURRENT_FUNCTION); } @@ -3605,7 +3605,7 @@ 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 (TimeMarching == TIME_STEPPING){ + if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ nIter = 1; nInnerIter = 1; } @@ -3634,8 +3634,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ there is no grid motion ---*/ if (GetGrid_Movement()){ - if ((Kind_SU2 == SU2_CFD || Kind_SU2 == SU2_SOL) && - (TimeMarching == STEADY && !Time_Domain)){ + if ((Kind_SU2 == SU2_COMPONENT::SU2_CFD || Kind_SU2 == SU2_COMPONENT::SU2_SOL) && + (TimeMarching == TIME_MARCHING::STEADY && !Time_Domain)){ if((Kind_GridMovement != ROTATING_FRAME) && (Kind_GridMovement != STEADY_TRANSLATION) && @@ -3652,7 +3652,7 @@ 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) { + if (Kind_SU2 != SU2_COMPONENT::SU2_DEF) { Opt_RelaxFactor = 1.0; } @@ -3745,7 +3745,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*-- Setting Harmonic Balance period from the config file */ - if (TimeMarching == HARMONIC_BALANCE) { + if (TimeMarching == TIME_MARCHING::HARMONIC_BALANCE) { HarmonicBalance_Period = GetHarmonicBalance_Period(); if (HarmonicBalance_Period < 0) { SU2_MPI::Error("Not a valid value for time period!!", CURRENT_FUNCTION); @@ -4216,7 +4216,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Kind_TimeIntScheme_FEM_Flow == ADER_DG) { - TimeMarching = TIME_STEPPING; // Only time stepping for ADER. + TimeMarching = TIME_MARCHING::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. */ @@ -4294,7 +4294,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Electric_Field_Dir = new su2double[2]; Electric_Field_Dir[0] = 0.0; Electric_Field_Dir[1] = 1.0; } - if ((Kind_SU2 == SU2_CFD) && (Kind_Solver == NO_SOLVER)) { + if ((Kind_SU2 == SU2_COMPONENT::SU2_CFD) && (Kind_Solver == NO_SOLVER)) { SU2_MPI::Error("PHYSICAL_PROBLEM must be set in the configuration file", CURRENT_FUNCTION); } @@ -4336,7 +4336,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Re-scale the length based parameters. The US system uses feet, but SU2 assumes that the grid is in inches ---*/ - if ((SystemMeasurements == US) && (Kind_SU2 == SU2_CFD)) { + if ((SystemMeasurements == US) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { for (iMarker = 0; iMarker < nMarker_Monitoring; iMarker++) { RefOriginMoment_X[iMarker] = RefOriginMoment_X[iMarker]/12.0; @@ -4393,7 +4393,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (DirectDiff != NO_DERIVATIVE) { #ifndef CODI_FORWARD_TYPE - if (Kind_SU2 == SU2_CFD) { + if (Kind_SU2 == SU2_COMPONENT::SU2_CFD) { SU2_MPI::Error(string("SU2_CFD: Config option DIRECT_DIFF= YES requires AD or complex support!\n") + string("Please use SU2_CFD_DIRECTDIFF (configuration/compilation is done using the preconfigure.py script)."), CURRENT_FUNCTION); @@ -4451,7 +4451,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } /*--- Set up the time stepping / unsteady CFL options. ---*/ - if ((TimeMarching == TIME_STEPPING) && (Unst_CFL != 0.0)) { + if ((TimeMarching == TIME_MARCHING::TIME_STEPPING) && (Unst_CFL != 0.0)) { for (iCFL = 0; iCFL < nCFL; iCFL++) CFL[iCFL] = Unst_CFL; } @@ -4497,7 +4497,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (Kind_Solver == INC_EULER) { /*--- Force inviscid problems to use constant density and disable energy. ---*/ - if (Kind_DensityModel != CONSTANT || Energy_Equation == true) { + if (Kind_DensityModel != INC_DENSITYMODEL::CONSTANT || Energy_Equation == true) { SU2_MPI::Error("Inviscid incompressible problems must be constant density (no energy eqn.).\n Use DENSITY_MODEL= CONSTANT and ENERGY_EQUATION= NO.", CURRENT_FUNCTION); } } @@ -4505,22 +4505,22 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ /*--- Default values should recover original incompressible behavior (for old config files). ---*/ if (Kind_Solver == INC_EULER || Kind_Solver == INC_NAVIER_STOKES || Kind_Solver == INC_RANS) { - if ((Kind_DensityModel == CONSTANT) || (Kind_DensityModel == BOUSSINESQ)) + if ((Kind_DensityModel == INC_DENSITYMODEL::CONSTANT) || (Kind_DensityModel == INC_DENSITYMODEL::BOUSSINESQ)) Kind_FluidModel = CONSTANT_DENSITY; } /*--- Energy equation must be active for any fluid models other than constant density. ---*/ - if (Kind_DensityModel != CONSTANT) Energy_Equation = true; + if (Kind_DensityModel != INC_DENSITYMODEL::CONSTANT) Energy_Equation = true; - if (Kind_DensityModel == BOUSSINESQ) { + if (Kind_DensityModel == INC_DENSITYMODEL::BOUSSINESQ) { Energy_Equation = true; if (Body_Force) { SU2_MPI::Error("Body force and Boussinesq source terms are not currently compatible.", CURRENT_FUNCTION); } } - if (Kind_DensityModel == VARIABLE) { + if (Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) { if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY) { SU2_MPI::Error("Variable density incompressible solver limited to ideal gases.\n Check the fluid model options (use INC_IDEAL_GAS, INC_IDEAL_GAS_POLY).", CURRENT_FUNCTION); } @@ -4596,7 +4596,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Inlet types for incompressible problem improperly specified.\n Use INC_INLET_TYPE= VELOCITY_INLET or PRESSURE_INLET.\n Must list a type for each inlet marker, including duplicates, e.g.,\n INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET PRESSURE_INLET", CURRENT_FUNCTION); } for (unsigned short iInlet = 0; iInlet < nInc_Inlet; iInlet++){ - if ((Kind_Inc_Inlet[iInlet] != VELOCITY_INLET) && (Kind_Inc_Inlet[iInlet] != PRESSURE_INLET)) { + if ((Kind_Inc_Inlet[iInlet] != INLET_TYPE::VELOCITY_INLET) && (Kind_Inc_Inlet[iInlet] != INLET_TYPE::PRESSURE_INLET)) { SU2_MPI::Error("Undefined incompressible inlet type. VELOCITY_INLET or PRESSURE_INLET possible.", CURRENT_FUNCTION); } } @@ -4609,7 +4609,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Outlet types for incompressible problem improperly specified.\n Use INC_OUTLET_TYPE= PRESSURE_OUTLET or MASS_FLOW_OUTLET.\n Must list a type for each inlet marker, including duplicates, e.g.,\n INC_OUTLET_TYPE= PRESSURE_OUTLET PRESSURE_OUTLET MASS_FLOW_OUTLET", CURRENT_FUNCTION); } for (unsigned short iInlet = 0; iInlet < nInc_Outlet; iInlet++){ - if ((Kind_Inc_Outlet[iInlet] != PRESSURE_OUTLET) && (Kind_Inc_Outlet[iInlet] != MASS_FLOW_OUTLET)) { + if ((Kind_Inc_Outlet[iInlet] != INC_OUTLET_TYPE::PRESSURE_OUTLET) && (Kind_Inc_Outlet[iInlet] != INC_OUTLET_TYPE::MASS_FLOW_OUTLET)) { SU2_MPI::Error("Undefined incompressible outlet type. PRESSURE_OUTLET or MASS_FLOW_OUTLET possible.", CURRENT_FUNCTION); } } @@ -4625,8 +4625,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } /*--- Check feassbility for Streamwise Periodic flow ---*/ - if (Kind_Streamwise_Periodic != NONE) { - if (Kind_Regime != INCOMPRESSIBLE) + if (Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE) { + if (Kind_Regime != ENUM_REGIME::INCOMPRESSIBLE) SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for incompressible flow.", CURRENT_FUNCTION); if (Kind_Solver == INC_EULER) SU2_MPI::Error("Streamwise Periodic Flow + Incompressible Euler: Not tested yet.", CURRENT_FUNCTION); @@ -4634,7 +4634,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ SU2_MPI::Error("Streamwise Periodic Flow currently only implemented for one Periodic Marker pair. Combining Streamwise and Spanwise periodicity not possible in the moment.", CURRENT_FUNCTION); if (Energy_Equation && Streamwise_Periodic_Temperature && nMarker_Isothermal != 0) SU2_MPI::Error("No MARKER_ISOTHERMAL marker allowed with STREAMWISE_PERIODIC_TEMPERATURE= YES, only MARKER_HEATFLUX & MARKER_SYM.", CURRENT_FUNCTION); - if (DiscreteAdjoint && Kind_Streamwise_Periodic == MASSFLOW) + if (DiscreteAdjoint && Kind_Streamwise_Periodic == ENUM_STREAMWISE_PERIODIC::MASSFLOW) SU2_MPI::Error("Discrete Adjoint currently not validated for prescribed MASSFLOW.", CURRENT_FUNCTION); if (Ref_Inc_NonDim != DIMENSIONAL) SU2_MPI::Error("Streamwise Periodicity only works with \"INC_NONDIM= DIMENSIONAL\", the nondimensionalization with source terms doesn;t work in general.", CURRENT_FUNCTION); @@ -4730,8 +4730,8 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (topology_optimization && top_optim_nKernel==0) { top_optim_nKernel = 1; - top_optim_kernels = new unsigned short [1]; - top_optim_kernels[0] = CONICAL_WEIGHT_FILTER; + top_optim_kernels = new ENUM_FILTER_KERNEL [1]; + top_optim_kernels[0] = ENUM_FILTER_KERNEL::CONICAL_WEIGHT; } if (top_optim_nKernel != 0) { @@ -4778,7 +4778,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ force the projected surface sensitivity file to be written. ---*/ Wrt_Projected_Sensitivity = false; - if ((Kind_SU2 == SU2_DOT) && (Design_Variable[0] == SURFACE_FILE)) { + if ((Kind_SU2 == SU2_COMPONENT::SU2_DOT) && (Design_Variable[0] == SURFACE_FILE)) { Wrt_Projected_Sensitivity = true; } @@ -4830,7 +4830,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ if (DiscreteAdjoint) { #if !defined CODI_REVERSE_TYPE - if (Kind_SU2 == SU2_CFD) { + if (Kind_SU2 == SU2_COMPONENT::SU2_CFD) { SU2_MPI::Error(string("SU2_CFD: Config option MATH_PROBLEM= DISCRETE_ADJOINT requires AD support!\n") + string("Please use SU2_CFD_AD (configuration/compilation is done using the preconfigure.py script)."), CURRENT_FUNCTION); @@ -4841,7 +4841,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ Kind_Linear_Solver = Kind_DiscAdj_Linear_Solver; Kind_Linear_Solver_Prec = Kind_DiscAdj_Linear_Prec; - if (TimeMarching) { + if (TimeMarching != TIME_MARCHING::STEADY) { Restart_Flow = false; @@ -4967,7 +4967,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ CURRENT_FUNCTION); } - if (CFL_Adapt && (TimeMarching == TIME_STEPPING)) { + if (CFL_Adapt && (TimeMarching == TIME_MARCHING::TIME_STEPPING)) { SU2_MPI::Error(string("CFL adaption not available for TIME_STEPPING integration.\n") + string("Please select CFL_ADAPT = NO."), CURRENT_FUNCTION); @@ -5002,7 +5002,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_ } } -void CConfig::SetMarkers(unsigned short val_software) { +void CConfig::SetMarkers(SU2_COMPONENT val_software) { unsigned short iMarker_All, iMarker_CfgFile, iMarker_Euler, iMarker_Custom, iMarker_FarField, iMarker_SymWall, iMarker_PerBound, @@ -5505,7 +5505,7 @@ void CConfig::SetMarkers(unsigned short val_software) { } -void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { +void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { unsigned short iMarker_Euler, iMarker_Custom, iMarker_FarField, iMarker_SymWall, iMarker_PerBound, iMarker_NearFieldBound, @@ -5524,7 +5524,7 @@ 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 (val_software == SU2_COMPONENT::SU2_CFD) { if (FSI_Problem) cout << "Fluid-Structure Interaction." << endl; @@ -5536,20 +5536,20 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { case EULER: case DISC_ADJ_EULER: case INC_EULER: case DISC_ADJ_INC_EULER: case FEM_EULER: case DISC_ADJ_FEM_EULER: - if (Kind_Regime == COMPRESSIBLE) cout << "Compressible Euler equations." << endl; - if (Kind_Regime == INCOMPRESSIBLE) cout << "Incompressible Euler equations." << endl; + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible Euler equations." << endl; + if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible Euler equations." << endl; break; case NAVIER_STOKES: case DISC_ADJ_NAVIER_STOKES: case INC_NAVIER_STOKES: case DISC_ADJ_INC_NAVIER_STOKES: case FEM_NAVIER_STOKES: case DISC_ADJ_FEM_NS: - if (Kind_Regime == COMPRESSIBLE) cout << "Compressible Laminar Navier-Stokes' equations." << endl; - if (Kind_Regime == INCOMPRESSIBLE) cout << "Incompressible Laminar Navier-Stokes' equations." << endl; + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible Laminar Navier-Stokes' equations." << endl; + if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible Laminar Navier-Stokes' equations." << endl; break; case RANS: case DISC_ADJ_RANS: case INC_RANS: case DISC_ADJ_INC_RANS: case FEM_RANS: case DISC_ADJ_FEM_RANS: - if (Kind_Regime == COMPRESSIBLE) cout << "Compressible RANS equations." << endl; - if (Kind_Regime == INCOMPRESSIBLE) cout << "Incompressible RANS equations." << endl; + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible RANS equations." << endl; + if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible RANS equations." << endl; cout << "Turbulence model: "; switch (Kind_Turb_Model) { case SA: cout << "Spalart Allmaras" << endl; break; @@ -5576,22 +5576,22 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } break; case NEMO_EULER: - if (Kind_Regime == COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl; + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl; if(Kind_FluidModel == SU2_NONEQ){ if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON")) SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION); } break; case NEMO_NAVIER_STOKES: - if (Kind_Regime == COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl; + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl; if(Kind_FluidModel == SU2_NONEQ){ if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON")) SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION); } break; case FEM_LES: - if (Kind_Regime == COMPRESSIBLE) cout << "Compressible LES equations." << endl; - if (Kind_Regime == INCOMPRESSIBLE) cout << "Incompressible LES equations." << endl; + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible LES equations." << endl; + if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible LES equations." << endl; cout << "Subgrid Scale model: "; switch (Kind_SGS_Model) { case IMPLICIT_LES: cout << "Implicit LES" << endl; break; @@ -5628,7 +5628,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } - if ((Kind_Regime == COMPRESSIBLE) && (Kind_Solver != FEM_ELASTICITY)) { + if ((Kind_Regime == ENUM_REGIME::COMPRESSIBLE) && (Kind_Solver != FEM_ELASTICITY)) { cout << "Mach number: " << Mach <<"."<< endl; cout << "Angle of attack (AoA): " << AoA <<" deg, and angle of sideslip (AoS): " << AoS <<" deg."<< endl; if ((Kind_Solver == NAVIER_STOKES) || (Kind_Solver == ADJ_NAVIER_STOKES) || @@ -5676,12 +5676,12 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { cout << "Read flow solution from: " << Solution_FileName << "." << endl; if (!fea){ - if (Kind_Regime == COMPRESSIBLE) { + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) { if (Ref_NonDim == DIMENSIONAL) { cout << "Dimensional simulation." << endl; } else if (Ref_NonDim == FREESTREAM_PRESS_EQ_ONE) { cout << "Non-Dimensional simulation (P=1.0, Rho=1.0, T=1.0 at the farfield)." << endl; } else if (Ref_NonDim == FREESTREAM_VEL_EQ_MACH) { cout << "Non-Dimensional simulation (V=Mach, Rho=1.0, T=1.0 at the farfield)." << endl; } else if (Ref_NonDim == FREESTREAM_VEL_EQ_ONE) { cout << "Non-Dimensional simulation (V=1.0, Rho=1.0, T=1.0 at the farfield)." << endl; } - } else if (Kind_Regime == INCOMPRESSIBLE) { + } else if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) { if (Ref_Inc_NonDim == DIMENSIONAL) { cout << "Dimensional simulation." << endl; } else if (Ref_Inc_NonDim == INITIAL_VALUES) { cout << "Non-Dimensional simulation using intialization values." << endl; } else if (Ref_Inc_NonDim == REFERENCE_VALUES) { cout << "Non-Dimensional simulation using user-specified reference values." << endl; } @@ -5800,7 +5800,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } - if (val_software == SU2_GEO) { + if (val_software == SU2_COMPONENT::SU2_GEO) { if (nMarker_GeoEval != 0) { cout << "Surface(s) where the geometrical based functions is evaluated: "; for (iMarker_GeoEval = 0; iMarker_GeoEval < nMarker_GeoEval; iMarker_GeoEval++) { @@ -5814,7 +5814,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { cout << "Input mesh file name: " << Mesh_FileName << endl; - if (val_software == SU2_DOT) { + if (val_software == SU2_COMPONENT::SU2_DOT) { if (DiscreteAdjoint) { cout << "Input sensitivity file name: " << GetObjFunc_Extension(Solution_AdjFileName) << "." << endl; }else { @@ -5822,18 +5822,18 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } } - if (val_software == SU2_DEF) { + if (val_software == SU2_COMPONENT::SU2_DEF) { cout << endl <<"---------------- Grid deformation parameters ( Zone " << iZone << " ) ----------------" << endl; cout << "Grid deformation using a linear elasticity method." << endl; if (Hold_GridFixed == YES) cout << "Hold some regions of the mesh fixed (hardcode implementation)." << endl; } - if (val_software == SU2_DOT) { + if (val_software == SU2_COMPONENT::SU2_DOT) { cout << endl <<"-------------- Surface deformation parameters ( Zone " << iZone << " ) ----------------" << endl; } - if (((val_software == SU2_DEF) || (val_software == SU2_DOT)) && (Design_Variable[0] != NO_DEFORMATION)) { + if (((val_software == SU2_COMPONENT::SU2_DEF) || (val_software == SU2_COMPONENT::SU2_DOT)) && (Design_Variable[0] != NO_DEFORMATION)) { for (unsigned short iDV = 0; iDV < nDV; iDV++) { @@ -5993,7 +5993,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } } - if (((val_software == SU2_CFD) && ( ContinuousAdjoint || DiscreteAdjoint)) || (val_software == SU2_DOT)) { + if (((val_software == SU2_COMPONENT::SU2_CFD) && ( ContinuousAdjoint || DiscreteAdjoint)) || (val_software == SU2_COMPONENT::SU2_DOT)) { cout << endl <<"---------------- Design problem definition ( Zone " << iZone << " ) ------------------" << endl; if (nObj==1) { @@ -6051,7 +6051,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } - if (val_software == SU2_CFD) { + if (val_software == SU2_COMPONENT::SU2_CFD) { cout << endl <<"--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl; if (SmoothNumGrid) cout << "There are some smoothing iterations on the grid coordinates." << endl; @@ -6332,24 +6332,29 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { if (!fea) { switch (TimeMarching) { - case NO: - cout << "Local time stepping (steady state simulation)." << endl; break; - case TIME_STEPPING: - cout << "Unsteady simulation using a time stepping strategy."<< endl; - if (Unst_CFL != 0.0) { - cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl; - if (Delta_UnstTime != 0.0) { - cout << "Synchronization time provided by the user (s): "<< Delta_UnstTime << "." << endl; + case TIME_MARCHING::STEADY: + cout << "Local time stepping (steady state simulation)." << endl; break; + + case TIME_MARCHING::TIME_STEPPING: + cout << "Unsteady simulation using a time stepping strategy."<< endl; + if (Unst_CFL != 0.0) { + cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl; + if (Delta_UnstTime != 0.0) { + cout << "Synchronization time provided by the user (s): "<< Delta_UnstTime << "." << endl; + } } - } - else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl; - break; - case DT_STEPPING_1ST: case DT_STEPPING_2ND: - if (TimeMarching == DT_STEPPING_1ST) cout << "Unsteady simulation, dual time stepping strategy (first order in time)."<< endl; - if (TimeMarching == DT_STEPPING_2ND) cout << "Unsteady simulation, dual time stepping strategy (second order in time)."<< endl; - if (Unst_CFL != 0.0) cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl; - else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl; - break; + else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl; + break; + + case TIME_MARCHING::DT_STEPPING_1ST: case TIME_MARCHING::DT_STEPPING_2ND: + if (TimeMarching == TIME_MARCHING::DT_STEPPING_1ST) cout << "Unsteady simulation, dual time stepping strategy (first order in time)."<< endl; + if (TimeMarching == TIME_MARCHING::DT_STEPPING_2ND) cout << "Unsteady simulation, dual time stepping strategy (second order in time)."<< endl; + if (Unst_CFL != 0.0) cout << "Time step computed by the code. Unsteady CFL number: " << Unst_CFL <<"."<< endl; + else cout << "Unsteady time step provided by the user (s): "<< Delta_UnstTime << "." << endl; + break; + + default: + break; } } else { @@ -6556,7 +6561,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } MGTable.PrintFooter(); } - if (TimeMarching != TIME_STEPPING) { + if (TimeMarching != TIME_MARCHING::TIME_STEPPING) { cout << "Courant-Friedrichs-Lewy number: "; cout.precision(3); cout.width(6); cout << CFL[0]; @@ -6571,7 +6576,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { cout << "Euler implicit time integration for the turbulence model." << endl; } - if (val_software == SU2_CFD) { + if (val_software == SU2_COMPONENT::SU2_CFD) { cout << endl <<"------------------ Convergence Criteria ( Zone " << iZone << " ) ---------------------" << endl; @@ -6602,7 +6607,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { cout << endl <<"-------------------- Output Information ( Zone " << iZone << " ) ----------------------" << endl; - if (val_software == SU2_CFD) { + if (val_software == SU2_COMPONENT::SU2_CFD) { cout << "Writing solution files every " << VolumeWrtFreq <<" iterations."<< endl; cout << "Writing the convergence history file every " << HistoryWrtFreq[2] <<" inner iterations."<< endl; @@ -6645,7 +6650,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } - if (val_software == SU2_SOL) { + if (val_software == SU2_COMPONENT::SU2_SOL) { switch (Tab_FileFormat) { case TAB_CSV: cout << "The tabular file format is CSV (.csv)." << endl; break; case TAB_TECPLOT: cout << "The tabular file format is Tecplot (.dat)." << endl; break; @@ -6653,7 +6658,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { cout << "Flow variables file name: " << Volume_FileName << "." << endl; } - if (val_software == SU2_DEF) { + if (val_software == SU2_COMPONENT::SU2_DEF) { cout << "Output mesh file name: " << Mesh_Out_FileName << ". " << endl; switch (GetDeform_Stiffness_Type()) { case INVERSE_VOLUME: @@ -6668,7 +6673,7 @@ void CConfig::SetOutput(unsigned short val_software, unsigned short val_izone) { } } - if (val_software == SU2_DOT) { + if (val_software == SU2_COMPONENT::SU2_DOT) { if (DiscreteAdjoint) { cout << "Output Volume Sensitivity file name: " << VolSens_FileName << ". " << endl; cout << "Output Surface Sensitivity file name: " << SurfSens_FileName << ". " << endl; @@ -8374,8 +8379,8 @@ bool CConfig::GetVolumetric_Movement() const { volumetric_movement = true; } - if (Kind_SU2 == SU2_DEF || - Kind_SU2 == SU2_DOT || + if (Kind_SU2 == SU2_COMPONENT::SU2_DEF || + Kind_SU2 == SU2_COMPONENT::SU2_DOT || DirectDiff) { volumetric_movement = true;} return volumetric_movement; @@ -8454,14 +8459,14 @@ su2double CConfig::GetExhaust_Pressure_Target(string val_marker) const { return Exhaust_Pressure_Target[iMarker_EngineExhaust]; } -unsigned short CConfig::GetKind_Inc_Inlet(string val_marker) const { +INLET_TYPE CConfig::GetKind_Inc_Inlet(string val_marker) const { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) if (Marker_Inlet[iMarker_Inlet] == val_marker) break; return Kind_Inc_Inlet[iMarker_Inlet]; } -unsigned short CConfig::GetKind_Inc_Outlet(string val_marker) const { +INC_OUTLET_TYPE CConfig::GetKind_Inc_Outlet(string val_marker) const { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if (Marker_Outlet[iMarker_Outlet] == val_marker) break; @@ -8658,7 +8663,7 @@ su2double CConfig::GetTotalPressureIn_BC() const { tot_pres_in = Riemann_Var1[iMarker_BC]; } } - if(nMarker_Inlet == 1 && Kind_Inlet == TOTAL_CONDITIONS){ + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ tot_pres_in = Inlet_Ptotal[0]; } return tot_pres_in/Pressure_Ref; @@ -8678,7 +8683,7 @@ su2double CConfig::GetTotalTemperatureIn_BC() const { } } - if(nMarker_Inlet == 1 && Kind_Inlet == TOTAL_CONDITIONS){ + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ tot_temp_in = Inlet_Ttotal[0]; } return tot_temp_in/Temperature_Ref; @@ -8697,7 +8702,7 @@ void CConfig::SetTotalTemperatureIn_BC(su2double val_temp) { } } - if(nMarker_Inlet == 1 && Kind_Inlet == TOTAL_CONDITIONS){ + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ Inlet_Ttotal[0] = val_temp*Temperature_Ref; } } @@ -8716,7 +8721,7 @@ su2double CConfig::GetFlowAngleIn_BC() const { } } - if(nMarker_Inlet == 1 && Kind_Inlet == TOTAL_CONDITIONS){ + if(nMarker_Inlet == 1 && Kind_Inlet == INLET_TYPE::TOTAL_CONDITIONS){ alpha_in = atan(Inlet_FlowDir[0][1]/Inlet_FlowDir[0][0]); } @@ -8728,9 +8733,9 @@ su2double CConfig::GetIncInlet_BC() const { su2double val_out = 0.0; if (nMarker_Inlet > 0) { - if (Kind_Inc_Inlet[0] == VELOCITY_INLET) + if (Kind_Inc_Inlet[0] == INLET_TYPE::VELOCITY_INLET) val_out = Inlet_Ptotal[0]/Velocity_Ref; - else if (Kind_Inc_Inlet[0] == PRESSURE_INLET) + else if (Kind_Inc_Inlet[0] == INLET_TYPE::PRESSURE_INLET) val_out = Inlet_Ptotal[0]/Pressure_Ref; } @@ -8740,9 +8745,9 @@ su2double CConfig::GetIncInlet_BC() const { void CConfig::SetIncInlet_BC(su2double val_in) { if (nMarker_Inlet > 0) { - if (Kind_Inc_Inlet[0] == VELOCITY_INLET) + if (Kind_Inc_Inlet[0] == INLET_TYPE::VELOCITY_INLET) Inlet_Ptotal[0] = val_in*Velocity_Ref; - else if (Kind_Inc_Inlet[0] == PRESSURE_INLET) + else if (Kind_Inc_Inlet[0] == INLET_TYPE::PRESSURE_INLET) Inlet_Ptotal[0] = val_in*Pressure_Ref; } } diff --git a/Common/src/fem/fem_geometry_structure.cpp b/Common/src/fem/fem_geometry_structure.cpp index 81bf8806189..19f387818bc 100644 --- a/Common/src/fem/fem_geometry_structure.cpp +++ b/Common/src/fem/fem_geometry_structure.cpp @@ -5370,14 +5370,14 @@ void CMeshFEM_DG::MetricTermsVolumeElements(CConfig *config) { bool FullMassMatrix = false, FullInverseMassMatrix = false; bool LumpedMassMatrix = false, DerMetricTerms = false; - if(config->GetTime_Marching() == STEADY || - config->GetTime_Marching() == ROTATIONAL_FRAME) { + if(config->GetTime_Marching() == TIME_MARCHING::STEADY || + config->GetTime_Marching() == TIME_MARCHING::ROTATIONAL_FRAME) { if( UseLumpedMassMatrix) LumpedMassMatrix = true; else FullInverseMassMatrix = true; } - else if(config->GetTime_Marching() == DT_STEPPING_1ST || - config->GetTime_Marching() == DT_STEPPING_2ND || - config->GetTime_Marching() == HARMONIC_BALANCE) { + else if(config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || + config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND || + config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { if( UseLumpedMassMatrix ) FullMassMatrix = LumpedMassMatrix = true; else FullInverseMassMatrix = true; } diff --git a/Common/src/fem/geometry_structure_fem_part.cpp b/Common/src/fem/geometry_structure_fem_part.cpp index f7df5ab3e30..9f0384b6873 100644 --- a/Common/src/fem/geometry_structure_fem_part.cpp +++ b/Common/src/fem/geometry_structure_fem_part.cpp @@ -389,7 +389,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->GetTime_Marching() == HARMONIC_BALANCE; + bool time_spectral = config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE; unsigned short nMarker_Max = config->GetnMarker_Max(); nZone = val_nZone; diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index caa11e9239a..e238bfeac2a 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -622,7 +622,7 @@ void CGeometry::GetCommCountAndType(const CConfig* config, MPI_TYPE = COMM_TYPE_DOUBLE; break; case COORDINATES_OLD: - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) COUNT_PER_POINT = nDim*2; else COUNT_PER_POINT = nDim; @@ -721,7 +721,7 @@ void CGeometry::InitiateComms(CGeometry *geometry, for (iDim = 0; iDim < nDim; iDim++) { bufDSend[buf_offset+iDim] = vector[iDim]; } - if (config->GetTime_Marching() == DT_STEPPING_2ND) { + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) { vector = nodes->GetCoord_n1(iPoint); for (iDim = 0; iDim < nDim; iDim++) { bufDSend[buf_offset+nDim+iDim] = vector[iDim]; @@ -830,7 +830,7 @@ void CGeometry::CompleteComms(CGeometry *geometry, break; case COORDINATES_OLD: nodes->SetCoord_n(iPoint, &bufDRecv[buf_offset]); - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) nodes->SetCoord_n1(iPoint, &bufDRecv[buf_offset+nDim]); break; case MAX_LENGTH: @@ -3100,7 +3100,7 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { } void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, - const vector > &kernels, + const vector > &kernels, const unsigned short search_limit, su2double *values) const { @@ -3212,7 +3212,7 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, for (unsigned long iKernel=0; iKernel &filter_radius, switch ( kernel_type ) { /*--- distance-based kernels (weighted averages) ---*/ - case CONSTANT_WEIGHT_FILTER: case CONICAL_WEIGHT_FILTER: case GAUSSIAN_WEIGHT_FILTER: + case ENUM_FILTER_KERNEL::CONSTANT_WEIGHT: + case ENUM_FILTER_KERNEL::CONICAL_WEIGHT: + case ENUM_FILTER_KERNEL::GAUSSIAN_WEIGHT: for (auto idx : neighbours) { @@ -3278,9 +3280,9 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, distance = sqrt(distance); switch ( kernel_type ) { - case CONSTANT_WEIGHT_FILTER: weight = 1.0; break; - case CONICAL_WEIGHT_FILTER: weight = kernel_radius-distance; break; - case GAUSSIAN_WEIGHT_FILTER: weight = exp(-0.5*pow(distance/kernel_param,2)); break; + case ENUM_FILTER_KERNEL::CONSTANT_WEIGHT: weight = 1.0; break; + case ENUM_FILTER_KERNEL::CONICAL_WEIGHT: weight = kernel_radius-distance; break; + case ENUM_FILTER_KERNEL::GAUSSIAN_WEIGHT: weight = exp(-0.5*pow(distance/kernel_param,2)); break; default: break; } weight *= vol_elem[idx]; @@ -3291,19 +3293,20 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, break; /*--- morphology kernels (image processing) ---*/ - case DILATE_MORPH_FILTER: case ERODE_MORPH_FILTER: + case ENUM_FILTER_KERNEL::DILATE_MORPH: + case ENUM_FILTER_KERNEL::ERODE_MORPH: for (auto idx : neighbours) { switch ( kernel_type ) { - case DILATE_MORPH_FILTER: numerator += exp(kernel_param*work_values[idx]); break; - case ERODE_MORPH_FILTER: numerator += exp(kernel_param*(1.0-work_values[idx])); break; + case ENUM_FILTER_KERNEL::DILATE_MORPH: numerator += exp(kernel_param*work_values[idx]); break; + case ENUM_FILTER_KERNEL::ERODE_MORPH: numerator += exp(kernel_param*(1.0-work_values[idx])); break; default: break; } denominator += 1.0; } values[iElem] = log(numerator/denominator)/kernel_param; - if ( kernel_type==ERODE_MORPH_FILTER ) values[iElem] = 1.0-values[iElem]; + if ( kernel_type==ENUM_FILTER_KERNEL::ERODE_MORPH ) values[iElem] = 1.0-values[iElem]; break; default: @@ -3645,8 +3648,8 @@ void CGeometry::SetGridVelocity(CConfig *config, unsigned long iter) { /*--- Get timestep and whether to use 1st or 2nd order backward finite differences ---*/ - bool FirstOrder = (config->GetTime_Marching() == DT_STEPPING_1ST); - bool SecondOrder = (config->GetTime_Marching() == DT_STEPPING_2ND); + bool FirstOrder = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); + bool SecondOrder = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); su2double TimeStep = config->GetDelta_UnstTimeND(); diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 688972ce1f1..75db70bc909 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -111,7 +111,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, /*--- Loop over the points element to re-scale the mesh, and plot it (only SU2_CFD) ---*/ - if (config->GetKind_SU2() == SU2_CFD) { + if (config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) { /*--- The US system uses feet, but SU2 assumes that the grid is in inches ---*/ @@ -127,7 +127,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, /*--- If SU2_DEF then write a file with the boundary information ---*/ - if ((config->GetKind_SU2() == SU2_DEF) && (rank == MASTER_NODE)) { + if ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) && (rank == MASTER_NODE)) { string str = "boundary.dat"; @@ -8685,11 +8685,11 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { unsigned long iTimeIter, nTimeIter; su2double delta_T, total_T; - if (config->GetTime_Marching() && config->GetTime_Domain()) { + if ((config->GetTime_Marching() != TIME_MARCHING::STEADY) && 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) { + } else if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { /*--- Compute period of oscillation & compute time interval using nTimeInstances ---*/ @@ -8716,11 +8716,11 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { strcpy (cstr, surfadj_filename.c_str()); /*--- Write file name with extension if unsteady or steady ---*/ - if (config->GetTime_Marching() == HARMONIC_BALANCE) + if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); - if ((config->GetTime_Marching() && config->GetTime_Domain()) || - (config->GetTime_Marching() == HARMONIC_BALANCE)) { + if (((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) || + (config->GetTime_Marching() == TIME_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)); diff --git a/Common/src/geometry/dual_grid/CPoint.cpp b/Common/src/geometry/dual_grid/CPoint.cpp index b1fc6bb7896..810f60321b6 100644 --- a/Common/src/geometry/dual_grid/CPoint.cpp +++ b/Common/src/geometry/dual_grid/CPoint.cpp @@ -63,7 +63,7 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) { Volume.resize(npoint) = su2double(0.0); Periodic_Volume.resize(npoint) = su2double(0.0); - if (config->GetTime_Marching() != NO) { + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) { Volume_n.resize(npoint) = su2double(0.0); Volume_nM1.resize(npoint) = su2double(0.0); } @@ -113,7 +113,7 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) { /*--- Structures for storing old node coordinates for computing grid * velocities via finite differencing with dynamically deforming meshes. ---*/ /*--- In the case of CMeshSolver, these coordinates are stored as solutions to the mesh problem. ---*/ - if (config->GetGrid_Movement() && (config->GetTime_Marching() != NO)) { + if (config->GetGrid_Movement() && (config->GetTime_Marching() != TIME_MARCHING::STEADY)) { Coord_n.resize(npoint,nDim) = su2double(0.0); Coord_p1.resize(npoint,nDim) = su2double(0.0); Coord_n1.resize(npoint,nDim) = su2double(0.0); diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index 8478792ec07..5bbef194acd 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -36,8 +36,8 @@ CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig *val_config, actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && - ((config->GetKind_SU2() == SU2_CFD) || - ((config->GetKind_SU2() == SU2_DEF) && + ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || + ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) && (config->GetActDisk_SU2_DEF())))); if (config->GetActDisk_DoubleSurface()) actuator_disk = false; ActDiskNewPoints = 0; @@ -72,7 +72,7 @@ CSU2ASCIIMeshReaderFVM::~CSU2ASCIIMeshReaderFVM(void) { } void CSU2ASCIIMeshReaderFVM::ReadMetadata() { - bool harmonic_balance = config->GetTime_Marching() == HARMONIC_BALANCE; + bool harmonic_balance = config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE; bool multizone_file = config->GetMultizone_Mesh(); /*--- Open grid file ---*/ diff --git a/Common/src/grid_movement/CSurfaceMovement.cpp b/Common/src/grid_movement/CSurfaceMovement.cpp index 0c1b9103347..e527285daa4 100644 --- a/Common/src/grid_movement/CSurfaceMovement.cpp +++ b/Common/src/grid_movement/CSurfaceMovement.cpp @@ -214,7 +214,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Output original FFD FFDBox ---*/ - if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_DOT)) { + if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_COMPONENT::SU2_DOT)) { for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ auto FileFormat = config->GetVolumeOutputFiles(); @@ -303,7 +303,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g MaxDiff = SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, false); - if ((MaxDiff > BoundLimit) && (config->GetKind_SU2() == SU2_DEF)) { + if ((MaxDiff > BoundLimit) && (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF)) { if (rank == MASTER_NODE) cout << "Out-of-bounds, re-adjusting scale factor to safisfy line search limit." << endl; @@ -322,7 +322,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g } /*--- Set total deformation values in config ---*/ - if (config->GetKind_SU2() == SU2_DEF) { + if (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) { totaldeformation.resize(config->GetnDV()); for (iDV = 0; iDV < config->GetnDV(); iDV++) { @@ -493,7 +493,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Output the deformed FFD Boxes ---*/ - if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_DOT)) { + if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_COMPONENT::SU2_DOT)) { for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ auto FileFormat = config->GetVolumeOutputFiles(); @@ -1031,7 +1031,7 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi bool KPlane_Intersect_A = false, KPlane_Intersect_B = false; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - unsigned short Kind_SU2 = config->GetKind_SU2(); + SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); bool FFD_Symmetry_Plane = config->GetFFD_Symmetry_Plane(); bool cylindrical = (config->GetFFD_CoordSystem() == CYLINDRICAL); bool spherical = (config->GetFFD_CoordSystem() == SPHERICAL); @@ -1114,10 +1114,10 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_CFD)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_DEF)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_GEO)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_DOT)) || + if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_GEO)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DOT)) || ((config->GetMarker_All_DV(iMarker) == YES) && (config->GetDirectDiff() == D_DESIGN))) { for (iElem = 0; iElem < geometry->GetnElem_Bound(iMarker); iElem++) { @@ -3416,7 +3416,7 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con char buffer[50]; string DV_Filename, UnstExt, text_line; ifstream surface_positions; - bool unsteady = config->GetTime_Marching(); + bool unsteady = config->GetTime_Marching() != TIME_MARCHING::STEADY; bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Load stuff from config ---*/ @@ -3476,8 +3476,8 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con if (nDim == 2) point_line >> iPoint >> NewCoord[0] >> NewCoord[1]; if (nDim == 3) point_line >> iPoint >> NewCoord[0] >> NewCoord[1] >> NewCoord[2]; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_DV(iMarker) == YES && config->GetKind_SU2() == SU2_DEF) || - (config->GetMarker_All_Moving(iMarker) == YES && config->GetKind_SU2() == SU2_CFD)) { + if ((config->GetMarker_All_DV(iMarker) == YES && config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) || + (config->GetMarker_All_Moving(iMarker) == YES && config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD)) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { jPoint = geometry->vertex[iMarker][iVertex]->GetNode(); GlobalIndex = geometry->nodes->GetGlobalIndex(jPoint); @@ -3558,8 +3558,8 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con /*--- Loop through to find only moving surface markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_DV(iMarker) == YES && config->GetKind_SU2() == SU2_DEF) || - (config->GetMarker_All_Moving(iMarker) == YES && config->GetKind_SU2() == SU2_CFD)) { + if ((config->GetMarker_All_DV(iMarker) == YES && config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) || + (config->GetMarker_All_Moving(iMarker) == YES && config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD)) { /*--- Loop over all surface points for this marker ---*/ @@ -3703,7 +3703,7 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { deforming meshes (MARKER_MOVING), while SU2_DEF will use it for deforming meshes after imposing design variable surface deformations (DV_MARKER). ---*/ - unsigned short Kind_SU2 = config->GetKind_SU2(); + SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); /*--- Read the coordinates. Two main formats: - Selig are in an x, y format starting from trailing edge, along the upper surface to the leading @@ -3874,8 +3874,8 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { TotalArch = 0.0; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_CFD)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_DEF))) { + if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF))) { for (iVertex = 0; iVertex < boundary->nVertex[iMarker]-1; iVertex++) { Coord_i = boundary->vertex[iMarker][iVertex]->GetCoord(); Coord_ip1 = boundary->vertex[iMarker][iVertex+1]->GetCoord(); @@ -3898,8 +3898,8 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { Arch = 0.0; for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; - if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_CFD)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_DEF))) { + if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF))) { Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); if (iVertex == 0) Arch = 0.0; diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index 467d342ced1..7be3d23435d 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -126,7 +126,7 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co /*--- Disable the screen output if we're running SU2_CFD ---*/ - if (config->GetKind_SU2() == SU2_CFD && !Derivative) Screen_Output = false; + if (config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD && !Derivative) Screen_Output = false; /*--- Set the number of nonlinear iterations to 1 if Derivative computation is enabled ---*/ @@ -182,11 +182,11 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co /*--- If we want no derivatives or the direct derivatives, we solve the system using the * normal matrix vector product and preconditioner. For the mesh sensitivities using * the discrete adjoint method we solve the system using the transposed matrix. ---*/ - if (!Derivative || ((config->GetKind_SU2() == SU2_CFD) && Derivative)) { + if (!Derivative || ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) && Derivative)) { Tot_Iter = System.Solve(StiffMatrix, LinSysRes, LinSysSol, geometry, config); - } else if (Derivative && (config->GetKind_SU2() == SU2_DOT)) { + } else if (Derivative && (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)) { Tot_Iter = System.Solve_b(StiffMatrix, LinSysRes, LinSysSol, geometry, config); } @@ -1628,7 +1628,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig deforming meshes (MARKER_MOVING), while SU2_DEF will use it for deforming meshes after imposing design variable surface deformations (DV_MARKER). ---*/ - unsigned short Kind_SU2 = config->GetKind_SU2(); + SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); /*--- If requested (no by default) impose the surface deflections in increments and solve the grid deformation equations iteratively with @@ -1659,10 +1659,10 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig could be on on the symmetry plane, we should specify DeleteValsRowi again (just in case) ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_CFD)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_DEF)) || - ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_CFD) && (config->GetMarker_All_DV(iMarker) == YES)) || - ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_DOT))) { + if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF)) || + ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD) && (config->GetMarker_All_DV(iMarker) == YES)) || + ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DOT))) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); @@ -1736,7 +1736,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig /*--- Move the FSI interfaces ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_ZoneInterface(iMarker) == YES) && (Kind_SU2 == SU2_CFD)) { + if ((config->GetMarker_All_ZoneInterface(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); @@ -1757,8 +1757,8 @@ void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *c unsigned long iPoint, total_index, iVertex; su2double * VarCoord; - unsigned short Kind_SU2 = config->GetKind_SU2(); - if ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_CFD)) { + SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); + if ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_DV(iMarker) == YES)) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -1773,7 +1773,7 @@ void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *c } } if (LinSysRes.norm() == 0.0) cout << "Warning: Derivatives are zero!" << endl; - } else if (Kind_SU2 == SU2_DOT) { + } else if (Kind_SU2 == SU2_COMPONENT::SU2_DOT) { for (iPoint = 0; iPoint < nPoint; iPoint++) { for (iDim = 0; iDim < nDim; iDim++) { @@ -1790,11 +1790,11 @@ void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConf unsigned long iPoint, total_index, iVertex; su2double *new_coord = new su2double[3]; - unsigned short Kind_SU2 = config->GetKind_SU2(); + SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); /*--- Update derivatives of the grid coordinates using the solution of the linear system after grid deformation (LinSysSol contains the derivatives of the x, y, z displacements). ---*/ - if ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_CFD)) { + if ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { new_coord[0] = 0.0; new_coord[1] = 0.0; new_coord[2] = 0.0; for (iDim = 0; iDim < nDim; iDim++) { @@ -1804,7 +1804,7 @@ void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConf } geometry->nodes->SetCoord(iPoint, new_coord); } - } else if (Kind_SU2 == SU2_DOT) { + } else if (Kind_SU2 == SU2_COMPONENT::SU2_DOT) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if(config->GetSolid_Wall(iMarker) || (config->GetMarker_All_DV(iMarker) == YES)) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -1880,7 +1880,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->GetTime_Marching() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Problem dimension and physical time step ---*/ @@ -2042,7 +2042,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->GetTime_Marching() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Retrieve values from the config file ---*/ @@ -2188,7 +2188,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->GetTime_Marching() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Retrieve values from the config file ---*/ @@ -2319,7 +2319,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->GetTime_Marching() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); /*--- Retrieve values from the config file ---*/ diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index c8bd4164d32..14752136f9d 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -108,7 +108,7 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi auto prec = config->GetKind_Linear_Solver_Prec(); if ((!EdgeConnect && !config->GetStructuralProblem()) || - (config->GetKind_SU2() == SU2_DEF) || (config->GetKind_SU2() == SU2_DOT)) { + (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) || (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)) { /*--- FEM-type connectivity in non-structural context implies mesh deformation. ---*/ prec = config->GetKind_Deform_Linear_Solver_Prec(); } diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index 66306655407..45e54033ce5 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -931,7 +931,7 @@ unsigned long CSysSolve::Solve(CSysMatrix & Jacobian, co if(TapeActive) { /*--- To keep the behavior of SU2_DOT, but not strictly required since jacobian is symmetric(?). ---*/ - const bool RequiresTranspose = !mesh_deform || (config->GetKind_SU2() == SU2_DOT); + const bool RequiresTranspose = !mesh_deform || (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT); if (!mesh_deform) KindPrecond = config->GetKind_DiscAdj_Linear_Prec(); else KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); diff --git a/Common/src/toolboxes/MMS/CIncTGVSolution.cpp b/Common/src/toolboxes/MMS/CIncTGVSolution.cpp index d0b16ffae3d..b930016b483 100644 --- a/Common/src/toolboxes/MMS/CIncTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CIncTGVSolution.cpp @@ -64,9 +64,9 @@ CIncTGVSolution::CIncTGVSolution(unsigned short val_nDim, /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetTime_Marching() != TIME_STEPPING) && - (config->GetTime_Marching() != DT_STEPPING_1ST) && - (config->GetTime_Marching() != DT_STEPPING_2ND)) + if((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config->GetTime_Marching() != TIME_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 8537c906798..1d2685d26ad 100644 --- a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp +++ b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp @@ -61,9 +61,9 @@ CInviscidVortexSolution::CInviscidVortexSolution(unsigned short val_nDim, gamOvGm1 = ovGm1*Gamma; /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetTime_Marching() != TIME_STEPPING) && - (config->GetTime_Marching() != DT_STEPPING_1ST) && - (config->GetTime_Marching() != DT_STEPPING_2ND)) + if((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config->GetTime_Marching() != TIME_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 30123a8fa32..c1f873e69ab 100644 --- a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp @@ -61,7 +61,7 @@ CMMSIncEulerSolution::CMMSIncEulerSolution(unsigned short val_nDim, epsilon = 0.001; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 5634799e7d3..67ed6204baf 100644 --- a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp @@ -62,7 +62,7 @@ CMMSIncNSSolution::CMMSIncNSSolution(unsigned short val_nDim, epsilon = 0.001; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 ff3e73adb1b..ab4138a7e5c 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp @@ -79,7 +79,7 @@ CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(unsigned short val_nD a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 cae66b7e841..22301dd4a86 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp @@ -84,7 +84,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->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 26437be2cf6..1042db75d7c 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp @@ -88,7 +88,7 @@ CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution(unsigned short val_nDim, v_y = 4.0; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 777d517ace6..d309102e0bf 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp @@ -81,7 +81,7 @@ CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(unsigned short val_nD a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 6966eafa8b6..0b41b4a23aa 100644 --- a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp @@ -54,7 +54,7 @@ CNSUnitQuadSolution::CNSUnitQuadSolution(unsigned short val_nDim, Viscosity = config->GetMu_ConstantND(); /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 8c3e1f61136..315c429f95c 100644 --- a/Common/src/toolboxes/MMS/CRinglebSolution.cpp +++ b/Common/src/toolboxes/MMS/CRinglebSolution.cpp @@ -51,7 +51,7 @@ CRinglebSolution::CRinglebSolution(unsigned short val_nDim, tGamOvGm1 = Gamma*tovGm1; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != STEADY) + if(config->GetTime_Marching() != TIME_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 ec65bf6a29d..a59772a8c75 100644 --- a/Common/src/toolboxes/MMS/CTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CTGVSolution.cpp @@ -58,9 +58,9 @@ CTGVSolution::CTGVSolution(unsigned short val_nDim, /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetTime_Marching() != TIME_STEPPING) && - (config->GetTime_Marching() != DT_STEPPING_1ST) && - (config->GetTime_Marching() != DT_STEPPING_2ND)) + if((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) SU2_MPI::Error("Unsteady mode must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index e990fc1e0c9..3a181ec54de 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -35,9 +35,9 @@ * \brief Class for compressible inviscid flow problems, serves as base for Navier-Stokes/RANS. * \author F. Palacios */ -class CEulerSolver : public CFVMFlowSolverBase { +class CEulerSolver : public CFVMFlowSolverBase { protected: - using BaseClass = CFVMFlowSolverBase; + using BaseClass = CFVMFlowSolverBase; su2double Prandtl_Lam = 0.0, /*!< \brief Laminar Prandtl number. */ @@ -277,7 +277,7 @@ class CEulerSolver : public CFVMFlowSolverBase { /*! * \brief Constructor of the class. */ - CEulerSolver() : CFVMFlowSolverBase() {} + CEulerSolver() : CFVMFlowSolverBase() {} /*! * \overload Main constructor of this class. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 94afc9e227a..d293bb827da 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -330,9 +330,9 @@ class CFVMFlowSolverBase : public CSolver { const bool viscous = config->GetViscous(); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool time_stepping = (config->GetTime_Marching() == TIME_STEPPING); - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool time_stepping = (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING); + const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const su2double K_v = 0.25; /*--- Init thread-shared variables to compute min/max values. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index a668db4f00d..4b741211873 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -493,7 +493,7 @@ void CFVMFlowSolverBase::ComputeVerificationError(CGeometry* geometry, CCo if (VerificationSolution && VerificationSolution->ExactSolutionKnown()) { /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /*--- Reset the global error measures to zero. ---*/ for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -734,9 +734,9 @@ void CFVMFlowSolverBase::LoadRestart_impl(CGeometry **geometry, CSolver ** su2double Area_Children, Area_Parent; const su2double* Solution_Fine = nullptr; const passivedouble* Coord = nullptr; - 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 dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + bool static_fsi = ((config->GetTime_Marching() == TIME_MARCHING::STEADY) && config->GetFSI_Simulation()); bool steady_restart = config->GetSteadyRestart(); bool turbulent = (config->GetKind_Turb_Model() != NONE); @@ -959,8 +959,8 @@ void CFVMFlowSolverBase::SetInitialCondition(CGeometry **geometry, CSolver const bool restart = (config->GetRestart() || config->GetRestart_Flow()); const bool rans = (config->GetKind_Turb_Model() != NONE); - const bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + const bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); /*--- Start OpenMP parallel region. ---*/ @@ -1019,7 +1019,7 @@ void CFVMFlowSolverBase::PushSolutionBackInTime(unsigned long TimeIter, bo } } - if (restart && (TimeIter == config->GetRestart_Iter()) && (config->GetTime_Marching() == DT_STEPPING_2ND)) { + if (restart && (TimeIter == config->GetRestart_Iter()) && (config->GetTime_Marching() == TIME_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, config->GetRestart_Iter() - 1, @@ -1361,7 +1361,7 @@ void CFVMFlowSolverBase::BC_Fluid_Interface(CGeometry* geometry, conv_numerics->SetPrimitive(PrimVar_i, PrimVar_j); - if (FlowRegime == COMPRESSIBLE) { + if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) { if (!(config->GetKind_FluidModel() == STANDARD_AIR || config->GetKind_FluidModel() == IDEAL_GAS)) { auto Secondary_i = nodes->GetSecondary(iPoint); @@ -1488,7 +1488,7 @@ void CFVMFlowSolverBase::BC_Custom(CGeometry* geometry, CSolver** solver_c /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -1608,8 +1608,8 @@ void CFVMFlowSolverBase::SetResidual_DualTime(CGeometry *geometry su2double Residual_GCL; const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool first_order = (config->GetTime_Marching() == DT_STEPPING_1ST); - const bool second_order = (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool first_order = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); + const bool second_order = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); /*--- Store the physical time step ---*/ @@ -1794,7 +1794,7 @@ void CFVMFlowSolverBase::Pressure_Forces(const CGeometry* geometr /// TODO: Move these ifs to specialized functions. - if (FlowRegime == COMPRESSIBLE) { + if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) { /*--- Evaluate reference values for non-dimensionalization. For dynamic meshes, use the motion Mach number as a reference value for computing the force coefficients. Otherwise, use the freestream values, @@ -1812,7 +1812,7 @@ void CFVMFlowSolverBase::Pressure_Forces(const CGeometry* geometr } } - if (FlowRegime == INCOMPRESSIBLE) { + if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) { /*--- Evaluate reference values for non-dimensionalization. For dimensional or non-dim based on initial values, use the far-field state (inf). For a custom non-dim based @@ -2514,9 +2514,9 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr /// TODO: Move the temperature index logic to a function. - if (FlowRegime == COMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, 0, iDim); + if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, 0, iDim); - if (FlowRegime == INCOMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, nDim + 1, iDim); + if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, nDim + 1, iDim); } Viscosity = nodes->GetLaminarViscosity(iPoint); @@ -2579,13 +2579,13 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr GradTemperature = 0.0; - if (FlowRegime == COMPRESSIBLE) { + if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) { for (iDim = 0; iDim < nDim; iDim++) GradTemperature -= Grad_Temp[iDim] * UnitNormal[iDim]; Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; thermal_conductivity = Cp * Viscosity / Prandtl_Lam; } - if (FlowRegime == INCOMPRESSIBLE) { + if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) { if (energy) for (iDim = 0; iDim < nDim; iDim++) GradTemperature -= Grad_Temp[iDim] * UnitNormal[iDim]; diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 1f3e74cd08c..aa925f387d1 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -36,7 +36,7 @@ * \ingroup Euler_Equations * \author F. Palacios, T. Economon, T. Albring */ -class CIncEulerSolver : public CFVMFlowSolverBase { +class CIncEulerSolver : public CFVMFlowSolverBase { protected: vector FluidModel; /*!< \brief fluid model used in the solver. */ StreamwisePeriodicValues SPvals; @@ -123,7 +123,7 @@ class CIncEulerSolver : public CFVMFlowSolverBase() {} + CIncEulerSolver() : CFVMFlowSolverBase() {} /*! * \overload diff --git a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp index 8db3db1f20b..9f977e61165 100644 --- a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp @@ -38,7 +38,7 @@ * \author S. R. Copeland, F. Palacios, W. Maier. * \version 7.1.1 "Blackbird" */ -class CNEMOEulerSolver : public CFVMFlowSolverBase { +class CNEMOEulerSolver : public CFVMFlowSolverBase { protected: su2double @@ -90,7 +90,7 @@ class CNEMOEulerSolver : public CFVMFlowSolverBase() {} + CNEMOEulerSolver() : CFVMFlowSolverBase() {} /*! * \overload diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index d9dfbbdc12f..00b5544dc4d 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) { file the number of zones and dimensions from the numerical grid (required for variables allocation). ---*/ - const CConfig config(config_file_name, SU2_CFD); + const CConfig config(config_file_name, SU2_COMPONENT::SU2_CFD); const unsigned short nZone = config.GetnZone(); const bool turbo = config.GetBoolTurbomachinery(); @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) { const bool disc_adj = config.GetDiscrete_Adjoint(); const bool multizone = config.GetMultizone_Problem(); - const bool harmonic_balance = (config.GetTime_Marching() == HARMONIC_BALANCE); + const bool harmonic_balance = (config.GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); if (dry_run) { diff --git a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp index 605378c96ae..896d7622acd 100644 --- a/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjMultizoneDriver.cpp @@ -827,7 +827,7 @@ void CDiscAdjMultizoneDriver::SetObjFunction(unsigned short kind_recording) { void CDiscAdjMultizoneDriver::SetAdj_ObjFunction() { - bool time_stepping = config_container[ZONE_0]->GetTime_Marching() != STEADY; + bool time_stepping = config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::STEADY; unsigned long IterAvg_Obj = config_container[ZONE_0]->GetIter_Avg_Objective(); su2double seeding = 1.0; diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 208ce710e8c..c82eadce2d5 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -59,7 +59,7 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, /*--- Determine if the problem is a turbomachinery problem ---*/ bool turbo = config->GetBoolTurbomachinery(); - bool compressible = config->GetKind_Regime() == COMPRESSIBLE; + bool compressible = config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE; /*--- Determine if the problem has a mesh deformation solver ---*/ bool mesh_def = config->GetDeform_Mesh(); @@ -313,7 +313,7 @@ void CDiscAdjSinglezoneDriver::SetRecording(unsigned short kind_recording){ void CDiscAdjSinglezoneDriver::SetAdj_ObjFunction(){ - bool time_stepping = config->GetTime_Marching() != STEADY; + bool time_stepping = config->GetTime_Marching() != TIME_MARCHING::STEADY; unsigned long IterAvg_Obj = config->GetIter_Avg_Objective(); su2double seeding = 1.0; diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 214f83c5b64..79ea2712c3f 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -594,7 +594,7 @@ void CDriver::Input_Preprocessing(CConfig **&config, CConfig *&driver_config) { /*--- Initialize the configuration of the driver ---*/ - driver_config = new CConfig(config_file_name, SU2_CFD, false); + driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_CFD, false); for (iZone = 0; iZone < nZone; iZone++) { @@ -608,10 +608,10 @@ void CDriver::Input_Preprocessing(CConfig **&config, CConfig *&driver_config) { if (driver_config->GetnConfigFiles() > 0){ strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); - config[iZone] = new CConfig(driver_config, zone_file_name, SU2_CFD, iZone, nZone, true); + config[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_CFD, iZone, nZone, true); } else{ - config[iZone] = new CConfig(driver_config, config_file_name, SU2_CFD, iZone, nZone, true); + config[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_CFD, iZone, nZone, true); } /*--- Set the MPI communicator ---*/ @@ -702,7 +702,7 @@ void CDriver::Geometrical_Preprocessing(CConfig* config, CGeometry **&geometry, } /*--- For Streamwise Periodic flow, find a unique reference node on the dedicated inlet marker. ---*/ - if (config->GetKind_Streamwise_Periodic() != NONE) + if (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE) geometry[iMesh]->FindUniqueNode_PeriodicBound(config); /*--- Initialize the communication framework for the periodic BCs. ---*/ @@ -901,7 +901,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->GetTime_Marching() && config->GetGrid_Movement()) { + if ((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetGrid_Movement()) { for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { /*--- Update cell volume ---*/ @@ -1088,14 +1088,14 @@ void CDriver::Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, /*--- Adjust iteration number for unsteady restarts. ---*/ - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_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->GetTime_Marching() == DT_STEPPING_1ST) + else if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; else val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } @@ -1221,15 +1221,15 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, /*--- Adjust iteration number for unsteady restarts. ---*/ - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING; bool adjoint = (config->GetDiscrete_Adjoint() || config->GetContinuous_Adjoint()); 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->GetTime_Marching() == DT_STEPPING_1ST) + else if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-1; else val_iter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } @@ -1843,10 +1843,10 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol else numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceBodyForce(nDim, nVar_Flow, config); } - else if (incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) { + else if (incompressible && (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE)) { numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceIncStreamwise_Periodic(nDim, nVar_Flow, config); } - else if (incompressible && (config->GetKind_DensityModel() == BOUSSINESQ)) { + else if (incompressible && (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ)) { numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceBoussinesq(nDim, nVar_Flow, config); } else if (config->GetRotating_Frame() == YES) { @@ -1876,7 +1876,7 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol /*--- At the moment it is necessary to have the RHT equation in order to have a volumetric heat source. ---*/ if (config->AddRadiation()) numerics[iMGlevel][FLOW_SOL][source_second_term] = new CSourceRadiation(nDim, nVar_Flow, config); - else if ((incompressible && (config->GetKind_Streamwise_Periodic() != NONE)) && + else if ((incompressible && (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE)) && (config->GetEnergy_Equation() && !config->GetStreamwise_Periodic_Temperature())) numerics[iMGlevel][FLOW_SOL][source_second_term] = new CSourceIncStreamwisePeriodic_Outlet(nDim, nVar_Flow, config); else @@ -2511,7 +2511,7 @@ void CDriver::DynamicMesh_Preprocessing(CConfig *config, CGeometry **geometry, C surface_movement = new CSurfaceMovement(); surface_movement->CopyBoundary(geometry[MESH_0], config); - if (config->GetTime_Marching() == HARMONIC_BALANCE){ + if (config->GetTime_Marching() == TIME_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); } @@ -2618,7 +2618,7 @@ void CDriver::Interface_Preprocessing(CConfig **config, CSolver***** solver, CGe const auto fluidZone = heat_target? donor : target; - if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == COMPRESSIBLE)) + if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE)) interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF; else if (config[fluidZone]->GetWeakly_Coupled_Heat()) interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF; @@ -2997,7 +2997,7 @@ void CFluidDriver::Preprocess(unsigned long Iter) { for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetInnerIter(Iter); - if (config_container[iZone]->GetTime_Marching()) + if (config_container[iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) config_container[iZone]->SetPhysicalTime(static_cast(Iter)*config_container[iZone]->GetDelta_UnstTimeND()); else config_container[iZone]->SetPhysicalTime(0.0); @@ -3037,7 +3037,8 @@ 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]->GetTime_Marching() == DT_STEPPING_1ST) || (config_container[MESH_0]->GetTime_Marching() == DT_STEPPING_2ND); + unsteady = (config_container[MESH_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config_container[MESH_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); /*--- Zone preprocessing ---*/ @@ -3120,7 +3121,7 @@ void CFluidDriver::DynamicMeshUpdate(unsigned long TimeIter) { bool harmonic_balance; for (iZone = 0; iZone < nZone; iZone++) { - harmonic_balance = (config_container[iZone]->GetTime_Marching() == HARMONIC_BALANCE); + harmonic_balance = (config_container[iZone]->GetTime_Marching() == TIME_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, TimeIter ); diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 32090de8d49..5272644c71b 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -190,9 +190,8 @@ void CMultizoneDriver::StartSolver() { /*--- Run a block iteration of the multizone problem. ---*/ switch (driver_config->GetKind_MZSolver()){ - case MZ_BLOCK_GAUSS_SEIDEL: Run_GaussSeidel(); break; // Block Gauss-Seidel iteration - case MZ_BLOCK_JACOBI: Run_Jacobi(); break; // Block-Jacobi iteration - default: Run_GaussSeidel(); break; + case ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL: Run_GaussSeidel(); break; // Block Gauss-Seidel iteration + case ENUM_MULTIZONE::MZ_BLOCK_JACOBI: Run_Jacobi(); break; // Block-Jacobi iteration } /*--- Update the solution for dual time stepping strategy ---*/ @@ -510,7 +509,7 @@ void CMultizoneDriver::DynamicMeshUpdate(unsigned long TimeIter) { bool AnyDeformMesh = false; for (iZone = 0; iZone < nZone; iZone++) { - const auto harmonic_balance = (config_container[iZone]->GetTime_Marching() == HARMONIC_BALANCE); + const auto harmonic_balance = (config_container[iZone]->GetTime_Marching() == TIME_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], diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index bc3803328d3..b63df7f2abc 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -119,7 +119,7 @@ void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { this can be used for verification / MMS. This should also be more general once the drivers are more stable. ---*/ - if (config_container[ZONE_0]->GetTime_Marching()) + if (config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::STEADY) config_container[ZONE_0]->SetPhysicalTime(static_cast(TimeIter)*config_container[ZONE_0]->GetDelta_UnstTimeND()); else config_container[ZONE_0]->SetPhysicalTime(0.0); diff --git a/SU2_CFD/src/integration/CFEM_DG_Integration.cpp b/SU2_CFD/src/integration/CFEM_DG_Integration.cpp index 5b43cd82bfb..04aa4730805 100644 --- a/SU2_CFD/src/integration/CFEM_DG_Integration.cpp +++ b/SU2_CFD/src/integration/CFEM_DG_Integration.cpp @@ -73,7 +73,7 @@ void CFEM_DG_Integration::SingleGrid_Iteration(CGeometry ****geometry, algorithm below. ---*/ bool TimeSyncSpecified = false; const su2double TimeSync = config[iZone]->GetTime_Step()/config[iZone]->GetTime_Ref(); - if(config[iZone]->GetTime_Marching() == TIME_STEPPING && + if(config[iZone]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING && config[iZone]->GetUnst_CFL() != 0.0 && TimeSync != 0.0) TimeSyncSpecified = true; diff --git a/SU2_CFD/src/integration/CIntegration.cpp b/SU2_CFD/src/integration/CIntegration.cpp index 146c453988f..effec0dd9e1 100644 --- a/SU2_CFD/src/integration/CIntegration.cpp +++ b/SU2_CFD/src/integration/CIntegration.cpp @@ -46,8 +46,8 @@ void CIntegration::Space_Integration(CGeometry *geometry, unsigned short iMarker, KindBC; unsigned short MainSolver = config->GetContainerPosition(RunTime_EqSystem); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); /*--- Compute inviscid residuals ---*/ @@ -157,7 +157,7 @@ void CIntegration::Space_Integration(CGeometry *geometry, solver_container[MainSolver]->BC_Custom(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); break; case CHT_WALL_INTERFACE: - if ((MainSolver == HEAT_SOL) || ((MainSolver == FLOW_SOL) && ((config->GetKind_Regime() == COMPRESSIBLE) || config->GetEnergy_Equation()))) { + if ((MainSolver == HEAT_SOL) || ((MainSolver == FLOW_SOL) && ((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) || config->GetEnergy_Equation()))) { solver_container[MainSolver]->BC_ConjugateHeat_Interface(geometry, solver_container, conv_bound_numerics, config, iMarker); } else { diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 7668c809d1d..dfdaf3e0689 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -48,8 +48,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet /*--- Check whether the current zone is a solid zone or a fluid zone ---*/ - const bool compressible_flow = (donor_config->GetKind_Regime() == COMPRESSIBLE); - const bool incompressible_flow = (donor_config->GetKind_Regime() == INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); + const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); + const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); const bool heat_equation = (donor_config->GetKind_Solver() == HEAT_EQUATION) || (donor_config->GetKind_Solver() == DISC_ADJ_HEAT); @@ -112,8 +112,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet thermal_conductivityND = Cp*(laminar_viscosity/Prandtl_Lam); heat_flux_density = thermal_conductivityND*dTdn; - if ((donor_config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || - (donor_config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || + (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { thermal_conductivity = thermal_conductivityND*donor_config->GetViscosity_Ref(); conductivity_over_dist = thermal_conductivity/dist; @@ -126,8 +126,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet thermal_conductivityND = donor_solution->GetNodes()->GetThermalConductivity(iPoint); heat_flux_density = thermal_conductivityND*dTdn; - if ((donor_config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || - (donor_config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || + (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { switch (donor_config->GetKind_ConductivityModel()) { @@ -151,8 +151,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet thermal_diffusivity = donor_config->GetThermalDiffusivity_Solid(); heat_flux_density = thermal_diffusivity*dTdn; - if ((donor_config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || - (donor_config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || + (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { rho_cp_solid = donor_config->GetSpecific_Heat_Cp()*donor_config->GetDensity_Solid(); conductivity_over_dist = thermal_diffusivity*rho_cp_solid/dist; @@ -166,8 +166,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet /*--- We only need these for the Robin BC option ---*/ - if ((donor_config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || - (donor_config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || + (donor_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { Donor_Variable[2] = conductivity_over_dist; Donor_Variable[3] = Tnormal*donor_config->GetTemperature_Ref(); @@ -184,8 +184,8 @@ void CConjugateHeatInterface::SetTarget_Variable(CSolver *target_solution, CGeom target_solution->SetConjugateHeatVariable(Marker_Target, Vertex_Target, 1, target_config->GetRelaxation_Factor_CHT(), Target_Variable[1]); - if ((target_config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || - (target_config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((target_config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || + (target_config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { target_solution->SetConjugateHeatVariable(Marker_Target, Vertex_Target, 2, target_config->GetRelaxation_Factor_CHT(), Target_Variable[2]); diff --git a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp index ee58f555b77..37c2a8779c7 100644 --- a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp @@ -33,16 +33,16 @@ void CAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integratio CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { unsigned short iMesh; - bool harmonic_balance = (config[ZONE_0]->GetTime_Marching() == HARMONIC_BALANCE); + bool harmonic_balance = (config[ZONE_0]->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); bool dynamic_mesh = config[ZONE_0]->GetGrid_Movement(); 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 && TimeIter == 0) || config[val_iZone]->GetTime_Marching()) && !harmonic_balance) { + if (((dynamic_mesh && TimeIter == 0) || (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY)) && !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()) + if (rank == MASTER_NODE && val_iZone == ZONE_0 && (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY)) 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); @@ -50,7 +50,7 @@ void CAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integratio /*--- Continuous adjoint Euler, Navier-Stokes or Reynolds-averaged Navier-Stokes (RANS) equations ---*/ - if ((InnerIter == 0) || config[val_iZone]->GetTime_Marching()) { + if ((InnerIter == 0) || (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY)) { if (config[val_iZone]->GetKind_Solver() == ADJ_EULER) config[val_iZone]->SetGlobalParam(ADJ_EULER, RUNTIME_FLOW_SYS); if (config[val_iZone]->GetKind_Solver() == ADJ_NAVIER_STOKES) @@ -173,8 +173,8 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { /*--- Update dual time solver ---*/ for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index dbf2a950dfb..54c76c6e473 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -35,8 +35,8 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr StartTime = SU2_MPI::Wtime(); const auto TimeIter = config[iZone]->GetTimeIter(); - const bool dual_time_1st = (config[iZone]->GetTime_Marching() == DT_STEPPING_1ST); - const bool dual_time_2nd = (config[iZone]->GetTime_Marching() == DT_STEPPING_2ND); + const bool dual_time_1st = (config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); + const bool dual_time_2nd = (config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool dual_time = (dual_time_1st || dual_time_2nd); const bool grid_IsMoving = config[iZone]->GetGrid_Movement(); const bool heat = config[iZone]->GetWeakly_Coupled_Heat(); @@ -56,7 +56,7 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr /*--- For the unsteady adjoint, load direct solutions from restart files. ---*/ - if (config[iZone]->GetTime_Marching()) { + if (config[iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) { const int Direct_Iter = SU2_TYPE::Int(config[iZone]->GetUnst_AdjointIter()) - SU2_TYPE::Int(TimeIter) - 2 + dual_time; /*--- For dual-time stepping we want to load the already converged solution at timestep n ---*/ @@ -569,8 +569,8 @@ void CDiscAdjFluidIteration::Update(COutput* output, CIntegration**** integratio CFreeFormDefBox*** FFDBox, unsigned short iZone, unsigned short iInst) { /*--- Dual time stepping strategy ---*/ - if ((config[iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { + if ((config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { for (unsigned short iMesh = 0; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { integration[iZone][iInst][ADJFLOW_SOL]->SetConvergence(false); } diff --git a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp index 5d278eb97f9..04e16d4a35f 100644 --- a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp @@ -34,15 +34,15 @@ void CDiscAdjHeatIteration::Preprocess(COutput* output, CIntegration**** integra CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { 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_1st = (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); + bool dual_time_2nd = (config[val_iZone]->GetTime_Marching() == TIME_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]->GetTime_Marching()) { + if (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) { 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 ---*/ @@ -239,8 +239,8 @@ void CDiscAdjHeatIteration::Update(COutput* output, CIntegration**** integration /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { integration[val_iZone][val_iInst][ADJHEAT_SOL]->SetConvergence(false); } diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index 478235d9973..bc0bf5fb5fd 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -58,8 +58,8 @@ void CFluidIteration::Iterate(COutput* output, CIntegration**** integration, CGe CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { unsigned long InnerIter, TimeIter; - const bool unsteady = (config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND); + const bool unsteady = (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const 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()); const bool disc_adj = (config[val_iZone]->GetDiscrete_Adjoint()); @@ -167,8 +167,8 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { /*--- Update dual time solver on all mesh levels ---*/ for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { diff --git a/SU2_CFD/src/iteration/CHeatIteration.cpp b/SU2_CFD/src/iteration/CHeatIteration.cpp index 20c5864883d..0d58a423e11 100644 --- a/SU2_CFD/src/iteration/CHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CHeatIteration.cpp @@ -48,8 +48,8 @@ void CHeatIteration::Update(COutput* output, CIntegration**** integration, CGeom /*--- Dual time stepping strategy ---*/ - if ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)) { + if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { /*--- Update dual time solver ---*/ for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index cf7574d60d1..55cf6bc5547 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -31,7 +31,7 @@ CCentLaxInc_Flow::CCentLaxInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetKind_DensityModel() == VARIABLE); + variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); /* 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(); fix_factor = config->GetCent_Inc_Jac_Fix_Factor(); @@ -251,7 +251,7 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi CCentJSTInc_Flow::CCentJSTInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetKind_DensityModel() == VARIABLE); + variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); energy = config->GetEnergy_Equation(); /* 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(); diff --git a/SU2_CFD/src/numerics/flow/convection/fds.cpp b/SU2_CFD/src/numerics/flow/convection/fds.cpp index 150d6d1f443..de880d801b0 100644 --- a/SU2_CFD/src/numerics/flow/convection/fds.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fds.cpp @@ -31,7 +31,7 @@ CUpwFDSInc_Flow::CUpwFDSInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetKind_DensityModel() == VARIABLE); + variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); energy = config->GetEnergy_Equation(); /* 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(); diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index e1c5ce79e4c..b7e583757d4 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -405,7 +405,7 @@ CNumerics::ResidualType<> CSourceIncBodyForce::ComputeResidual(const CConfig* co unsigned short iDim; su2double DensityInc_0 = 0.0; su2double Force_Ref = config->GetForce_Ref(); - bool variable_density = (config->GetKind_DensityModel() == VARIABLE); + bool variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); /*--- Check for variable density. If we have a variable density problem, we should subtract out the hydrostatic pressure component. ---*/ diff --git a/SU2_CFD/src/numerics/radiation.cpp b/SU2_CFD/src/numerics/radiation.cpp index ee510108cb0..1a1d098a82d 100644 --- a/SU2_CFD/src/numerics/radiation.cpp +++ b/SU2_CFD/src/numerics/radiation.cpp @@ -34,7 +34,7 @@ CNumericsRadiation::CNumericsRadiation(unsigned short val_nDim, : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Radiation() == EULER_IMPLICIT); - incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); Absorption_Coeff = config->GetAbsorption_Coeff(); Scattering_Coeff = config->GetScattering_Coeff(); diff --git a/SU2_CFD/src/numerics/transition.cpp b/SU2_CFD/src/numerics/transition.cpp index da72a02ffb5..52f231a4d99 100644 --- a/SU2_CFD/src/numerics/transition.cpp +++ b/SU2_CFD/src/numerics/transition.cpp @@ -30,7 +30,7 @@ CUpwLin_TransLM::CUpwLin_TransLM(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Turb() == EULER_IMPLICIT); - incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); Gamma = config->GetGamma(); Gamma_Minus_One = Gamma - 1.0; @@ -121,7 +121,7 @@ CAvgGrad_TransLM::CAvgGrad_TransLM(unsigned short val_nDim, unsigned short val_n unsigned short iVar; implicit = (config->GetKind_TimeIntScheme_Turb() == EULER_IMPLICIT); - incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); Gamma = config->GetGamma(); Gamma_Minus_One = Gamma - 1.0; @@ -234,7 +234,7 @@ CAvgGradCorrected_TransLM::CAvgGradCorrected_TransLM(unsigned short val_nDim, un unsigned short iVar; implicit = (config->GetKind_TimeIntScheme_Turb() == EULER_IMPLICIT); - incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); Gamma = config->GetGamma(); Gamma_Minus_One = Gamma - 1.0; diff --git a/SU2_CFD/src/numerics/turbulent/turb_convection.cpp b/SU2_CFD/src/numerics/turbulent/turb_convection.cpp index ba2fb7a7473..a2cb1f2abb9 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_convection.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_convection.cpp @@ -33,7 +33,7 @@ CUpwScalar::CUpwScalar(unsigned short val_nDim, const CConfig* config) : CNumerics(val_nDim, val_nVar, config), implicit(config->GetKind_TimeIntScheme_Turb() == EULER_IMPLICIT), - incompressible(config->GetKind_Regime() == INCOMPRESSIBLE), + incompressible(config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE), dynamic_grid(config->GetDynamic_Grid()) { Flux = new su2double [nVar]; diff --git a/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp b/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp index ce55ffafb37..98cd23203ce 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_diffusion.cpp @@ -35,7 +35,7 @@ CAvgGrad_Scalar::CAvgGrad_Scalar(unsigned short val_nDim, CNumerics(val_nDim, val_nVar, config), correct_gradient(correct_grad), implicit(config->GetKind_TimeIntScheme_Turb() == EULER_IMPLICIT), - incompressible(config->GetKind_Regime() == INCOMPRESSIBLE) + incompressible(config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) { Proj_Mean_GradTurbVar_Normal = new su2double [nVar] (); Proj_Mean_GradTurbVar_Edge = new su2double [nVar] (); diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 73342a9d161..b1bf1d7cffc 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -32,7 +32,7 @@ CSourceBase_TurbSA::CSourceBase_TurbSA(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config), - incompressible(config->GetKind_Regime() == INCOMPRESSIBLE), + incompressible(config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE), rotating_frame(config->GetRotating_Frame()) { /*--- Spalart-Allmaras closure constants ---*/ @@ -758,7 +758,7 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { - incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); sustaining_terms = (config->GetKind_Turb_Model() == SST_SUST); axisymmetric = config->GetAxisymmetric(); diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index eb52352ee25..9d501475b50 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -462,8 +462,8 @@ void CAdjFlowCompOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, C bool CAdjFlowCompOutput::SetInit_Residuals(CConfig *config){ - return ((config->GetTime_Marching() != STEADY) && (curInnerIter == 0)) || - ((config->GetTime_Marching() == STEADY) && (curInnerIter < 2)); + return ((config->GetTime_Marching() != TIME_MARCHING::STEADY) && (curInnerIter == 0)) || + ((config->GetTime_Marching() == TIME_MARCHING::STEADY) && (curInnerIter < 2)); } diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index e62f918e132..fb251791792 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -526,8 +526,8 @@ void CAdjFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CS bool CAdjFlowIncOutput::SetInit_Residuals(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| - (config->GetTime_Marching() == STEADY && (curTimeIter < 2)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curTimeIter < 2)); } diff --git a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp index 39a5cd19933..9490aad19e4 100644 --- a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp @@ -274,8 +274,8 @@ void CFlowCompFEMOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C bool CFlowCompFEMOutput::SetInit_Residuals(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| - (config->GetTime_Marching() == STEADY && (curTimeIter < 2)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curTimeIter < 2)); } diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 263269570ce..18c26c4f723 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -719,14 +719,14 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol bool CFlowCompOutput::SetInit_Residuals(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| - (config->GetTime_Marching() == STEADY && (curInnerIter < 2)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curInnerIter < 2)); } bool CFlowCompOutput::SetUpdate_Averages(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index fa098a26c0e..a5d7188f5d1 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -39,7 +39,7 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); - streamwisePeriodic = config->GetKind_Streamwise_Periodic(); + streamwisePeriodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); streamwisePeriodic_temperature = config->GetStreamwise_Periodic_Temperature(); /*--- Set the default history fields if nothing is set in the config file ---*/ @@ -697,13 +697,13 @@ void CFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolv bool CFlowIncOutput::SetInit_Residuals(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| - (config->GetTime_Marching() == STEADY && (curInnerIter < 2)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curInnerIter < 2)); } bool CFlowIncOutput::SetUpdate_Averages(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); } diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 50ea4cbf567..d14458ea378 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -123,10 +123,10 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi const unsigned short nDim = geometry->GetnDim(); const unsigned short Kind_Average = config->GetKind_Average(); - const bool compressible = config->GetKind_Regime() == COMPRESSIBLE; - const bool incompressible = config->GetKind_Regime() == INCOMPRESSIBLE; + const bool compressible = config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE; + const bool incompressible = config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE; const bool energy = config->GetEnergy_Equation(); - const bool streamwisePeriodic = config->GetKind_Streamwise_Periodic(); + const bool streamwisePeriodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool axisymmetric = config->GetAxisymmetric(); const unsigned short nMarker_Analyze = config->GetnMarker_Analyze(); @@ -218,7 +218,7 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi } if (incompressible){ - if (config->GetKind_DensityModel() == VARIABLE) { + if (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE) { Mach = sqrt(solver->GetNodes()->GetVelocity2(iPoint))/ sqrt(solver->GetNodes()->GetSpecificHeatCp(iPoint)*config->GetPressure_ThermodynamicND()/(solver->GetNodes()->GetSpecificHeatCv(iPoint)*solver->GetNodes()->GetDensity(iPoint))); } else { @@ -877,7 +877,7 @@ void CFlowOutput::WriteMetaData(CConfig *config){ 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) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) meta_file <<"ITER= " << curTimeIter + 1 << endl; else meta_file <<"ITER= " << curInnerIter + config->GetExtIter_OffSet() + 1 << endl; @@ -909,8 +909,8 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo unsigned short iMarker_Monitoring; - const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); - const bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + const bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); + const bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); const bool unsteady = config->GetTime_Domain(); const bool viscous = config->GetViscous(); const bool dynamic_grid = config->GetDynamic_Grid(); @@ -1653,7 +1653,7 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo /*--- Incompressible version of the console output ---*/ bool energy = config->GetEnergy_Equation(); - bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); + bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); if (config->GetRef_Inc_NonDim() == DIMENSIONAL) { Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, temp_ref, p_ref" << "\n"; @@ -1698,16 +1698,16 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo switch (config->GetKind_DensityModel()) { - case CONSTANT: + case INC_DENSITYMODEL::CONSTANT: if (energy) Breakdown_file << "Energy equation is active and decoupled." << "\n"; else Breakdown_file << "No energy equation." << "\n"; break; - case BOUSSINESQ: + case INC_DENSITYMODEL::BOUSSINESQ: if (energy) Breakdown_file << "Energy equation is active and coupled through Boussinesq approx." << "\n"; break; - case VARIABLE: + case INC_DENSITYMODEL::VARIABLE: if (energy) Breakdown_file << "Energy equation is active and coupled for variable density." << "\n"; break; @@ -2709,12 +2709,12 @@ void CFlowOutput::WriteForcesBreakdown(CConfig *config, CGeometry *geometry, CSo bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool force_writing){ if (config->GetTime_Domain()){ - if (((config->GetTime_Marching() == DT_STEPPING_1ST) || (config->GetTime_Marching() == TIME_STEPPING)) && + if (((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING)) && ((Iter == 0) || (Iter % config->GetVolume_Wrt_Freq() == 0))){ return true; } - if ((config->GetTime_Marching() == DT_STEPPING_2ND) && + if ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) && ((Iter == 0) || (Iter % config->GetVolume_Wrt_Freq() == 0) || ((Iter+1) % config->GetVolume_Wrt_Freq() == 0) || // Restarts need 2 old solution. diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 11f9b6be62a..754ce7e8f71 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -691,14 +691,14 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol bool CNEMOCompOutput::SetInit_Residuals(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == 0))|| - (config->GetTime_Marching() == STEADY && (curInnerIter < 2)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| + (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curInnerIter < 2)); } bool CNEMOCompOutput::SetUpdate_Averages(CConfig *config){ - return (config->GetTime_Marching() != STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); + return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == config->GetnInner_Iter() - 1 || convergence)); } diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index a1c7ededaa1..191c4f283d5 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -347,7 +347,7 @@ void COutputLegacy::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *conf bool rotating_frame = config->GetRotating_Frame(); bool aeroelastic = config->GetAeroelastic_Simulation(); bool equiv_area = config->GetEquivArea(); - bool buffet = (config->GetViscous() || config->GetKind_Regime() == COMPRESSIBLE); + bool buffet = (config->GetViscous() || config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); bool engine = ((config->GetnMarker_EngineInflow() != 0) || (config->GetnMarker_EngineExhaust() != 0)); bool actuator_disk = ((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)); bool turbulent = ((config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == ADJ_RANS) || @@ -364,8 +364,8 @@ void COutputLegacy::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *conf bool turbo = config->GetBoolTurbomachinery(); unsigned short direct_diff = config->GetDirectDiff(); - bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); - bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); + bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); bool incload = config->GetIncrementalLoad(); bool thermal = false; /* Flag for whether to print heat flux values */ @@ -615,8 +615,8 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, bool radiation = config[val_iZone]->AddRadiation(); - bool compressible = (config[val_iZone]->GetKind_Regime() == COMPRESSIBLE); - bool incompressible = (config[val_iZone]->GetKind_Regime() == INCOMPRESSIBLE); + bool compressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); + bool incompressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); if (!disc_adj && !cont_adj && !DualTime_Iteration) { @@ -677,7 +677,7 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, /*--- Output a file with the forces breakdown. ---*/ - if (config[val_iZone]->GetTime_Marching() == HARMONIC_BALANCE) { + if (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { SpecialOutput_HarmonicBalance(solver_container, geometry, config, val_iInst, nInst, output_files); } @@ -714,8 +714,8 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, } unsigned long ExtIter_OffSet = config[val_iZone]->GetExtIter_OffSet(); - if (config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST || - config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND) + if (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || + config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) ExtIter_OffSet = 0; /*--- WARNING: These buffers have hard-coded lengths. Note that you @@ -761,7 +761,7 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, (config[val_iZone]->GetKind_Solver() == ADJ_NAVIER_STOKES) || (config[val_iZone]->GetKind_Solver() == ADJ_RANS) || (config[val_iZone]->GetKind_Solver() == INC_EULER) || (config[val_iZone]->GetKind_Solver() == INC_NAVIER_STOKES) || (config[val_iZone]->GetKind_Solver() == INC_RANS); - bool buffet = (config[val_iZone]->GetViscous() || config[val_iZone]->GetKind_Regime() == COMPRESSIBLE); + bool buffet = (config[val_iZone]->GetViscous() || config[val_iZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); bool fem = ((config[val_iZone]->GetKind_Solver() == FEM_ELASTICITY) || // FEM structural solver. (config[val_iZone]->GetKind_Solver() == DISC_ADJ_FEM)); @@ -1248,8 +1248,8 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, /*--- Header frequency ---*/ - bool Unsteady = ((config[val_iZone]->GetTime_Marching() == DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == DT_STEPPING_2ND)); + bool Unsteady = ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); bool In_NoDualTime = (!DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); bool In_DualTime_0 = (DualTime_Iteration && (iIntIter % config[val_iZone]->GetScreen_Wrt_Freq(0) == 0)); bool In_DualTime_1 = (!DualTime_Iteration && Unsteady); @@ -1563,7 +1563,7 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, ) { if (!fem) { - if (!Unsteady && (config[val_iZone]->GetTime_Marching() != TIME_STEPPING)) { + if (!Unsteady && (config[val_iZone]->GetTime_Marching() != TIME_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: @@ -1649,10 +1649,10 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, } else { if (flow) { - if ((config[val_iZone]->GetTime_Marching() == TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()== 0.0)) + if ((config[val_iZone]->GetTime_Marching() == TIME_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]->GetTime_Marching() == TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()!= 0.0)) { + } else if ((config[val_iZone]->GetTime_Marching() == TIME_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() << "."; @@ -2430,9 +2430,9 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry unsigned short iDim, iMarker_Monitoring; ofstream Breakdown_file; - bool compressible = (config[val_iZone]->GetKind_Regime() == COMPRESSIBLE); - bool incompressible = (config[val_iZone]->GetKind_Regime() == INCOMPRESSIBLE); - bool unsteady = (config[val_iZone]->GetTime_Marching() != NO); + bool compressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); + bool incompressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); + bool unsteady = (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY); bool viscous = config[val_iZone]->GetViscous(); bool dynamic_grid = config[val_iZone]->GetDynamic_Grid(); bool gravity = config[val_iZone]->GetGravityForce(); @@ -3185,7 +3185,7 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry /*--- Incompressible version of the console output ---*/ bool energy = config[val_iZone]->GetEnergy_Equation(); - bool boussinesq = (config[val_iZone]->GetKind_DensityModel() == BOUSSINESQ); + bool boussinesq = (config[val_iZone]->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); if (config[val_iZone]->GetRef_Inc_NonDim() == DIMENSIONAL) { Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, temp_ref, p_ref" << "\n"; @@ -3230,16 +3230,16 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry switch (config[val_iZone]->GetKind_DensityModel()) { - case CONSTANT: + case INC_DENSITYMODEL::CONSTANT: if (energy) Breakdown_file << "Energy equation is active and decoupled." << "\n"; else Breakdown_file << "No energy equation." << "\n"; break; - case BOUSSINESQ: + case INC_DENSITYMODEL::BOUSSINESQ: if (energy) Breakdown_file << "Energy equation is active and coupled through Boussinesq approx." << "\n"; break; - case VARIABLE: + case INC_DENSITYMODEL::VARIABLE: if (energy) Breakdown_file << "Energy equation is active and coupled for variable density." << "\n"; break; @@ -4732,8 +4732,8 @@ void COutputLegacy::SetCp_InverseDesign(CSolver *solver_container, CGeometry *ge /*--- Write file name with extension if unsteady or steady ---*/ - if ((config->GetTime_Marching() && config->GetTime_Domain()) || - (config->GetTime_Marching() == HARMONIC_BALANCE)) { + if (((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) || + (config->GetTime_Marching() == TIME_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)); @@ -4883,8 +4883,8 @@ void COutputLegacy::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeomet /*--- Write file name with extension if unsteady or steady ---*/ - if ((config->GetTime_Marching() && config->GetTime_Domain()) || - (config->GetTime_Marching() == HARMONIC_BALANCE)) { + if (((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) || + (config->GetTime_Marching() == TIME_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)); @@ -7333,8 +7333,8 @@ void COutputLegacy::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geo 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 compressible = config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE; + bool incompressible = config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE; bool energy = config->GetEnergy_Equation(); @@ -7417,7 +7417,7 @@ void COutputLegacy::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geo } if (incompressible){ - if (config->GetKind_DensityModel() == VARIABLE) { + if (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE) { Mach = sqrt(solver->GetNodes()->GetVelocity2(iPoint))/ sqrt(solver->GetNodes()->GetSpecificHeatCp(iPoint)*config->GetPressure_ThermodynamicND()/(solver->GetNodes()->GetSpecificHeatCv(iPoint)*solver->GetNodes()->GetDensity(iPoint))); } else { diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 62cfc4a23bd..97237e680a7 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -278,7 +278,7 @@ passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned lon unsigned long iPoint; su2double vertexWallTemp(0.0); - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); + bool compressible = (config_container[ZONE_0]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); @@ -309,7 +309,7 @@ vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsig vector HeatFlux (3,0.0); vector HeatFluxPassive (3,0.0); - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); + bool compressible = (config_container[ZONE_0]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); @@ -343,7 +343,7 @@ passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned su2double laminar_viscosity, thermal_conductivity, dTdn; su2double *Normal, GradT[3] = {0.0,0.0,0.0}, UnitNormal[3] = {0.0,0.0,0.0}; - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == COMPRESSIBLE); + bool compressible = (config_container[ZONE_0]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); vertexWallHeatFlux = 0.0; dTdn = 0.0; diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index 3fb85944a24..e7b503dbd1d 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -1494,8 +1494,8 @@ void CAdjEulerSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solve su2double Area_Children, Area_Parent, *Solution, *Solution_Fine; bool restart = config->GetRestart(); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_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 ---*/ @@ -1845,7 +1845,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->GetTime_Marching() == HARMONIC_BALANCE); + bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); /*--- Initialize the source residual to zero ---*/ for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; @@ -3650,7 +3650,7 @@ void CAdjEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, ProjGridVel, *GridVel; su2double *V_inlet, *V_domain, *Normal, *Psi_domain, *Psi_inlet; - unsigned short Kind_Inlet = config->GetKind_Inlet(); + INLET_TYPE Kind_Inlet = config->GetKind_Inlet(); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool grid_movement = config->GetGrid_Movement(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); @@ -3702,7 +3702,7 @@ void CAdjEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, switch (Kind_Inlet) { /*--- Total properties have been specified at the inlet. ---*/ - case TOTAL_CONDITIONS: + case INLET_TYPE::TOTAL_CONDITIONS: /*--- Adjoint solution at the inlet. Set to zero for now but should be replaced with derived expression for this type of @@ -3713,7 +3713,7 @@ void CAdjEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, break; /*--- Mass flow has been specified at the inlet. ---*/ - case MASS_FLOW: + case INLET_TYPE::MASS_FLOW: /*--- Get primitives from current inlet state. ---*/ for (iDim = 0; iDim < nDim; iDim++) @@ -3743,6 +3743,10 @@ void CAdjEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, Psi_inlet[nVar-1] = -phin*(1.0/bcn); break; + + default: + SU2_MPI::Error("Unsupported INLET_TYPE.", CURRENT_FUNCTION); + break; } @@ -4564,9 +4568,9 @@ void CAdjEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver /*--- Compute Residual ---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) Residual[iVar] = ( U_time_nP1[iVar]*Volume_nP1 - U_time_n[iVar]*Volume_n ) / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_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); } @@ -4579,9 +4583,9 @@ void CAdjEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver for (jVar = 0; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; - if (config->GetTime_Marching() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); } Jacobian.AddBlock2Diag(iPoint, Jacobian_i); diff --git a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp index 610d2026043..90dbc69d2d9 100644 --- a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp @@ -165,7 +165,7 @@ void CDiscAdjMeshSolver::SetSensitivity(CGeometry *geometry, CConfig *config, CS SU2_OMP_PARALLEL { - const bool time_stepping = (config->GetTime_Marching() != STEADY); + const bool time_stepping = (config->GetTime_Marching() != TIME_MARCHING::STEADY); const auto eps = config->GetAdjSharp_LimiterCoeff()*config->GetRefElemLength(); /*--- Extract the sensitivities ---*/ diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index 39e0cf2001d..484db636adc 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -109,8 +109,8 @@ CDiscAdjSolver::~CDiscAdjSolver(void) { delete nodes; } void CDiscAdjSolver::SetRecording(CGeometry* geometry, CConfig *config){ - const bool time_n1_needed = config->GetTime_Marching() == DT_STEPPING_2ND; - const bool time_n_needed = (config->GetTime_Marching() == DT_STEPPING_1ST) || time_n1_needed; + const bool time_n1_needed = config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND; + const bool time_n_needed = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || time_n1_needed; unsigned long iPoint; unsigned short iVar; @@ -155,8 +155,8 @@ void CDiscAdjSolver::SetRecording(CGeometry* geometry, CConfig *config){ void CDiscAdjSolver::RegisterSolution(CGeometry *geometry, CConfig *config) { - const bool time_n1_needed = (config->GetTime_Marching() == DT_STEPPING_2ND); - const bool time_n_needed = (config->GetTime_Marching() == DT_STEPPING_1ST) || time_n1_needed; + const bool time_n1_needed = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); + const bool time_n_needed = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || time_n1_needed; const bool input = true; const bool push_index = !config->GetMultizone_Problem(); @@ -177,7 +177,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo /*--- Register farfield values as input ---*/ - if((config->GetKind_Regime() == COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS && !config->GetBoolTurbomachinery())) { + if((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS && !config->GetBoolTurbomachinery())) { su2double Velocity_Ref = config->GetVelocity_Ref(); Alpha = config->GetAoA()*PI_NUMBER/180.0; @@ -217,7 +217,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo } - if ((config->GetKind_Regime() == COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && config->GetBoolTurbomachinery()){ + if ((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && config->GetBoolTurbomachinery()){ BPressure = config->GetPressureOut_BC(); Temperature = config->GetTotalTemperatureIn_BC(); @@ -233,7 +233,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo /*--- Register incompressible initialization values as input ---*/ - if ((config->GetKind_Regime() == INCOMPRESSIBLE) && + if ((config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && ((KindDirect_Solver == RUNTIME_FLOW_SYS && (!config->GetBoolTurbomachinery())))) { @@ -265,7 +265,7 @@ void CDiscAdjSolver::RegisterVariables(CGeometry *geometry, CConfig *config, boo /*--- Register incompressible radiation values as input ---*/ - if ((config->GetKind_Regime() == INCOMPRESSIBLE) && + if ((config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && ((KindDirect_Solver == RUNTIME_RADIATION_SYS && (!config->GetBoolTurbomachinery())))) { @@ -306,8 +306,8 @@ void CDiscAdjSolver::RegisterOutput(CGeometry *geometry, CConfig *config) { void CDiscAdjSolver::ExtractAdjoint_Solution(CGeometry *geometry, CConfig *config){ - const bool time_n1_needed = config->GetTime_Marching() == DT_STEPPING_2ND; - const bool time_n_needed = (config->GetTime_Marching() == DT_STEPPING_1ST) || time_n1_needed; + const bool time_n1_needed = config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND; + const bool time_n_needed = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || time_n1_needed; const bool multizone = config->GetMultizone_Problem(); const su2double relax = (config->GetInnerIter()==0)? 1.0 : config->GetRelaxation_Factor_Adjoint(); @@ -412,7 +412,7 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf /*--- Extract the adjoint values of the farfield values ---*/ - if ((config->GetKind_Regime() == COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && !config->GetBoolTurbomachinery()) { + if ((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && !config->GetBoolTurbomachinery()) { su2double Local_Sens_Press, Local_Sens_Temp, Local_Sens_AoA, Local_Sens_Mach; Local_Sens_Mach = SU2_TYPE::GetDerivative(Mach); @@ -426,7 +426,7 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf SU2_MPI::Allreduce(&Local_Sens_Press, &Total_Sens_Press, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } - if ((config->GetKind_Regime() == COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && config->GetBoolTurbomachinery()){ + if ((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS) && config->GetBoolTurbomachinery()){ su2double Local_Sens_BPress, Local_Sens_Temperature; Local_Sens_BPress = SU2_TYPE::GetDerivative(BPressure); @@ -436,7 +436,7 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf SU2_MPI::Allreduce(&Local_Sens_Temperature, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } - if ((config->GetKind_Regime() == INCOMPRESSIBLE) && + if ((config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && (KindDirect_Solver == RUNTIME_FLOW_SYS && (!config->GetBoolTurbomachinery()))) { @@ -451,7 +451,7 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf SU2_MPI::Allreduce(&Local_Sens_Temp, &Total_Sens_Temp, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); } - if ((config->GetKind_Regime() == INCOMPRESSIBLE) && + if ((config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && (KindDirect_Solver == RUNTIME_RADIATION_SYS && (!config->GetBoolTurbomachinery()))) { @@ -474,8 +474,8 @@ void CDiscAdjSolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *conf void CDiscAdjSolver::SetAdjoint_Output(CGeometry *geometry, CConfig *config) { - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST || - config->GetTime_Marching() == DT_STEPPING_2ND); + const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || + config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); su2double Solution[MAXNVAR] = {0.0}; @@ -503,7 +503,7 @@ void CDiscAdjSolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSolve SU2_OMP_PARALLEL { - const bool time_stepping = (config->GetTime_Marching() != STEADY); + const bool time_stepping = (config->GetTime_Marching() != TIME_MARCHING::STEADY); const su2double eps = config->GetAdjSharp_LimiterCoeff()*config->GetRefElemLength(); SU2_OMP_FOR_STAT(omp_chunk_size) @@ -613,7 +613,8 @@ void CDiscAdjSolver::SetSurface_Sensitivity(CGeometry *geometry, CConfig *config void CDiscAdjSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); if (!dual_time) return; diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index d220d815a4d..5ce39645f80 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -37,7 +37,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh, const bool navier_stokes) : - CFVMFlowSolverBase() { + CFVMFlowSolverBase() { /*--- Based on the navier_stokes boolean, determine if this constructor is * being called by itself, or by its derived class CNSSolver. ---*/ @@ -56,9 +56,9 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, const bool restart = (config->GetRestart() || config->GetRestart_Flow()); const bool rans = (config->GetKind_Turb_Model() != NONE); const auto direct_diff = config->GetDirectDiff(); - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); - const bool time_stepping = (config->GetTime_Marching() == TIME_STEPPING); + const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); + const bool time_stepping = (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING); const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); int Unst_RestartIter = 0; @@ -82,7 +82,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, if (dual_time) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetTime_Marching() == DT_STEPPING_1ST) + else if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } @@ -1088,7 +1088,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->GetTime_Marching() != NO); + bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); bool viscous = config->GetViscous(); bool gravity = config->GetGravityForce(); bool turbulent = (config->GetKind_Turb_Model() != NONE); @@ -2251,7 +2251,7 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain const bool rotating_frame = config->GetRotating_Frame(); const bool axisymmetric = config->GetAxisymmetric(); const bool gravity = (config->GetGravityForce() == YES); - const bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); + const bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); const bool windgust = config->GetWind_Gust(); const bool body_force = config->GetBody_Force(); const bool ideal_gas = (config->GetKind_FluidModel() == STANDARD_AIR) || @@ -2473,7 +2473,7 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /*--- Loop over points ---*/ SU2_OMP_FOR_DYN(omp_chunk_size) @@ -6777,7 +6777,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); su2double Two_Gamma_M1 = 2.0/Gamma_Minus_One; su2double Gas_Constant = config->GetGas_ConstantND(); - unsigned short Kind_Inlet = config->GetKind_Inlet(); + INLET_TYPE Kind_Inlet= config->GetKind_Inlet(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); su2double *Normal = new su2double[nDim]; @@ -6825,7 +6825,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Total properties have been specified at the inlet. ---*/ - case TOTAL_CONDITIONS: + case INLET_TYPE::TOTAL_CONDITIONS: /*--- Retrieve the specified total conditions for this inlet. ---*/ @@ -6932,7 +6932,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Mass flow has been specified at the inlet. ---*/ - case MASS_FLOW: + case INLET_TYPE::MASS_FLOW: /*--- Retrieve the specified mass flow for the inlet. ---*/ @@ -6987,6 +6987,10 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+3] = Energy + Pressure/Density; break; + + default: + SU2_MPI::Error("Unsupported INLET_TYPE.", CURRENT_FUNCTION); + break; } /*--- Set various quantities in the solver class ---*/ diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 79502c49923..5fafa40e324 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -3288,13 +3288,15 @@ void CFEASolver::FilterElementDensities(CGeometry *geometry, const CConfig *conf /*--- Apply a filter to the design densities of the elements to generate the physical densities which are the ones used to penalize their stiffness. ---*/ - unsigned short type, search_lim; + ENUM_PROJECTION_FUNCTION type; + unsigned short search_lim; su2double param, radius; - vector > kernels; + vector > kernels; vector filter_radius; for (unsigned short iKernel=0; iKernelGetTopology_Optim_Num_Kernels(); ++iKernel) { + ENUM_FILTER_KERNEL type; config->GetTopology_Optim_Kernel(iKernel,type,param,radius); kernels.push_back(make_pair(type,param)); filter_radius.push_back(radius); @@ -3321,14 +3323,14 @@ void CFEASolver::FilterElementDensities(CGeometry *geometry, const CConfig *conf { /*--- Apply projection. ---*/ switch (type) { - case NO_PROJECTION: break; - case HEAVISIDE_UP: + case ENUM_PROJECTION_FUNCTION::NONE: break; + case ENUM_PROJECTION_FUNCTION::HEAVISIDE_UP: SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iElem=0ul; iElemGetnDim(); nMarker = config->GetnMarker_All(); - const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); + const bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); if( compressible ) nVar = nDim + 2; else nVar = nDim + 1; @@ -790,7 +790,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->GetTime_Marching() != NO); + bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); bool viscous = config->GetViscous(); bool grid_movement = config->GetGrid_Movement(); bool turbulent = (config->GetKind_Solver() == FEM_RANS) || (config->GetKind_Solver() == FEM_LES); @@ -3138,7 +3138,7 @@ void CFEM_DG_EulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_co /*--- Check for non-physical points. Only needed for a compressible solver. ---*/ /*-----------------------------------------------------------------------------*/ - if(config->GetKind_Regime() == COMPRESSIBLE) { + if(config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { /*--- Make a distinction between 2D and 3D for optimal performance. ---*/ switch( nDim ) { @@ -3210,7 +3210,7 @@ void CFEM_DG_EulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_co /* Check for grid motion. */ /*-----------------------------------------------------------------------------*/ - const bool harmonic_balance = config->GetTime_Marching() == HARMONIC_BALANCE; + const bool harmonic_balance = config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE; if(config->GetGrid_Movement() && !harmonic_balance) { /*--- Determine the type of grid motion. ---*/ @@ -3588,7 +3588,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->GetTime_Marching() == TIME_STEPPING; + const bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING; /* Initialize the minimum and maximum time step. */ Min_Delta_Time = 1.e25; Max_Delta_Time = 0.0; @@ -3612,7 +3612,7 @@ void CFEM_DG_EulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_con } else { /*--- Check for a compressible solver. ---*/ - if(config->GetKind_Regime() == COMPRESSIBLE) { + if(config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { /*--- Loop over the owned volume elements. ---*/ for(unsigned long l=0; lGetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /* Determine the number of elements that are treated simultaneously in the matrix products to obtain good gemm performance. */ @@ -7321,7 +7321,7 @@ void CFEM_DG_EulerSolver::ComputeVerificationError(CGeometry *geometry, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /*--- Reset the global error measures to zero. ---*/ for (unsigned short iVar = 0; iVar < nVar; iVar++) { @@ -8657,7 +8657,7 @@ void CFEM_DG_EulerSolver::BC_Custom(CConfig *config, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /*--- Loop over the requested range of surface faces. Multiple faces are treated simultaneously to improve the performance of the matrix @@ -9382,7 +9382,7 @@ void CFEM_DG_EulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, C unsigned short iVar; unsigned long index; - const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); + const bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); string restart_filename = config->GetSolution_FileName(); diff --git a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp index 8583a431c87..50836419233 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp @@ -893,7 +893,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->GetTime_Marching() == TIME_STEPPING; + const bool time_stepping = config->GetTime_Marching() == TIME_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. */ @@ -951,7 +951,7 @@ void CFEM_DG_NSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai } else { /*--- Check for a compressible solver. ---*/ - if(config->GetKind_Regime() == COMPRESSIBLE) { + if(config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { /*--- Loop over the owned volume elements. Multiple elements are treated simultaneously to improve the performance of the matrix @@ -3155,7 +3155,7 @@ void CFEM_DG_NSSolver::Volume_Residual(CConfig *config, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /* Constant factor present in the heat flux vector. */ const su2double factHeatFlux_Lam = Gamma/Prandtl_Lam; @@ -6055,7 +6055,7 @@ void CFEM_DG_NSSolver::BC_Custom(CConfig *config, /*--- Get the physical time if necessary. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) 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/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index 3c472113a1a..45693ca28af 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -1028,8 +1028,8 @@ void CHeatSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **solv thermal_diffusivity = GetConjugateHeatVariable(val_marker, iVertex, 2)/rho_cp_solid; - if ((config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { Tinterface = nodes->GetSolution(iPoint,0); Tnormal_Conjugate = GetConjugateHeatVariable(val_marker, iVertex, 3)/Temperature_Ref; @@ -1206,8 +1206,8 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, || (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->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); eddy_viscosity = 0.0; @@ -1373,7 +1373,7 @@ void CHeatSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, } /*--- For exact time solution use the minimum delta time of the whole mesh ---*/ - if (config->GetTime_Marching() == TIME_STEPPING) { + if (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING) { #ifdef HAVE_MPI su2double rbuf_time, sbuf_time; sbuf_time = Global_Delta_Time; @@ -1557,8 +1557,8 @@ void CHeatSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_co su2double Area_Children, Area_Parent, *Solution_Fine, *Solution; bool restart = (config->GetRestart() || config->GetRestart_Flow()); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_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 ---*/ @@ -1599,7 +1599,7 @@ void CHeatSolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_co } if ((restart && (long)TimeIter == (long)config->GetRestart_Iter()) && - (config->GetTime_Marching() == DT_STEPPING_2ND)) { + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { /*--- Load an additional restart file for a 2nd-order restart ---*/ @@ -1656,9 +1656,9 @@ void CHeatSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con time discretization scheme (1st- or 2nd-order).---*/ for (iVar = 0; iVar < nVar; iVar++) { - if (config->GetTime_Marching() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) Residual[iVar] = (U_time_nP1[iVar] - U_time_n[iVar])*Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_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); } @@ -1670,9 +1670,9 @@ void CHeatSolver::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->GetTime_Marching() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) Jacobian_i[iVar][iVar] = Volume_nP1 / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) Jacobian_i[iVar][iVar] = (Volume_nP1*3.0)/(2.0*TimeStep); } diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 830cdd25b4d..08054325b00 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -36,7 +36,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh, const bool navier_stokes) : - CFVMFlowSolverBase() { + CFVMFlowSolverBase() { /*--- Based on the navier_stokes boolean, determine if this constructor is * being called by itself, or by its derived class CIncNSSolver. ---*/ @@ -48,9 +48,9 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned bool restart = (config->GetRestart() || config->GetRestart_Flow()); int Unst_RestartIter; unsigned short iZone = config->GetiZone(); - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING; bool adjoint = (config->GetContinuous_Adjoint()) || (config->GetDiscrete_Adjoint()); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ @@ -74,7 +74,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned if (dual_time) { if (adjoint) Unst_RestartIter = SU2_TYPE::Int(config->GetUnst_AdjointIter())-1; - else if (config->GetTime_Marching() == DT_STEPPING_1ST) + else if (config->GetTime_Marching() == TIME_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"); @@ -238,13 +238,13 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i su2double Mach = config->GetMach(); su2double Reynolds = config->GetReynolds(); - bool unsteady = (config->GetTime_Marching() != NO); + bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); bool viscous = config->GetViscous(); bool turbulent = ((config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS)); bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST))); bool energy = config->GetEnergy_Equation(); - bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); + bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); /*--- Compute dimensional free-stream values. ---*/ @@ -558,16 +558,16 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i switch (config->GetKind_DensityModel()) { - case CONSTANT: + case INC_DENSITYMODEL::CONSTANT: if (energy) cout << "Energy equation is active and decoupled." << endl; else cout << "No energy equation." << endl; break; - case BOUSSINESQ: + case INC_DENSITYMODEL::BOUSSINESQ: if (energy) cout << "Energy equation is active and coupled through Boussinesq approx." << endl; break; - case VARIABLE: + case INC_DENSITYMODEL::VARIABLE: if (energy) cout << "Energy equation is active and coupled for variable density." << endl; break; @@ -1264,13 +1264,13 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont const bool rotating_frame = config->GetRotating_Frame(); const bool axisymmetric = config->GetAxisymmetric(); const bool body_force = config->GetBody_Force(); - const bool boussinesq = (config->GetKind_DensityModel() == BOUSSINESQ); + const bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); const bool viscous = config->GetViscous(); const bool radiation = config->AddRadiation(); const bool vol_heat = config->GetHeatSource(); const bool turbulent = (config->GetKind_Turb_Model() != NONE); const bool energy = config->GetEnergy_Equation(); - const bool streamwise_periodic = config->GetKind_Streamwise_Periodic(); + const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); if (body_force) { @@ -1611,7 +1611,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont /*--- Get the physical time. ---*/ su2double time = 0.0; - if (config->GetTime_Marching()) time = config->GetPhysicalTime(); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) time = config->GetPhysicalTime(); /*--- Loop over points ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) @@ -1806,7 +1806,7 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo su2double BetaInc2, Density, dRhodT, Temperature, oneOverCp, Cp; su2double Velocity[MAXNDIM] = {0.0}; - bool variable_density = (config->GetKind_DensityModel() == VARIABLE); + bool variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool energy = config->GetEnergy_Equation(); @@ -2046,7 +2046,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - unsigned short Kind_Inlet = config->GetKind_Inc_Inlet(Marker_Tag); + INLET_TYPE Kind_Inlet = config->GetKind_Inc_Inlet(Marker_Tag); su2double Normal[MAXNDIM] = {0.0}; @@ -2101,7 +2101,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Velocity and temperature (if required) been specified at the inlet. ---*/ - case VELOCITY_INLET: + case INLET_TYPE::VELOCITY_INLET: /*--- Retrieve the specified velocity and temperature for the inlet. ---*/ @@ -2120,7 +2120,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Stagnation pressure has been specified at the inlet. ---*/ - case PRESSURE_INLET: + case INLET_TYPE::PRESSURE_INLET: /*--- Retrieve the specified total pressure for the inlet. ---*/ @@ -2191,6 +2191,9 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, break; + default: + SU2_MPI::Error("Unsupported INC_INLET_TYPE.", CURRENT_FUNCTION); + break; } /*--- Access density at the node. This is either constant by @@ -2286,7 +2289,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, su2double Normal[MAXNDIM] = {0.0}; - unsigned short Kind_Outlet = config->GetKind_Inc_Outlet(Marker_Tag); + INC_OUTLET_TYPE Kind_Outlet = config->GetKind_Inc_Outlet(Marker_Tag); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -2327,7 +2330,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Velocity and temperature (if required) been specified at the inlet. ---*/ - case PRESSURE_OUTLET: + case INC_OUTLET_TYPE::PRESSURE_OUTLET: /*--- Retrieve the specified back pressure for this outlet. ---*/ @@ -2347,7 +2350,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- A mass flow target has been specified for the outlet. ---*/ - case MASS_FLOW_OUTLET: + case INC_OUTLET_TYPE::MASS_FLOW_OUTLET: /*--- Retrieve the specified target mass flow at the outlet. ---*/ @@ -2486,8 +2489,8 @@ void CIncEulerSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver su2double Density, Cp; const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool first_order = (config->GetTime_Marching() == DT_STEPPING_1ST); - const bool second_order = (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool first_order = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); + const bool second_order = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool energy = config->GetEnergy_Equation(); const int ndim = nDim; @@ -2727,7 +2730,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, bool Evaluate_BC = false; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_TagBound = config->GetMarker_Outlet_TagBound(iMarker_Outlet); - if (config->GetKind_Inc_Outlet(Outlet_TagBound) == MASS_FLOW_OUTLET) + if (config->GetKind_Inc_Outlet(Outlet_TagBound) == INC_OUTLET_TYPE::MASS_FLOW_OUTLET) Evaluate_BC = true; } diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 92b0fdfc925..d1a277e38e2 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -32,7 +32,7 @@ /*--- Explicit instantiation of the parent class of CIncEulerSolver, * to spread the compilation over two cpp files. ---*/ -template class CFVMFlowSolverBase; +template class CFVMFlowSolverBase; CIncNSSolver::CIncNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : @@ -98,13 +98,13 @@ void CIncNSSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container ComputeVorticityAndStrainMag<1>(*config, iMesh); /*--- Compute recovered pressure and temperature for streamwise periodic flow ---*/ - if (config->GetKind_Streamwise_Periodic() != NONE) + if (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE) Compute_Streamwise_Periodic_Recovered_Values(config, geometry, iMesh); } -void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, - CConfig *config, - const unsigned short iMesh) { +void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, + CConfig *config, + const unsigned short iMesh) { /*---------------------------------------------------------------------------------------------*/ // 1. Evaluate massflow, area avg density & Temperature and Area at streamwise periodic outlet. @@ -182,7 +182,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geome SPvals.Streamwise_Periodic_PressureDrop = config->GetStreamwise_Periodic_PressureDrop() / config->GetPressure_Ref(); } - if (config->GetKind_Streamwise_Periodic() == STREAMWISE_MASSFLOW) { + if (config->GetKind_Streamwise_Periodic() == ENUM_STREAMWISE_PERIODIC::MASSFLOW) { /*------------------------------------------------------------------------------------------------*/ /*--- 2. Update the Pressure Drop [Pa] for the Momentum source term if Massflow is prescribed. ---*/ /*--- The Pressure drop is iteratively adapted to result in the prescribed Target-Massflow. ---*/ @@ -353,7 +353,7 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const bool energy = config->GetEnergy_Equation(); /*--- Variables for streamwise periodicity ---*/ - const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != NONE); + const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); su2double Cp, thermal_conductivity, dot_product, scalar_factor; @@ -550,8 +550,8 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol su2double Tconjugate = GetConjugateHeatVariable(val_marker, iVertex, 0) / Temperature_Ref; su2double Twall = 0.0; - if ((config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { /*--- Compute closest normal neighbor ---*/ @@ -572,8 +572,8 @@ void CIncNSSolver::BC_ConjugateHeat_Interface(CGeometry *geometry, CSolver **sol Twall = (There*HF_FactorHere + Tconjugate*HF_FactorConjugate)/(HF_FactorHere + HF_FactorConjugate); } - else if ((config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX)) { + else if ((config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX)) { /*--- (Directly) Set wall temperature to conjugate temperature. ---*/ diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index e784308a743..152d9ff2a5b 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -598,9 +598,9 @@ void CMeshSolver::ComputeGridVelocity(CGeometry *geometry, CConfig *config){ su2double GridVel = 0.0; - if (config->GetTime_Marching() == DT_STEPPING_1ST) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) GridVel = ( Disp_nP1[iDim] - Disp_n[iDim] ) / TimeStep; - if (config->GetTime_Marching() == DT_STEPPING_2ND) + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) GridVel = ( 3.0*Disp_nP1[iDim] - 4.0*Disp_n[iDim] + 1.0*Disp_nM1[iDim] ) / (2.0*TimeStep); @@ -853,7 +853,7 @@ void CMeshSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { /*--- Determine how many files need to be read. ---*/ - unsigned short nSteps = (config->GetTime_Marching() == DT_STEPPING_2ND) ? 2 : 1; + unsigned short nSteps = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) ? 2 : 1; for(unsigned short iStep = 1; iStep <= nSteps; ++iStep) { diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 879ee715952..27a820d0cc0 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -34,7 +34,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh, const bool navier_stokes) : - CFVMFlowSolverBase() { + CFVMFlowSolverBase() { /*--- Based on the navier_stokes boolean, determine if this constructor is * being called by itself, or by its derived class CNEMONSSolver. ---*/ @@ -53,9 +53,9 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, bool restart = (config->GetRestart() || config->GetRestart_Flow()); unsigned short direct_diff = config->GetDirectDiff(); 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; + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING; bool adjoint = config->GetDiscrete_Adjoint(); string filename_ = "flow"; @@ -71,7 +71,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, /*--- 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->GetTime_Marching() == DT_STEPPING_1ST) + else if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-1; else Unst_RestartIter = SU2_TYPE::Int(config->GetRestart_Iter())-2; } @@ -1066,7 +1066,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short su2double Mach = config->GetMach(); su2double Reynolds = config->GetReynolds(); - bool unsteady = (config->GetTime_Marching() != NO); + bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); bool viscous = config->GetViscous(); bool dynamic_grid = config->GetGrid_Movement(); bool gravity = config->GetGravityForce(); @@ -1712,7 +1712,7 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solution_containe bool dynamic_grid = config->GetGrid_Movement(); su2double Two_Gamma_M1 = 2.0/Gamma_Minus_One; su2double Gas_Constant = config->GetGas_ConstantND(); - unsigned short Kind_Inlet = config->GetKind_Inlet(); + INLET_TYPE Kind_Inlet = config->GetKind_Inlet(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); su2double *U_domain = new su2double[nVar]; su2double *U_inlet = new su2double[nVar]; @@ -1759,7 +1759,7 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solution_containe switch (Kind_Inlet) { /*--- Total properties have been specified at the inlet. ---*/ - case TOTAL_CONDITIONS: + case INLET_TYPE::TOTAL_CONDITIONS: /*--- Retrieve the specified total conditions for this inlet. ---*/ P_Total = config->GetInlet_Ptotal(Marker_Tag); @@ -1865,7 +1865,7 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solution_containe break; /*--- Mass flow has been specified at the inlet. ---*/ - case MASS_FLOW: + case INLET_TYPE::MASS_FLOW: /*--- Retrieve the specified mass flow for the inlet. ---*/ Density = config->GetInlet_Ttotal(Marker_Tag); @@ -1916,6 +1916,10 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solution_containe V_inlet[nDim+2] = Density; break; + + default: + SU2_MPI::Error("Unsupported INLET_TYPE.", CURRENT_FUNCTION); + break; } /*--- Set various quantities in the solver class ---*/ diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index 3d34fd0a4ef..8c51b809865 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -33,7 +33,7 @@ /*--- Explicit instantiation of the parent class of CNEMOEulerSolver, * to spread the compilation over two cpp files. ---*/ -template class CFVMFlowSolverBase; +template class CFVMFlowSolverBase; CNEMONSSolver::CNEMONSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : CNEMOEulerSolver(geometry, config, iMesh, true) { diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 2e561b70a37..6c602327ff1 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -33,7 +33,7 @@ /*--- Explicit instantiation of the parent class of CEulerSolver, * to spread the compilation over two cpp files. ---*/ -template class CFVMFlowSolverBase; +template class CFVMFlowSolverBase; CNSSolver::CNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : @@ -533,8 +533,8 @@ su2double CNSSolver::GetCHTWallTemperature(const CConfig* config, unsigned short su2double Twall = 0.0; - if ((config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { + if ((config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_NEUMANN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == CHT_COUPLING::AVERAGED_TEMPERATURE_ROBIN_HEATFLUX)) { /*--- Compute wall temperature from both temperatures ---*/ @@ -543,8 +543,8 @@ su2double CNSSolver::GetCHTWallTemperature(const CConfig* config, unsigned short Twall = (There*HF_FactorHere + Tconjugate*HF_FactorConjugate)/(HF_FactorHere + HF_FactorConjugate); } - else if ((config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) || - (config->GetKind_CHT_Coupling() == DIRECT_TEMPERATURE_ROBIN_HEATFLUX)) { + else if ((config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_NEUMANN_HEATFLUX) || + (config->GetKind_CHT_Coupling() == CHT_COUPLING::DIRECT_TEMPERATURE_ROBIN_HEATFLUX)) { /*--- (Directly) Set wall temperature to conjugate temperature. ---*/ diff --git a/SU2_CFD/src/solvers/CRadSolver.cpp b/SU2_CFD/src/solvers/CRadSolver.cpp index 090f35f362a..b900a30f130 100644 --- a/SU2_CFD/src/solvers/CRadSolver.cpp +++ b/SU2_CFD/src/solvers/CRadSolver.cpp @@ -104,7 +104,7 @@ void CRadSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c if (nDim == 2) skipVars += 6; if (nDim == 3) skipVars += 8; - bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); bool energy = config->GetEnergy_Equation(); bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 433e295132c..02e06afa37d 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -620,7 +620,7 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- Correction for compressible flows (use enthalpy) ---*/ - if (!(config->GetKind_Regime() == INCOMPRESSIBLE)) { + if (!(config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE)) { Pressure_i = base_nodes->GetPressure(iPoint); Pressure_j = base_nodes->GetPressure(jPoint); Diff[nVar-1] = ((base_nodes->GetSolution(iPoint,nVar-1) + Pressure_i) - @@ -679,7 +679,7 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- Use density instead of pressure for incomp. flows. ---*/ - if ((config->GetKind_Regime() == INCOMPRESSIBLE)) { + if ((config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE)) { Pressure_i = base_nodes->GetDensity(iPoint); Pressure_j = base_nodes->GetDensity(jPoint); } else { @@ -2649,7 +2649,7 @@ 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->GetTime_Marching() == DT_STEPPING_2ND) { + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) { ifstream restart_file_n1; string filename_n1; @@ -3300,9 +3300,9 @@ void CSolver::LoadInletProfile(CGeometry **geometry, unsigned long iPoint, iVertex, index, iChildren, Point_Fine, iRow; su2double Area_Children, Area_Parent, dist, min_dist, Interp_Radius, Theta; const su2double *Coord = nullptr; - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); - bool time_stepping = config->GetTime_Marching() == TIME_STEPPING; + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + bool time_stepping = config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING; string UnstExt, text_line; ifstream restart_file; diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index 33690ea185f..d5d8cb47e69 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -291,7 +291,7 @@ void CTurbSASolver::Source_Residual(CGeometry *geometry, CSolver **solver_contai CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool harmonic_balance = (config->GetTime_Marching() == HARMONIC_BALANCE); + const bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); const bool transition = (config->GetKind_Trans_Model() == LM); const bool transition_BC = (config->GetKind_Trans_Model() == BC); diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index 2ace5c5c495..64ea6dcf525 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -612,7 +612,7 @@ void CTurbSolver::PrepareImplicitIteration(CGeometry *geometry, CSolver** solver void CTurbSolver::CompleteImplicitIteration(CGeometry *geometry, CSolver **solver_container, CConfig *config) { - const bool compressible = (config->GetKind_Regime() == COMPRESSIBLE); + const bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); const auto flowNodes = solver_container[FLOW_SOL]->GetNodes(); @@ -750,9 +750,9 @@ void CTurbSolver::SetResidual_DualTime(CGeometry *geometry, CSolver **solver_con const bool sst_model = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool first_order = (config->GetTime_Marching() == DT_STEPPING_1ST); - const bool second_order = (config->GetTime_Marching() == DT_STEPPING_2ND); - const bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + const bool first_order = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); + const bool second_order = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); + const bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); /*--- Flow solution, needed to get density. ---*/ @@ -1054,7 +1054,7 @@ void CTurbSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig * Therefore, we must reduce skipVars here if energy is inactive so that the turbulent variables are read correctly. ---*/ - bool incompressible = (config->GetKind_Regime() == INCOMPRESSIBLE); + bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); bool energy = config->GetEnergy_Equation(); bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); diff --git a/SU2_CFD/src/variables/CAdjEulerVariable.cpp b/SU2_CFD/src/variables/CAdjEulerVariable.cpp index 285ac870c74..7b6806823cc 100644 --- a/SU2_CFD/src/variables/CAdjEulerVariable.cpp +++ b/SU2_CFD/src/variables/CAdjEulerVariable.cpp @@ -32,8 +32,8 @@ CAdjEulerVariable::CAdjEulerVariable(su2double psirho, const su2double *phi, su2 unsigned long nvar, CConfig *config) : CVariable(npoint, ndim, nvar, config), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient) { - bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); + bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); /*--- Allocate residual structures ---*/ Res_TruncError.resize(nPoint,nVar) = su2double(0.0); @@ -95,7 +95,7 @@ CAdjEulerVariable::CAdjEulerVariable(su2double psirho, const su2double *phi, su2 IntBoundary_Jump.resize(nPoint,nVar) = su2double(0.0); /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetTime_Marching() == HARMONIC_BALANCE) + if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) HB_Source.resize(nPoint,nVar) = su2double(0.0); if (config->GetMultizone_Problem()) diff --git a/SU2_CFD/src/variables/CDiscAdjVariable.cpp b/SU2_CFD/src/variables/CDiscAdjVariable.cpp index 2dc7b9c3e28..ae1133ad6a4 100644 --- a/SU2_CFD/src/variables/CDiscAdjVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjVariable.cpp @@ -32,8 +32,8 @@ CDiscAdjVariable::CDiscAdjVariable(const su2double* sol, unsigned long npoint, unsigned long ndim, unsigned long nvar, CConfig *config) : CVariable(npoint, ndim, nvar, config) { - bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); + bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); bool fsi = config->GetFSI_Simulation(); diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index 222a76bfbcc..461fa4c8d48 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -32,8 +32,8 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 unsigned long ndim, unsigned long nvar, CConfig *config) : CVariable(npoint, ndim, nvar, config), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool viscous = config->GetViscous(); const bool windgust = config->GetWind_Gust(); const bool classical_rk4 = (config->GetKind_TimeIntScheme_Flow() == CLASSICAL_RK4_EXPLICIT); @@ -97,7 +97,7 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetTime_Marching() == HARMONIC_BALANCE) + if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) HB_Source.resize(nPoint,nVar) = su2double(0.0); /*--- Allocate vector for wind gust and wind gust derivative field ---*/ diff --git a/SU2_CFD/src/variables/CHeatVariable.cpp b/SU2_CFD/src/variables/CHeatVariable.cpp index f4980a0b935..7075f9189e7 100644 --- a/SU2_CFD/src/variables/CHeatVariable.cpp +++ b/SU2_CFD/src/variables/CHeatVariable.cpp @@ -33,8 +33,8 @@ CHeatVariable::CHeatVariable(su2double heat, unsigned long npoint, unsigned long : CVariable(npoint, ndim, nvar, config), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient) { bool low_fidelity = false; - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); /*--- Initialization of heat variable ---*/ diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index 31803207291..c0b4f30e36f 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -32,8 +32,8 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci unsigned long ndim, unsigned long nvar, CConfig *config) : CVariable(npoint, ndim, nvar, config), Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { - const bool dual_time = (config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND); + const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool viscous = config->GetViscous(); /*--- Allocate and initialize the primitive variables and gradients. @@ -115,7 +115,7 @@ CIncEulerVariable::CIncEulerVariable(su2double pressure, const su2double *veloci Lambda.resize(nPoint) = su2double(0.0); Sensor.resize(nPoint) = su2double(0.0); - if (config->GetKind_Streamwise_Periodic() != NONE) { + if (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE) { Streamwise_Periodic_RecoveredPressure.resize(nPoint) = su2double(0.0); if (config->GetStreamwise_Periodic_Temperature()) Streamwise_Periodic_RecoveredTemperature.resize(nPoint) = su2double(0.0); diff --git a/SU2_CFD/src/variables/CTurbSAVariable.cpp b/SU2_CFD/src/variables/CTurbSAVariable.cpp index 7ec68b25115..11b5faa92af 100644 --- a/SU2_CFD/src/variables/CTurbSAVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSAVariable.cpp @@ -38,8 +38,8 @@ CTurbSAVariable::CTurbSAVariable(su2double val_nu_tilde, su2double val_muT, unsi muT.resize(nPoint) = val_muT; /*--- Allocate and initialize solution for the dual time strategy ---*/ - bool dual_time = ((config->GetTime_Marching() == DT_STEPPING_1ST) || - (config->GetTime_Marching() == DT_STEPPING_2ND)); + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); if (dual_time) { Solution_time_n = Solution; diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index 722dffa5bf7..f01c4f13011 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -34,7 +34,7 @@ CTurbVariable::CTurbVariable(unsigned long npoint, unsigned long ndim, unsigned /*--- Allocate space for the harmonic balance source terms ---*/ - if (config->GetTime_Marching() == HARMONIC_BALANCE) { + if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { HB_Source.resize(nPoint,nVar) = su2double(0.0); } diff --git a/SU2_CFD/src/variables/CVariable.cpp b/SU2_CFD/src/variables/CVariable.cpp index ff9e9ef4eb3..21524260356 100644 --- a/SU2_CFD/src/variables/CVariable.cpp +++ b/SU2_CFD/src/variables/CVariable.cpp @@ -59,7 +59,7 @@ CVariable::CVariable(unsigned long npoint, unsigned long ndim, unsigned long nva Solution_Old.resize(nPoint,nVar) = su2double(0.0); - if (config->GetTime_Marching() != NO) { + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) { Solution_time_n.resize(nPoint,nVar); Solution_time_n1.resize(nPoint,nVar); } diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index 5883ded57bf..adb078ae4a1 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) { for variables allocation) ---*/ CConfig *config = nullptr; - config = new CConfig(config_file_name, SU2_DEF); + config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DEF); nZone = config->GetnZone(); @@ -94,7 +94,7 @@ int main(int argc, char *argv[]) { } /*--- Initialize the configuration of the driver ---*/ - driver_config = new CConfig(config_file_name, SU2_DEF, false); + driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DEF, false); /*--- Initialize a char to store the zone filename ---*/ char zone_file_name[MAX_STRING_SIZE]; @@ -111,10 +111,10 @@ int main(int argc, char *argv[]) { if (driver_config->GetnConfigFiles() > 0){ strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); - config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_DEF, iZone, nZone, true); + config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_DEF, iZone, nZone, true); } else{ - config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_DEF, iZone, nZone, true); + config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_DEF, iZone, nZone, true); } config_container[iZone]->SetMPICommunicator(MPICommunicator); } diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index e2b2de498be..f544b6e63fe 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { for variables allocation) ---*/ CConfig *config = nullptr; - config = new CConfig(config_file_name, SU2_DOT); + config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DOT); const auto nZone = config->GetnZone(); @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) { } /*--- Initialize the configuration of the driver ---*/ - driver_config = new CConfig(config_file_name, SU2_DOT, false); + driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DOT, false); /*--- Initialize a char to store the zone filename ---*/ char zone_file_name[MAX_STRING_SIZE]; @@ -114,10 +114,10 @@ int main(int argc, char *argv[]) { if (driver_config->GetnConfigFiles() > 0){ strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); - config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_DOT, iZone, nZone, true); + config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_DOT, iZone, nZone, true); } else{ - config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_DOT, iZone, nZone, true); + config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_DOT, iZone, nZone, true); } config_container[iZone]->SetMPICommunicator(MPICommunicator); diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index e184cc24909..2659e948b2e 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) { for variables allocation) ---*/ CConfig *config = nullptr; - config = new CConfig(config_file_name, SU2_GEO); + config = new CConfig(config_file_name, SU2_COMPONENT::SU2_GEO); nZone = config->GetnZone(); @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) { constructor, the input configuration file is parsed and all options are read and stored. ---*/ - config_container[iZone] = new CConfig(config_file_name, SU2_GEO, true); + config_container[iZone] = new CConfig(config_file_name, SU2_COMPONENT::SU2_GEO, true); config_container[iZone]->SetMPICommunicator(MPICommunicator); /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ diff --git a/SU2_PY/pySU2/pySU2.i b/SU2_PY/pySU2/pySU2.i index f73635fbdd2..e783ac8b48b 100644 --- a/SU2_PY/pySU2/pySU2.i +++ b/SU2_PY/pySU2/pySU2.i @@ -73,12 +73,12 @@ namespace std { /*! * \brief different software components of SU2 */ -enum SU2_COMPONENT { - SU2_CFD = 1, /*!< \brief Running the SU2_CFD software. */ - SU2_DEF = 2, /*!< \brief Running the SU2_DEF software. */ - SU2_DOT = 3, /*!< \brief Running the SU2_DOT software. */ - SU2_GEO = 5, /*!< \brief Running the SU2_GEO software. */ - SU2_SOL = 6 /*!< \brief Running the SU2_SOL software. */ +enum class SU2_COMPONENT { + SU2_CFD, /*!< \brief Running the SU2_CFD software. */ + SU2_DEF, /*!< \brief Running the SU2_DEF software. */ + SU2_DOT, /*!< \brief Running the SU2_DOT software. */ + SU2_GEO, /*!< \brief Running the SU2_GEO software. */ + SU2_SOL /*!< \brief Running the SU2_SOL software. */ }; const unsigned int MESH_0 = 0; /*!< \brief Definition of the finest grid level. */ diff --git a/SU2_PY/pySU2/pySU2ad.i b/SU2_PY/pySU2/pySU2ad.i index 19bb87c2b3d..d873a96aaa4 100644 --- a/SU2_PY/pySU2/pySU2ad.i +++ b/SU2_PY/pySU2/pySU2ad.i @@ -73,12 +73,12 @@ namespace std { /*! * \brief different software components of SU2 */ -enum SU2_COMPONENT { - SU2_CFD = 1, /*!< \brief Running the SU2_CFD software. */ - SU2_DEF = 2, /*!< \brief Running the SU2_DEF software. */ - SU2_DOT = 3, /*!< \brief Running the SU2_DOT software. */ - SU2_GEO = 5, /*!< \brief Running the SU2_GEO software. */ - SU2_SOL = 6 /*!< \brief Running the SU2_SOL software. */ +enum class SU2_COMPONENT { + SU2_CFD, /*!< \brief Running the SU2_CFD software. */ + SU2_DEF, /*!< \brief Running the SU2_DEF software. */ + SU2_DOT, /*!< \brief Running the SU2_DOT software. */ + SU2_GEO, /*!< \brief Running the SU2_GEO software. */ + SU2_SOL /*!< \brief Running the SU2_SOL software. */ }; const unsigned int MESH_0 = 0; /*!< \brief Definition of the finest grid level. */ diff --git a/SU2_SOL/src/SU2_SOL.cpp b/SU2_SOL/src/SU2_SOL.cpp index 8b7dab58fd1..04e1b921f29 100644 --- a/SU2_SOL/src/SU2_SOL.cpp +++ b/SU2_SOL/src/SU2_SOL.cpp @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { else { strcpy(config_file_name, "default.cfg"); } CConfig *config = nullptr; - config = new CConfig(config_file_name, SU2_SOL); + config = new CConfig(config_file_name, SU2_COMPONENT::SU2_SOL); const auto nZone = config->GetnZone(); @@ -79,7 +79,7 @@ int main(int argc, char *argv[]) { } /*--- Initialize the configuration of the driver ---*/ - driver_config = new CConfig(config_file_name, SU2_SOL, false); + driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_SOL, false); /*--- Initialize a char to store the zone filename ---*/ char zone_file_name[MAX_STRING_SIZE]; @@ -99,10 +99,10 @@ int main(int argc, char *argv[]) { if (driver_config->GetnConfigFiles() > 0){ strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); - config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_SOL, iZone, nZone, true); + config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_SOL, iZone, nZone, true); } else{ - config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_SOL, iZone, nZone, true); + config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_SOL, iZone, nZone, true); } config_container[iZone]->SetMPICommunicator(MPICommunicator); @@ -352,11 +352,11 @@ int main(int argc, char *argv[]) { 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))) || + !((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND))) || (StopCalc) || - (((config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND)) && + (((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0)))) && @@ -445,9 +445,9 @@ int main(int argc, char *argv[]) { 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() == TIME_STEPPING)) || + !(config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING)) || (StopCalc) || - ((config_container[ZONE_0]->GetTime_Marching() == TIME_STEPPING) && + ((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0)))) { /*--- Read in the restart file for this time step ---*/ @@ -538,11 +538,11 @@ int main(int argc, char *argv[]) { 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))) || + !((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND))) || (StopCalc) || - (((config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetTime_Marching() == DT_STEPPING_2ND)) && + (((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolume_Wrt_Freq() == 0)))) { @@ -587,7 +587,7 @@ int main(int argc, char *argv[]) { } - else if (config_container[ZONE_0]->GetTime_Marching() == HARMONIC_BALANCE) { + else if (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { /*--- Read in the restart file for this time step ---*/ for (iZone = 0; iZone < nZone; iZone++) { diff --git a/UnitTests/SU2_CFD/gradients.cpp b/UnitTests/SU2_CFD/gradients.cpp index fe9bfd5baa3..b8a1b1a6232 100644 --- a/UnitTests/SU2_CFD/gradients.cpp +++ b/UnitTests/SU2_CFD/gradients.cpp @@ -64,7 +64,7 @@ struct GradientTestBase { auto origBuf = cout.rdbuf(); cout.rdbuf(nullptr); stringstream ss(configOptions); - config = std::unique_ptr(new CConfig(ss, SU2_CFD, false)); + config = std::unique_ptr(new CConfig(ss, SU2_COMPONENT::SU2_CFD, false)); cout.rdbuf(origBuf); } diff --git a/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp b/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp index a33fa889f31..9fe3f931ee8 100644 --- a/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp +++ b/UnitTests/SU2_CFD/numerics/CNumerics_tests.cpp @@ -39,7 +39,7 @@ TEST_CASE("NTS blending has a minimum of 0.05", "[Upwind/central blending]") { /*--- Setup ---*/ - CConfig* config = new CConfig(config_options, SU2_CFD, false); + CConfig* config = new CConfig(config_options, SU2_COMPONENT::SU2_CFD, false); const su2double dissipation_i = 0; const su2double dissipation_j = 0; diff --git a/UnitTests/UnitQuadTestCase.hpp b/UnitTests/UnitQuadTestCase.hpp index 177350bdf3c..f972707a989 100644 --- a/UnitTests/UnitQuadTestCase.hpp +++ b/UnitTests/UnitQuadTestCase.hpp @@ -67,7 +67,7 @@ struct UnitQuadTestCase { void InitConfig() { cout.rdbuf(nullptr); stringstream ss(config_options); - config = std::unique_ptr(new CConfig(ss, SU2_CFD, false)); + config = std::unique_ptr(new CConfig(ss, SU2_COMPONENT::SU2_CFD, false)); cout.rdbuf(orig_buf); }